- Timestamp:
- 07/03/07 11:03:46 (17 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/pathmap
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/pathmap/FlexVertex.cpp
r2304 r2498 17 17 nTex(2) 18 18 { 19 unsigned int ii[16] = { 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152};19 unsigned int ii[16] = {24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144}; 20 20 for(int iu=0; iu<16; iu++) 21 21 texByteOffset[iu] = ii[iu]; -
GTP/trunk/App/Demos/Illum/pathmap/Mesh.cpp
r2469 r2498 63 63 &nSubsets, 64 64 &mesh); 65 materialNames = new wchar_t*[nSubsets+1]; 66 materialNames[nSubsets] = NULL; 67 for(int mi=0; mi<nSubsets; mi++) 68 materialNames[mi] = L::cloneW(L"noname"); 65 69 } 66 70 if(hr != S_OK) -
GTP/trunk/App/Demos/Illum/pathmap/SubMesh.cpp
r2304 r2498 70 70 LPDIRECT3DDEVICE9 device = parent->pathMapEffect->device; 71 71 72 72 73 if(edgeCount) 73 74 { 75 parent->pathMapEffect->effect->SetBool("bred", true); 76 parent->pathMapEffect->effect->CommitChanges(); 74 77 device->SetStreamSource(0, parent->edgeVertexBuffer, 0, parent->mesh->GetNumBytesPerVertex()); 75 78 device->DrawPrimitive(D3DPT_LINELIST, edgeStartIndex * 2, edgeCount); 79 parent->pathMapEffect->effect->SetBool("bred", false); 76 80 } 77 81 } -
GTP/trunk/App/Demos/Illum/pathmap/TriangleMesh.cpp
r2197 r2498 23 23 24 24 int pup = 0; 25 for(int p = 0; p < nMeshPatches; p++) 25 int p = 0; 26 for(p = 0; p < nMeshPatches; p++) 26 27 { 27 28 meshPatches[p].vertexIndices[0] = indexBuffer[pup++]; -
GTP/trunk/App/Demos/Illum/pathmap/computeWeights.fx
r2212 r2498 31 31 vsOutputComputeWeights output = (vsOutputComputeWeights)0; 32 32 output.pos = input.pos; 33 output.tex = input.tex; 33 34 output.tex = (input.pos + 1.0) / 2.0; 35 output.tex.y = 1.0 - output.tex.y; 36 37 //output.tex = input.tex; 34 38 return output; 35 39 } … … 44 48 float3 pos = tex2D(radionSampler, float2((werx + 0.25) * dataColumnWidth, (wery + 0.5) / 4096.0) ).xyz; 45 49 float3 dir = tex2D(radionSampler, float2((werx + 0.75) * dataColumnWidth, (wery + 0.5) / 4096.0) ).xyz; 46 50 /* 47 51 float3 diff = lightPos - pos; 48 52 float dist2 = dot(diff, diff); … … 71 75 // if(ret > WEIGHTCUTOFF) 72 76 // ret = WEIGHTCUTOFF; 77 */ 78 79 80 float3 diff = lightPos - pos; 81 float dist2 = dot(diff, diff); 82 if(dist2 < SAMPLECUTDIST2) 83 dist2 = SAMPLECUTDIST2; 84 diff = normalize(diff); 85 float cosa = max(dot(lightDir, -diff), 0); 86 float cosb = max(dot(dir, diff), 0); 87 float ret = pow(cosa, 9) * cosb / dist2; 88 return ret; 73 89 74 90 return float4(ret, ret, ret, ret);
Note: See TracChangeset
for help on using the changeset viewer.