Changeset 1094 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Timestamp:
- 07/07/06 08:53:01 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Cau.hlsl
r916 r1094 10 10 float2 center : TEXCOORD2; 11 11 float4 position : TEXCOORD3; 12 float pSize : PSIZE; 13 float dist : TEXCOORD4; 12 14 }; 13 15 … … 24 26 25 27 float radius = CauSpriteSize; 26 float2 offset = 2.0 * texCoord.zw * radius; 27 28 OUT.pSize = radius; 28 29 float4 cPosition; 29 30 30 float4 pos = tex2Dlod(PhotonHitMap, float4(position.x, 1.0 - position.y,0,0)).rgba; 31 float4 pos = tex2Dlod(PhotonHitMap, float4(position.x, 1.0 - position.y,0,0)).rgba; 32 // float4 pos = float4(0,0,-0.5,1); 31 33 if(pos.a == 0)//no photon hit 32 34 { … … 40 42 cPosition = mul(worldView, wPosition); 41 43 OUT.center = cPosition.xy; 42 cPosition.xy += offset;43 44 OUT.position = cPosition; 44 OUT.hPosition = mul(Proj, cPosition); 45 46 /* 47 //rotate to camera 48 cPosition = mul(worldView, wPosition); 49 50 float3 C = cPosition.xyz; 51 float3 right = cross(C, float3(0,1,0)); 52 float3 up = cross(right, C); 53 54 float3 cOffset = offset.x * right + offset.y * up; 55 cPosition.xy += float2(-0.5/resolution, -0.5/resolution); 56 OUT.center = cPosition.xy; 57 cPosition.xyz += cOffset; 58 OUT.position = cPosition; 59 OUT.hPosition = mul(Proj, cPosition); 60 */ 45 OUT.hPosition = mul(Proj, cPosition); 61 46 } 62 47 63 OUT.r.x = abs(offset.x);48 OUT.r.x = radius; 64 49 OUT.r.y = radius; 65 50 OUT.texCoord = texCoord; 66 OUT.color = 1; 51 OUT.color = 1; 52 OUT.color = float4(pos); 53 OUT.dist = length(pos.xyz); 67 54 68 55 return OUT; … … 71 58 72 59 float4 CauPS(VS_OUT IN, 60 uniform float3 color, 73 61 uniform sampler2D intensityTex : register(s1) 74 62 ):COLOR 75 63 { 76 64 77 float2 texcoord = (IN.center - IN.position.xy) / IN.r.x; 78 texcoord = (texcoord + 1.0) * 0.5; 79 float intens = tex2D(intensityTex, texcoord).r; 80 IN.color = intens * CauSpriteIntens; 81 82 return IN.color; 83 65 // float2 texcoord = (IN.center - IN.position.xy) / IN.r.x; 66 // texcoord = (texcoord + 1.0) * 0.5; 67 IN.color.rgb = color; 68 float intens = tex2D(intensityTex, IN.texCoord).r; 69 IN.color.a = intens * CauSpriteIntens; 70 return IN.color; 84 71 } 85 72 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Caustic.hlsl
r1085 r1094 40 40 float dist = readDistanceCubeMap(distanceCube, dir); 41 41 42 float EPSILON = 0.1;42 float EPSILON = 1.0; 43 43 44 //if(mydist > dist + EPSILON) caustic = 0;45 caustic *= max(attenuation - mydist,0) / attenuation;46 44 if(mydist > dist + EPSILON) caustic = 0; 45 //caustic.rgb *= max(attenuation - mydist, 0.0) / attenuation; 46 47 47 Color = caustic; 48 48 Color += attenuation; 49 Color.a = 1; 49 50 return Color; 50 51 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Localized_EnvMap.hlsl
r1060 r1094 24 24 { 25 25 float4 color = texCUBE( cm, float3(coord.xy, - coord.z) ); 26 color.a = 1; 26 27 return color; 27 28 }
Note: See TracChangeset
for help on using the changeset viewer.