Ignore:
Timestamp:
07/03/07 11:03:46 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.