Ignore:
Timestamp:
06/05/07 14:26:25 (18 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/Media/materials
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasicShading.hlsl

    r2404 r2409  
    5959        float cosb = max(dot(IN.wNormal.xyz, diff), 0); 
    6060         
    61         //color.rgb += pow(cosa, 9) * cosb / dist2 * lightPower1 * lightColor1; 
    62         color.rgb += cosb / dist2 * lightPower1 * lightColor1; 
     61        color.rgb += pow(cosa, 9) * cosb / dist2 * lightPower1 * lightColor1; 
     62        //color.rgb += cosb / dist2 * lightPower1 * lightColor1; 
    6363         
    6464        } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl

    r2404 r2409  
    128128        RR = R;  
    129129        RR = Hit(cubePos, R, DistanceMap); 
    130         Color = readCubeMap(CubeMap, R); 
     130        Color = readCubeMap(CubeMap, RR); 
    131131        //Color = readDistanceCubeMap(DistanceMap, cubePos)/300.0; 
    132132        //return Color; 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMap.hlsl

    r2403 r2409  
    4444                float2 prmTexPos = float2( 
    4545                        (texAtlas.x + (iCluster % prmAtlasTiles.x)) / prmAtlasTiles.x, 
    46                         1.0 - (texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y);// + atlasHalfPixel; 
     46                        1.0 - (texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y) + atlasHalfPixel; 
    4747 
    4848                float weightIndex = tex2D(clusterWeightIndexSampler, float2(((float)iCluster + 0.5) / clusterCount, 0.5)).r; 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMapWeightCompute.hlsl

    r2403 r2409  
    3434    output.tex = (input.pos + 1.0) / 2.0; 
    3535    //output.tex = input.tex; 
    36     output.tex.y = 1.0 - output.tex.y; 
     36   // output.tex.y = 1.0 - output.tex.y; 
     37    input.pos.y *= -1; 
    3738    
    3839    return output; 
     
    4445{ 
    4546        float dataColumnWidth = 1.0 / (float)nRadionColumns; 
    46         int bushIndex = input.tex.x * 4096 + input.tex.y * nRadionColumns * 4096; 
     47        /*int bushIndex = input.tex.x * 4096 + input.tex.y * nRadionColumns * 4096; 
    4748        int werx = bushIndex % nRadionColumns; 
    4849        int wery = bushIndex / nRadionColumns; 
    4950        float3 pos = tex2D(radionSampler, float2((werx + 0.25) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz; 
    50         float3 dir = tex2D(radionSampler, float2((werx + 0.75) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz; 
     51        float3 dir = tex2D(radionSampler, float2((werx + 0.75) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz;*/ 
     52        float3 pos = tex2D(radionSampler, float2(input.tex.x + 0.25 * dataColumnWidth, input.tex.y  + 0.5 / 4096.0) ).xyz; 
     53        float3 dir = tex2D(radionSampler, float2(input.tex.x + 0.75 * dataColumnWidth, input.tex.y  + 0.5 / 4096.0) ).xyz; 
    5154        dir = normalize(dir); 
    5255         
     
    6063        float4 lightVPos = mul(lightViewProj, float4(pos,1)); 
    6164                 
    62         //if( lightVPos.z  > 0.0) 
    63         //{      
     65        if( lightVPos.z  > 0.0) 
     66        {        
    6467        lightVPos /= lightVPos.w; 
    65                 //float d = length(lightVPos.xy); 
     68                float d = length(lightVPos.xy); 
    6669                 
    67                 //if(d <= 1.0) 
     70                if(d <= 1.0) 
    6871        { 
    6972                        float dist = dist / lightFarPlane; 
     
    7376                        visibility = dist < storedDist + DIST_BIAS; 
    7477                } 
    75    // } 
     78    } 
    7679    //visibility = 1.0 - visibility; 
    77     visibility = 1.0 + 0.00001 * visibility; 
    78         float spotFalloff = (dot(-diff, normalize(lightDir)) - lightAngleCos) / (1.0 - lightAngleCos); 
    79         //spotFalloff = saturate(dot(normalize(pos - lightPos), normalize(lightDir))) + 0.0000000001 * lightAngleCos; 
    80         spotFalloff = 1.0 + spotFalloff * 0.000000001; 
     80    //visibility = 1.0 + 0.00001 * visibility; 
     81        //float spotFalloff = (dot(-diff, lightDir) - lightAngleCos) / (1.0 - lightAngleCos); 
     82        float spotFalloff = max( dot(-diff, lightDir), 0) + 0.0000000001 * lightAngleCos; 
     83        //spotFalloff = 1.0 + spotFalloff * 0.000000001; 
    8184        spotFalloff = pow(saturate(spotFalloff), spotLightFalloff); 
    8285                 
    8386        visibility *= spotFalloff / (lightAttenuation.y + dist * lightAttenuation.z + dist2 * lightAttenuation.w); 
    8487         
    85         float4 ret = visibility * cosb * lightPower * lightColor; 
     88        float4 ret = visibility * cosb  * lightPower * lightColor; 
    8689        return ret; 
    8790} 
     
    113116        visibility = (distNorm <= storedDist); 
    114117           
    115         //visibility = 1.0 + 0.00001 * visibility;               
     118        visibility = 1.0 + 0.00001 * visibility;                 
    116119        visibility *=  1.0 / (lightAttenuation.y + dist * lightAttenuation.z + dist * dist * lightAttenuation.w); 
    117120         
Note: See TracChangeset for help on using the changeset viewer.