Changeset 2498 for GTP


Ignore:
Timestamp:
07/03/07 11:03:46 (17 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/pathmap
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/pathmap/FlexVertex.cpp

    r2304 r2498  
    1717nTex(2) 
    1818{ 
    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}; 
    2020        for(int iu=0; iu<16; iu++) 
    2121                texByteOffset[iu] = ii[iu]; 
  • GTP/trunk/App/Demos/Illum/pathmap/Mesh.cpp

    r2469 r2498  
    6363                                                        &nSubsets, 
    6464                                                        &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"); 
    6569        } 
    6670        if(hr != S_OK) 
  • GTP/trunk/App/Demos/Illum/pathmap/SubMesh.cpp

    r2304 r2498  
    7070        LPDIRECT3DDEVICE9 device = parent->pathMapEffect->device; 
    7171 
     72         
    7273        if(edgeCount) 
    7374        { 
     75                parent->pathMapEffect->effect->SetBool("bred", true); 
     76                parent->pathMapEffect->effect->CommitChanges(); 
    7477                device->SetStreamSource(0, parent->edgeVertexBuffer, 0, parent->mesh->GetNumBytesPerVertex()); 
    7578                device->DrawPrimitive(D3DPT_LINELIST, edgeStartIndex * 2, edgeCount); 
     79                parent->pathMapEffect->effect->SetBool("bred", false); 
    7680        } 
    7781} 
  • GTP/trunk/App/Demos/Illum/pathmap/TriangleMesh.cpp

    r2197 r2498  
    2323 
    2424        int pup = 0; 
    25         for(int p = 0; p < nMeshPatches; p++) 
     25        int p = 0; 
     26        for(p = 0; p < nMeshPatches; p++) 
    2627        { 
    2728                meshPatches[p].vertexIndices[0] = indexBuffer[pup++]; 
  • GTP/trunk/App/Demos/Illum/pathmap/computeWeights.fx

    r2212 r2498  
    3131    vsOutputComputeWeights output = (vsOutputComputeWeights)0; 
    3232    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; 
    3438    return output; 
    3539} 
     
    4448        float3 pos = tex2D(radionSampler, float2((werx + 0.25) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz; 
    4549        float3 dir = tex2D(radionSampler, float2((werx + 0.75) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz; 
    46          
     50        /* 
    4751        float3 diff = lightPos - pos; 
    4852        float dist2 = dot(diff, diff); 
     
    7175//      if(ret > WEIGHTCUTOFF) 
    7276//              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; 
    7389         
    7490        return float4(ret, ret, ret, ret); 
Note: See TracChangeset for help on using the changeset viewer.