- Timestamp:
- 09/30/06 19:00:42 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/IBRBillboardCloudTrees/OGRE/IBRTreesOGRE/media
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/IBRBillboardCloudTrees/OGRE/IBRTreesOGRE/media/general/f_lighting_indirect_texture_mapping.cg
r1493 r1546 5 5 sampler2D sourceTexture : TEXUNIT1; 6 6 sampler2D visibilityTexture : TEXUNIT2; 7 sampler2D noisyTexture : TEXUNIT3; 7 8 8 9 … … 74 75 float e = lerp(visibility.x, visibility.y, unifcoord.x); 75 76 float f = lerp(visibility.w, visibility.z, unifcoord.x); 76 float g = clamp(lerp(e, f, unifcoord.y), 0.3, 1.0);77 float g = 1.0 - clamp(lerp(e, f, unifcoord.y), 0.0, 1.0); 77 78 ambientColor += float3(g, g, g); 78 79 } … … 84 85 85 86 // Angle between normal and light vector 86 float l_CosNL = saturate(dot(l_Normal, l_LightVector)) + saturate(-dot(l_Normal, l_LightVector));87 float l_CosNL = clamp(dot(l_Normal, l_LightVector), 0.0, 1.0); 87 88 88 89 // No light can reach back surfaces... 89 //if (l_CosNL == 0) 90 // discard; 90 if (l_CosNL == 0) 91 { 92 l_CosNL = clamp(-dot(l_Normal, l_LightVector), 0.0, 1.0); 93 } 91 94 92 l_Out.color.rgb += (p_Diffuse.rgb * diffuseColor.rgb) * p_LightDiffuse.rgb * l_CosNL ;95 l_Out.color.rgb += (p_Diffuse.rgb * diffuseColor.rgb) * p_LightDiffuse.rgb * l_CosNL + float3(tex2D(noisyTexture,float2(p_In.wposition.x,p_In.wposition.z)/ 10000.0).x * 0.15, tex2D(noisyTexture,float2(p_In.wposition.z,p_In.wposition.x)/10000.0).x * 0.25,0.0); 93 96 94 97 // Specular component … … 96 99 97 100 // Apply cosine power distribution around mirror direction 98 float l_CosNH = saturate(dot(l_Normal, l_HalfVector)) + saturate(-dot(l_Normal, l_HalfVector));101 float l_CosNH = clamp(dot(l_Normal, l_HalfVector), 0.0, 1.0) + clamp(-dot(l_Normal, l_HalfVector), 0.0, 1.0); 99 102 100 103 float l_SpecularPower = pow(l_CosNH, p_Specular.a); … … 103 106 104 107 // Add specular component 105 l_Out.color.rgb += l_Specular.rgb;108 //l_Out.color.rgb += l_Specular.rgb; 106 109 107 110 // Modulate by light incoming power -
GTP/trunk/App/Demos/Illum/IBRBillboardCloudTrees/OGRE/IBRTreesOGRE/media/general/v_lighting_indirect_texture_mapping.cg
r1493 r1546 40 40 41 41 // Transform normal from model-space to eye-space. 42 l_Out.normal = normalize(mul(transpose(p_InverseModelView), p_In.normal).xyz); 42 l_Out.normal = mul(p_Model, p_In.normal); 43 l_Out.normal = normalize(mul(transpose(p_InverseModelView), float4(l_Out.normal,1.0)).xyz); 43 44 44 45 // Light vector. -
GTP/trunk/App/Demos/Illum/IBRBillboardCloudTrees/OGRE/IBRTreesOGRE/media/materials/scripts/grass.material
r1493 r1546 17 17 material Examples/GrassBlades 18 18 { 19 lod_distances 800 20 21 technique 19 technique 22 20 { 23 lod_index 024 21 pass 25 22 { 26 alpha_rejection greater 150 27 scene_blend alpha_blend28 23 transparency_casts_shadows on 24 alpha_rejection greater 80 25 cull_hardware none 29 26 cull_software none 30 27 … … 32 29 { 33 30 texture little-grass.tga 34 //filtering trilinear 35 filtering none 36 } 37 } 38 } 39 40 41 technique 42 { 43 lod_index 1 44 pass 45 { 46 alpha_rejection greater 150 47 scene_blend alpha_blend 48 cull_hardware none 49 cull_software none 50 51 texture_unit 52 { 53 texture little-grass.tga 54 filtering none 31 filtering trilinear 55 32 } 56 33 }
Note: See TracChangeset
for help on using the changeset viewer.