Changeset 2337
- Timestamp:
- 04/24/07 14:10:34 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media
- Files:
-
- 7 added
- 2 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/PMDemo/PRMDemo.material
r2284 r2337 1 vertex_program GTP/PathMap_VS hlsl2 {3 source PathMap.hlsl4 entry_point vsWalk5 target vs_2_06 }7 8 fragment_program GTP/PathMap_PS hlsl9 {10 source PathMap.hlsl11 entry_point psWalk12 target ps_3_013 flow_control prefer14 }15 16 1 material PRMDemo/Base 17 2 { … … 131 116 } 132 117 } 133 134 135 vertex_program GTP/PathMap_ComputeWeights_VS hlsl136 {137 source PathMapWeightCompute.hlsl138 entry_point vsComputeWeights139 target vs_2_0140 }141 142 fragment_program GTP/PathMap_ComputeWeights_PS hlsl143 {144 source PathMapWeightCompute.hlsl145 entry_point psComputeWeights146 target ps_3_0147 }148 149 material GTP/PathMap_ComputeWeights150 {151 technique152 {153 pass154 {155 depth_check off156 cull_harware none157 vertex_program_ref GTP/PathMap_ComputeWeights_VS158 {159 160 }161 fragment_program_ref GTP/PathMap_ComputeWeights_PS162 {163 }164 texture_unit //entrypoint texture165 {166 filtering off167 }168 texture_unit shadow_map //stores distances169 {170 171 }172 }173 174 }175 }176 177 fragment_program GTP/PathMap_SumWeights_PS hlsl178 {179 source PathMapWeightCompute.hlsl180 entry_point psSumWeights181 target ps_3_0182 flow_control prefer183 }184 185 material GTP/PathMap_SumWeights186 {187 technique188 {189 pass190 {191 192 depth_check off193 cull_harware none194 lighting off195 vertex_program_ref GTP/PathMap_ComputeWeights_VS196 {197 198 }199 fragment_program_ref GTP/PathMap_SumWeights_PS200 {201 }202 texture_unit //entrypoint texture203 {204 filtering none205 }206 texture_unit //entrypoint weight texture207 {208 filtering none209 }210 texture_unit //cluster length211 {212 filtering none213 }214 }215 216 }217 }218 219 vertex_program GTP/EPDisplayVS hlsl220 {221 source PathMapWeightCompute.hlsl222 entry_point EntryPointDisplayVS223 target vs_2_0224 }225 fragment_program GTP/EPDisplayPS hlsl226 {227 source PathMapWeightCompute.hlsl228 entry_point EntryPointDisplayPS229 target ps_2_0230 }231 232 material GTP/PM/EPBillboards233 {234 technique235 {236 pass237 {238 polygon_mode points239 point_size 10240 vertex_program_ref GTP/EPDisplayVS241 {242 param_named_auto worldViewProj worldviewproj_matrix243 }244 fragment_program_ref GTP/EPDisplayPS245 {246 }247 texture_unit248 {249 filtering none250 }251 }252 }253 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/diffuse/GTPDiffuse.hlsl
r2054 r2337 6 6 float4 readCubeMap(samplerCUBE cm, float3 coord) 7 7 { 8 float4 color = texCUBElod( cm, float4(coord.xy, -coord.z, 1) );8 float4 color = texCUBElod( cm, float4(coord.xy, -coord.z, 0) ); 9 9 color.a = 1; 10 10 return color; … … 13 13 float readDistanceCubeMap(samplerCUBE dcm, float3 coord) 14 14 { 15 float dist = texCUBElod(dcm, float4(coord.xy, - coord.z, 1)).r;15 float dist = texCUBElod(dcm, float4(coord.xy, - coord.z, 0)).r; 16 16 if(dist == 0) dist = 1000000; ///sky 17 17 return dist; … … 26 26 float4 MPos : TEXCOORD0; 27 27 }; 28 28 /* 29 29 float4 ReduceCubeMap_PS(MPos_OUT IN, 30 30 uniform int nFace, … … 54 54 return color / (RATE * RATE); 55 55 } 56 56 */ 57 58 float4 ReduceCubeMap_PS(MPos_OUT IN, 59 uniform int nFace, 60 uniform samplerCUBE EnvironmentMapSampler : register(s0) ) : COLOR 61 { 62 float4 color = 0; 63 float3 dir; 64 65 for (int i = 0; i < RATE/2; i+=1) 66 for (int j = 0; j < RATE/2; j+=1) 67 { 68 float2 pos; 69 pos.x = IN.MPos.x + (4*i + 2)/(float)CUBEMAP_SIZE; 70 pos.y = IN.MPos.y - (4*j + 2)/(float)CUBEMAP_SIZE; // y=-u 71 72 // "scrambling" 73 if (nFace == 0) dir = float3(1, pos.y, -pos.x); 74 if (nFace == 1) dir = float3(-1, pos.y, pos.x); 75 if (nFace == 2) dir = float3(pos.x, 1, -pos.y); 76 if (nFace == 3) dir = float3(pos.x, -1, pos.y); 77 if (nFace == 4) dir = float3(pos.x, pos.y, 1); 78 if (nFace == 5) dir = float3(-pos.x, pos.y,-1); 79 80 color += texCUBE( EnvironmentMapSampler, dir); 81 } 82 83 return color / (RATE * RATE / 4.0); 84 } 57 85 58 86 //////////////// -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/diffuse/GTPDiffuse.program
r2054 r2337 4 4 entry_point Diffuse_Poly2Point_PS 5 5 target ps_3_0 6 flow_control prefer6 //flow_control prefer 7 7 } 8 8 … … 28 28 entry_point ReduceCubeMap_PS 29 29 target ps_3_0 30 flow_control prefer30 //flow_control avoid 31 31 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program
r2294 r2337 193 193 source GTPShadowMap_PS.hlsl 194 194 entry_point shadowMapDist_Variance 195 target ps_2_0 196 } 197 198 fragment_program GTP/Basic/SM/Dist_POINT_VSM_PS hlsl 199 { 200 source GTPShadowMap_PS.hlsl 201 entry_point shadowMapDist_POINT_Variance 195 202 target ps_2_0 196 203 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPShadowMap_PS.hlsl
r2311 r2337 106 106 float4 pos = (IN.LightVPos / IN.LightVPos.w); 107 107 float d = length(pos.xy); 108 light = saturate((1.0 - d)/0.05);109 108 if(d <= 1.0) 110 109 { … … 126 125 } 127 126 } 128 else129 light = 0;130 127 131 128 return shadowColor + (1 - shadowColor) * light; 132 129 } 130 131 132 float4 shadowMapDist_POINT_Variance(LightCPos_OUT IN, 133 uniform float lightFarPlane, 134 uniform samplerCUBE shadowMap) : COLOR 135 { 136 float4 light = float4(1,1,1,1); 137 138 float dist = length(IN.LightCPos.xyz) / lightFarPlane; 139 float4 storedDist = texCUBE(shadowMap, float3(IN.LightCPos.xy, -IN.LightCPos.z)); 140 dist -= DIST_BIAS_VSM; 141 float lit_factor = light * (dist <= storedDist.r); 142 143 float M1 = storedDist.r; 144 float M2 = storedDist.g; 145 float v2 = min(max(M2 - M1 * M1, 0.0) + DIST_EPSILON, 1.0); 146 float m_d = M1 - dist; 147 float pmax = v2 / (v2 + m_d * m_d); 148 149 // Adjust the light color based on the shadow attenuation 150 light = max(lit_factor, pmax); 151 152 153 return (shadowColor + (1 - shadowColor) * light); 154 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.material
r2301 r2337 117 117 use_triangles true 118 118 blur_caustic_cubemap true 119 } 120 121 } 122 vertex_program_ref GTP/Basic/Shaded_VS 123 { 124 param_named_auto WorldViewProj worldviewproj_matrix 125 param_named_auto World world_matrix 126 param_named_auto WorldInv inverse_world_matrix 127 } 128 fragment_program_ref GTP/EnvMap/Localized_Refraction_PS 129 { 130 param_named_auto cameraPos camera_position 131 param_named lastCenter float3 0 0 0 132 param_named sFresnel float 0.1 133 <<<<<<< .mine 134 param_named sRefraction float 0.85 135 ======= 136 param_named sRefraction float 0.8 137 >>>>>>> .r2314 138 } 139 //Cube map for reflections and refractions 140 texture_unit 141 { 142 143 } 144 //Cube map of distances 145 texture_unit 146 { 147 filtering none 148 } 149 } 150 } 151 } 152 153 material GTP/Caustic/Glass_PointSprite 154 { 155 technique 156 { 157 pass 158 { 159 IllumTechniques 160 { 161 RenderTechnique ColorCubeMap 162 { 163 update_interval 0 164 update_all_face true 165 } 166 RenderTechnique DistanceCubeMap 167 { 168 update_interval 0 169 update_all_face true 170 } 171 RenderTechnique CausticCaster 172 { 173 attenuation 1000 174 update_interval 1 175 update_all_face true 176 photonmap_resolution 64 177 caustic_cubemap_resolution 256 178 photon_map_material GTP/Caustic/PhotonMap_HitEnv 179 caustic_map_material GTP/Caustic/CauCube_PointSprite 180 blur_caustic_cubemap false 119 181 } 120 182 … … 146 208 } 147 209 } 148 149 material GTP/Caustic/Glass_PointSprite150 {151 technique152 {153 pass154 {155 IllumTechniques156 {157 RenderTechnique ColorCubeMap158 {159 update_interval 0160 update_all_face true161 }162 RenderTechnique DistanceCubeMap163 {164 update_interval 0165 update_all_face true166 }167 RenderTechnique CausticCaster168 {169 attenuation 1000170 update_interval 1171 update_all_face true172 photonmap_resolution 64173 caustic_cubemap_resolution 256174 photon_map_material GTP/Caustic/PhotonMap_HitEnv175 caustic_map_material GTP/Caustic/CauCube_PointSprite176 blur_caustic_cubemap false177 }178 179 }180 vertex_program_ref GTP/Basic/Shaded_VS181 {182 param_named_auto WorldViewProj worldviewproj_matrix183 param_named_auto World world_matrix184 param_named_auto WorldInv inverse_world_matrix185 }186 fragment_program_ref GTP/EnvMap/Localized_Refraction_PS187 {188 param_named_auto cameraPos camera_position189 param_named lastCenter float3 0 0 0190 param_named sFresnel float 0.1191 param_named sRefraction float 0.8192 }193 //Cube map for reflections and refractions194 texture_unit195 {196 197 }198 //Cube map of distances199 texture_unit200 {201 filtering none202 }203 }204 }205 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Phong.hlsl
r2294 r2337 115 115 OUT.hPos = OUT.hPosition = mul(worldViewProj, position); 116 116 OUT.wPos = mul(worldView, position).xyz; 117 OUT.mNormal = mul(normal, worldViewI).xyz;117 OUT.mNormal = normal;//mul(normal, worldViewI).xyz; 118 118 //OUT.mNormal = normal; 119 119 OUT.texCoord = texCoord; … … 165 165 166 166 float3 N = IN.mNormal; 167 //float3 N = mul(worldViewIT, IN.mNormal);168 167 N = normalize( N ); 169 168 float3 pos = IN.wPos;
Note: See TracChangeset
for help on using the changeset viewer.