// //This file is part of Caelum. //See http://www.ogre3d.org/wiki/index.php/Caelum // //Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details. // //Caelum is free software: you can redistribute it and/or modify //it under the terms of the GNU Lesser General Public License as published //by the Free Software Foundation, either version 3 of the License, or //(at your option) any later version. // //Caelum is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU Lesser General Public License for more details. // //You should have received a copy of the GNU Lesser General Public License //along with Caelum. If not, see . // vertex_program CaelumSample/PSSM/ShadowCasterVP cg { source CaelumSample.cg profiles vs_1_1 arbvp1 entry_point PssmShadowCasterVP default_params { param_named_auto wvpMat worldviewproj_matrix } } fragment_program CaelumSample/PSSM/ShadowCasterFP cg { source CaelumSample.cg profiles ps_2_0 arbfp1 entry_point PssmShadowCasterFP default_params { } } // All this will do is write depth and depth˛ to red and green material CaelumSample/PSSM/ShadowCaster { technique { pass { // See: http://www.ogre3d.org/phpBB2/viewtopic.php?t=44817 fog_override true vertex_program_ref CaelumSample/PSSM/ShadowCasterVP { } fragment_program_ref CaelumSample/PSSM/ShadowCasterFP { } } } } vertex_program CaelumSample/BasicVP cg { source CaelumSample.cg entry_point MainVP profiles vs_2_0 arbvp1 compile_arguments -posinv -DAMBIENT=1 -DTWO_LIGHTS=1 default_params { param_named_auto worldviewproj_matrix worldviewproj_matrix param_named_auto inverse_transpose_worldview_matrix inverse_transpose_worldview_matrix } } fragment_program CaelumSample/BasicFP cg { source CaelumSample.cg entry_point MainFP profiles ps_2_x arbfp1 compile_arguments -DAMBIENT=1 -DTWO_LIGHTS=1 default_params { param_named_auto derived_scene_colour derived_scene_colour param_named_auto light_position_view_space_0 light_position_view_space 0 param_named_auto light_position_view_space_1 light_position_view_space 1 param_named_auto derived_light_diffuse_colour_0 derived_light_diffuse_colour 0 param_named_auto derived_light_diffuse_colour_1 derived_light_diffuse_colour 1 } } fragment_program CaelumSample/BasicFP/Terrain cg { source CaelumSample.cg entry_point MainFP profiles ps_2_x arbfp1 compile_arguments -DTERRAIN=1 -DAMBIENT=1 -DTWO_LIGHTS=1 default_params { param_named_auto derived_scene_colour derived_scene_colour param_named_auto light_position_view_space_0 light_position_view_space 0 param_named_auto light_position_view_space_1 light_position_view_space 1 param_named_auto derived_light_diffuse_colour_0 derived_light_diffuse_colour 0 param_named_auto derived_light_diffuse_colour_1 derived_light_diffuse_colour 1 } } vertex_program CaelumSample/PSSM/AmbientVP cg { source CaelumSample.cg profiles vs_1_1 arbvp1 entry_point MainVP compile_arguments -DPSSM=0 -DAMBIENT=1 default_params { param_named_auto worldviewproj_matrix worldviewproj_matrix } } fragment_program CaelumSample/PSSM/AmbientFP cg { source CaelumSample.cg profiles ps_2_x arbfp1 entry_point MainFP compile_arguments -DPSSM=0 -DAMBIENT=1 default_params { param_named_auto derived_scene_colour derived_scene_colour } } fragment_program CaelumSample/PSSM/AmbientFP/Terrain cg { source CaelumSample.cg profiles ps_2_x arbfp1 entry_point MainFP compile_arguments -DPSSM=0 -DAMBIENT=1 -DTERRAIN=1 default_params { param_named_auto derived_scene_colour derived_scene_colour } } vertex_program CaelumSample/PSSM/OneLightVP cg { source CaelumSample.cg profiles vs_1_1 arbvp1 entry_point MainVP compile_arguments -DPSSM=1 -DONE_LIGHT=1 default_params { param_named_auto worldviewproj_matrix worldviewproj_matrix param_named_auto inverse_transpose_worldview_matrix inverse_transpose_worldview_matrix param_named_auto texWorldViewProjMatrix0 texture_worldviewproj_matrix 0 param_named_auto texWorldViewProjMatrix1 texture_worldviewproj_matrix 1 param_named_auto texWorldViewProjMatrix2 texture_worldviewproj_matrix 2 } } fragment_program CaelumSample/PSSM/OneLightFP cg { source CaelumSample.cg profiles ps_2_x arbfp1 entry_point MainFP compile_arguments -DPSSM=1 -DONE_LIGHT=1 default_params { param_named_auto invShadowMapSize0 inverse_texture_size 0 param_named_auto invShadowMapSize1 inverse_texture_size 1 param_named_auto invShadowMapSize2 inverse_texture_size 2 param_named_auto light_position_view_space light_position_view_space 0 param_named_auto derived_light_diffuse_colour derived_light_diffuse_colour 0 } } fragment_program CaelumSample/PSSM/OneLightFP/Terrain cg { source CaelumSample.cg profiles ps_2_x arbfp1 entry_point MainFP compile_arguments -DPSSM=1 -DONE_LIGHT=1 -DTERRAIN default_params { param_named_auto invShadowMapSize0 inverse_texture_size 0 param_named_auto invShadowMapSize1 inverse_texture_size 1 param_named_auto invShadowMapSize2 inverse_texture_size 2 param_named_auto light_position_view_space light_position_view_space 0 param_named_auto derived_light_diffuse_colour derived_light_diffuse_colour 0 } } material CaelumSample/Base { technique Default { scheme Default pass Main { ambient 1 1 1 diffuse 1 1 1 fog_override true none vertex_program_ref CaelumSample/BasicVP { } fragment_program_ref CaelumSample/BasicFP { } texture_unit Main { texture TudorHouse.jpg tex_coord_set 0 } } } technique PSSM { scheme PSSM pass Ambient { illumination_stage ambient ambient 1 1 1 diffuse 0 0 0 fog_override true none vertex_program_ref CaelumSample/PSSM/AmbientVP { } fragment_program_ref CaelumSample/PSSM/AmbientFP { } texture_unit Main { tex_coord_set 0 } } pass Directional { illumination_stage per_light max_lights 2 iteration once_per_light directional scene_blend add ambient 0 0 0 diffuse 1 1 1 fog_override true none vertex_program_ref CaelumSample/PSSM/OneLightVP { } fragment_program_ref CaelumSample/PSSM/OneLightFP { } texture_unit shadow_tex0 { content_type shadow tex_address_mode clamp tex_coord_set 0 } texture_unit shadow_tex1 { content_type shadow tex_address_mode clamp tex_coord_set 1 } texture_unit shadow_tex2 { content_type shadow tex_address_mode clamp tex_coord_set 2 } texture_unit Main { tex_coord_set 3 } } } } material Examples/TudorHouse: CaelumSample/Base { set_texture_alias Main TudorHouse.jpg } // Terrain material is special material CaelumSample/Terrain: CaelumSample/Base { technique Default { pass Main { fragment_program_ref CaelumSample/BasicFP/Terrain { } texture_unit Main { texture terrain_dirt-grass.jpg tex_coord_set 0 } texture_unit TerrainDetail { texture terrain_detail.jpg tex_coord_set 1 } } } technique PSSM { pass Ambient { fragment_program_ref CaelumSample/PSSM/AmbientFP/Terrain { } texture_unit Main { texture terrain_dirt-grass.jpg tex_coord_set 0 } texture_unit TerrainDetail { texture terrain_detail.jpg tex_coord_set 1 } } pass Directional { fragment_program_ref CaelumSample/PSSM/OneLightFP/Terrain { } texture_unit shadow_tex0 { content_type shadow tex_address_mode clamp tex_coord_set 0 } texture_unit shadow_tex1 { content_type shadow tex_address_mode clamp tex_coord_set 1 } texture_unit shadow_tex2 { content_type shadow tex_address_mode clamp tex_coord_set 2 } texture_unit Main { texture terrain_dirt-grass.jpg tex_coord_set 3 } texture_unit TerrainDetail { texture terrain_detail.jpg tex_coord_set 4 } } } }