Changeset 1487 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Timestamp:
- 09/26/06 09:47:54 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Cau.hlsl
r1094 r1487 31 31 float4 pos = tex2Dlod(PhotonHitMap, float4(position.x, 1.0 - position.y,0,0)).rgba; 32 32 // float4 pos = float4(0,0,-0.5,1); 33 33 34 if(pos.a == 0)//no photon hit 34 35 { -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_CauCube.hlsl
r1355 r1487 16 16 17 17 float4 cPosition; 18 float pixel = 1.0 / resolution;18 float pixel = 1.0 / 32.0; 19 19 float2 uv = float2(position.x, 1.0 - position.y); 20 20 float4 pos = tex2Dlod(PhotonHitMap, float4(uv,0,0)).rgba; … … 23 23 { 24 24 OUT.color = float4(0,0,0,0); 25 OUT.hPosition = float4(0, 0, 1000000 00, 1);25 OUT.hPosition = float4(0, 0, 1000000, 1); 26 26 } 27 27 else … … 31 31 OUT.hPosition = mul(Proj, cPosition); 32 32 33 float intensity = 0. 5;33 float intensity = 0.25; 34 34 35 35 //read four neighbours 36 float valids = 0;37 36 float sumdist = 0; 38 37 float dist; 39 float4 pos1 = tex2Dlod(PhotonHitMap, float4(uv + float2(pixel, pixel),0,0)).rgba; 38 float valids = 0; 39 float4 pos1 = tex2Dlod(PhotonHitMap, float4(uv + float2(pixel, pixel),0,0)); 40 40 if(pos1.a != 0) 41 41 { 42 42 dist = length(pos1.xyz - pos.xyz); 43 sumdist += dist; 43 44 valids++; 44 sumdist += dist;45 45 } 46 float4 pos2 = tex2Dlod(PhotonHitMap, float4(uv + float2(-pixel, pixel),0,0)).rgba; 46 47 float4 pos2 = tex2Dlod(PhotonHitMap, float4(uv + float2(-pixel, pixel),0,0)); 47 48 if(pos2.a != 0) 48 49 { 49 50 dist = length(pos2.xyz - pos.xyz); 51 sumdist += dist; 50 52 valids++; 51 sumdist += dist;52 53 } 53 float4 pos3 = tex2Dlod(PhotonHitMap, float4(uv + float2(pixel, -pixel),0,0)).rgba; 54 55 float4 pos3 = tex2Dlod(PhotonHitMap, float4(uv + float2(pixel, -pixel),0,0)); 54 56 if(pos3.a != 0) 55 57 { 56 58 dist = length(pos3.xyz - pos.xyz); 59 sumdist += dist; 57 60 valids++; 58 sumdist += dist;59 61 } 60 float4 pos4 = tex2Dlod(PhotonHitMap, float4(uv + float2(-pixel, -pixel),0,0)).rgba; 62 63 float4 pos4 = tex2Dlod(PhotonHitMap, float4(uv + float2(-pixel, -pixel),0,0)); 61 64 if(pos4.a != 0) 62 65 { 63 66 dist = length(pos4.xyz - pos.xyz); 67 sumdist += dist; 64 68 valids++; 65 sumdist += dist;66 69 } 67 68 float avrdist = sumdist / valids;69 float maxdist = 0.1;70 71 float avrdist = sumdist / 4;//valids; 72 float maxdist = 1; 70 73 intensity = max(maxdist - avrdist, 0.0) / maxdist; 71 74 72 OUT.color = float4(1,1,1,intensity); 75 //intensity = valids / 4.0;//avrdist; 76 77 //OUT.color = float4(1,1,1,intensity); 78 OUT.color = intensity; 73 79 } 74 80 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Localized_EnvMap.hlsl
r1094 r1487 128 128 129 129 float cos_theta = -dot(V, mNormal); 130 float sFresnel = 0. 5;130 float sFresnel = 0.1; 131 131 float F = (sFresnel + pow(1-cos_theta, 5.0f) * (1-sFresnel)); 132 132 … … 229 229 float3 V = normalize(wPos - cameraPos); 230 230 231 float3 R = refract(V, mNormal, 0. 9);231 float3 R = refract(V, mNormal, 0.85); 232 232 //float3 R = V; 233 233 newTexCoord = R;
Note: See TracChangeset
for help on using the changeset viewer.