Changeset 2959 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 09/19/08 23:13:47 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2954 r2959 33 33 uniform float4 position, 34 34 uniform float3 normal, 35 uniform float amb,35 uniform float emmisive, 36 36 float3 lightDir) 37 37 { … … 50 50 const float4 ambient = glstate.light[0].ambient; 51 51 52 return (ambient + diffuse) * color * (1.0f - amb) + amb * color; 52 //return (saturate(((ambient + diffuse))) * (1.0f - emmisive) + emmisive) * color; 53 return saturate((((ambient + diffuse)) * (1.0f - emmisive) + emmisive) * color); 53 54 } 54 55 … … 152 153 const float angle = saturate(dot(normal, lightDir)); 153 154 //float4 lightDiffuse = float4(1.0f, 1.0f, 0.9f, 1.0f); 154 float4 lightDiffuse = glstate.light[0].diffuse;155 const float4 lightDiffuse = glstate.light[0].diffuse; 155 156 //float4(1.0f, 1.0f, 0.9f, 1.0f); 156 157 … … 178 179 179 180 // base lighting 180 OUT.color = ( ambient + diffuse) * color * (1.0f - emmisive) + emmisive *color;181 OUT.color = (emmisive < 0.95) ? (ambient + diffuse) * color : color; 181 182 182 183 // also write out depth component -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/sky_preetham.cg
r2958 r2959 27 27 28 28 29 struct PixelOutput 29 30 struct pixel 30 31 { 31 float4 color: SV_TARGET0; 32 float4 col: COLOR0; 33 float4 pos: COLOR1; 34 float4 norm: COLOR2; 32 35 }; 33 36 37 // fragment input 38 struct fragin 39 { 40 float4 color: COLOR0; 41 float4 position: POSITION; // eye space 42 float4 texCoord: TEXCOORD0; 34 43 35 44 float4 projPos: WPOS; 45 float4 worldPos: TEXCOORD1; // world position 46 float3 normal: TEXCOORD2; 47 float4 mypos: TEXCOORD3; 48 }; 36 49 //-------------------------------------------------------------------------------------- 37 50 // Vertex Shaders … … 91 104 92 105 93 pixel frag_skydome(fragin IN, 94 uniform float maxDepth) 106 pixel frag_skydome(fragin IN) 95 107 { 96 108 pixel pix; 97 109 98 110 pix.col = IN.color; 99 pix.pos = IN.worldPos ;// * maxDepth;111 pix.pos = IN.worldPos * 1e20;// * maxDepth; 100 112 101 113 pix.norm.xyz = IN.normal; 102 114 103 115 // hack: squeeze some information about the ambient term into the target 104 pix.norm.w = 0;116 pix.norm.w = 1; 105 117 pix.pos.w = IN.mypos.w; 106 118
Note: See TracChangeset
for help on using the changeset viewer.