Changeset 2409 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials
- Timestamp:
- 06/05/07 14:26:25 (18 years ago)
- 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 59 59 float cosb = max(dot(IN.wNormal.xyz, diff), 0); 60 60 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; 63 63 64 64 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl
r2404 r2409 128 128 RR = R; 129 129 RR = Hit(cubePos, R, DistanceMap); 130 Color = readCubeMap(CubeMap, R );130 Color = readCubeMap(CubeMap, RR); 131 131 //Color = readDistanceCubeMap(DistanceMap, cubePos)/300.0; 132 132 //return Color; -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMap.hlsl
r2403 r2409 44 44 float2 prmTexPos = float2( 45 45 (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; 47 47 48 48 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 34 34 output.tex = (input.pos + 1.0) / 2.0; 35 35 //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; 37 38 38 39 return output; … … 44 45 { 45 46 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; 47 48 int werx = bushIndex % nRadionColumns; 48 49 int wery = bushIndex / nRadionColumns; 49 50 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; 51 54 dir = normalize(dir); 52 55 … … 60 63 float4 lightVPos = mul(lightViewProj, float4(pos,1)); 61 64 62 //if( lightVPos.z > 0.0)63 //{65 if( lightVPos.z > 0.0) 66 { 64 67 lightVPos /= lightVPos.w; 65 //float d = length(lightVPos.xy);68 float d = length(lightVPos.xy); 66 69 67 //if(d <= 1.0)70 if(d <= 1.0) 68 71 { 69 72 float dist = dist / lightFarPlane; … … 73 76 visibility = dist < storedDist + DIST_BIAS; 74 77 } 75 //}78 } 76 79 //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; 81 84 spotFalloff = pow(saturate(spotFalloff), spotLightFalloff); 82 85 83 86 visibility *= spotFalloff / (lightAttenuation.y + dist * lightAttenuation.z + dist2 * lightAttenuation.w); 84 87 85 float4 ret = visibility * cosb *lightPower * lightColor;88 float4 ret = visibility * cosb * lightPower * lightColor; 86 89 return ret; 87 90 } … … 113 116 visibility = (distNorm <= storedDist); 114 117 115 //visibility = 1.0 + 0.00001 * visibility;118 visibility = 1.0 + 0.00001 * visibility; 116 119 visibility *= 1.0 / (lightAttenuation.y + dist * lightAttenuation.z + dist * dist * lightAttenuation.w); 117 120
Note: See TracChangeset
for help on using the changeset viewer.