//------------------------ // Basic //------------------------ //--------------------------------------------------- // This file includes a number of basic GPU programs // for use in many materials. //--------------------------------------------------- // A really basic ambient pass program, support for one texture coordinate set vertex_program AmbientOneTextureCg cg { source Example_Basic.cg entry_point ambientOneTexture_vp profiles vs_1_1 arbvp1 default_params { param_named_auto worldViewProj worldviewproj_matrix param_named_auto ambient ambient_light_colour } } vertex_program AmbientOneTextureCgSm4 cg { source Example_Basic_sm4.cg entry_point ambientOneTexture_vp profiles vs_4_0 default_params { param_named_auto worldViewProj worldviewproj_matrix param_named_auto ambient ambient_light_colour } } // A really basic ambient pass program, support for one texture coordinate set vertex_program AmbientOneTextureHLSL hlsl { source Example_Basic.hlsl entry_point ambientOneTexture_vp target vs_4_0 default_params { param_named_auto worldViewProj worldviewproj_matrix param_named_auto ambient ambient_light_colour } } // A really basic ambient pass program, support for one texture coordinate set vertex_program AmbientOneTextureGLSL glsl { source AmbientOneTexture.glsl } // A really basic ambient pass program, support for one texture coordinate set vertex_program AmbientOneTextureGLSL glsl { source AmbientOneTexture.glsl default_params { param_named_auto ambient ambient_light_colour param_named_auto worldViewProj worldviewproj_matrix } } // A really basic ambient pass program, support for one texture coordinate set vertex_program AmbientOneTextureGLSLES glsles { source AmbientOneTexture.glsles default_params { param_named_auto worldViewProj worldviewproj_matrix param_named_auto ambient ambient_light_colour } } vertex_program AmbientOneTextureWithUVGLSLES glsles { source AmbientOneTextureWithUV.glsles default_params { param_named_auto worldViewProj worldviewproj_matrix param_named_auto ambient ambient_light_colour } } vertex_program AmbientOneTextureWithUVGLSL glsl { source AmbientOneTextureWithUV.glsl default_params { param_named_auto worldViewProj worldviewproj_matrix param_named_auto ambient ambient_light_colour } } vertex_program AmbientOneTextureWithUV unified { delegate AmbientOneTextureWithUVGLSL delegate AmbientOneTextureWithUVGLSLES delegate AmbientOneTextureHLSL delegate AmbientOneTextureCg delegate AmbientOneTextureCgSm4 } vertex_program AmbientOneTextureUnified unified { delegate AmbientOneTextureGLSL delegate AmbientOneTextureGLSLES delegate AmbientOneTextureHLSL delegate AmbientOneTextureCg delegate AmbientOneTextureCgSm4 } fragment_program DiffuseOneTextureCg cg { source Example_Basic.cg entry_point diffuseOneTexture_fp profiles ps_2_0 arbfp1 } fragment_program DiffuseOneTextureGLSLES glsles { source DiffuseOneTexture.glsles default_params { param_named texMap int 0 } } fragment_program DiffuseOneTextureGLSL glsl { source DiffuseOneTexture.glsl default_params { param_named texMap int 0 } } fragment_program DiffuseOneTexture unified { delegate DiffuseOneTextureGLSL delegate DiffuseOneTextureGLSLES delegate DiffuseOneTextureCg } // A really basic ambient pass program, support for one texture coordinate set fragment_program PassthroughFP unified { delegate PassthroughFpGLSL delegate PassthroughFpGLSLES delegate PassthroughFpCgSm4 delegate PassthroughFpCg } // A really basic ambient pass program, support for one texture coordinate set fragment_program PassthroughFpCgSm4 cg { entry_point main source PassthroughFP_sm4.cg profiles ps_4_0 } fragment_program PassthroughFpCg cg { entry_point mainCg source PassthroughFP.cg profiles ps_2_0 arbfp1 } // A really basic ambient pass program, support for one texture coordinate set fragment_program PassthroughFpCgSm4ForAmbientOneTexture cg { entry_point mainForAmbientOneTexture source PassthroughFP_sm4.cg profiles ps_4_0 } // A really basic ambient pass program, support for one texture coordinate set fragment_program PassthroughFpGLSLES glsles { source PassthroughFP.glsles } fragment_program PassthroughFpGLSL glsl { source PassthroughFP.glsl } //------------------------ // Bump mapping section //------------------------ // Bump map vertex program, support for this is required vertex_program Lava/BumpMapVPCg cg { source Example_BumpMapping.cg entry_point main_vp profiles vs_4_0 vs_1_1 arbvp1 } vertex_program Lava/BumpMapVPGLSLES glsles { source Example_BumpMappingVp.glsles profiles glsles } vertex_program Lava/BumpMapVPGLSL glsl { source Example_BumpMappingVp.glsl } vertex_program Lava/BumpMapVP unified { delegate Lava/BumpMapVPGLSL delegate Lava/BumpMapVPGLSLES delegate Lava/BumpMapVPCg } // Bump map vertex program, with tangent parity support for this is required vertex_program Lava/BumpMapVPTangentParityCg cg { source Example_BumpMapping.cg entry_point main_vp profiles vs_1_1 arbvp1 compile_arguments -DTANGENTS_HAVE_PARITY=1 } // Bump map vertex program, with tangent parity support for this is required vertex_program Lava/BumpMapVPTangentParityGLSLES glsles { source BumpMapVPTangentParity.glsles } vertex_program Lava/BumpMapVPTangentParityGLSL glsl { source BumpMapVPTangentParity.glsl default_params { param_named_auto lightDiffuse light_diffuse_colour 0 } } vertex_program Lava/BumpMapVPTangentParity unified { delegate Lava/BumpMapVPTangentParityGLSL delegate Lava/BumpMapVPTangentParityGLSLES delegate Lava/BumpMapVPTangentParityCg } // Bump map fragment program, support for this is optional fragment_program Lava/BumpMapFPCg cg { source Example_BumpMapping.cg entry_point main_fp profiles ps_4_0 ps_2_0 arbfp1 fp20 } fragment_program Lava/BumpMapFPGLSLES glsles { source Example_BumpMappingFp.glsles profiles glsles default_params { // assign samplers as required by GLSL param_named normalMap int 0 } } fragment_program Lava/BumpMapFPGLSL glsl { source Example_BumpMappingFp.glsl default_params { // assign samplers as required by GLSL param_named normalMap int 0 } } fragment_program Lava/BumpMapFP unified { delegate Lava/BumpMapFPGLSL delegate Lava/BumpMapFPGLSLES delegate Lava/BumpMapFPCg } // Bump map vertex program shadow receiver vertex_program Lava/BumpMapVPShadowRcvCg cg { source Example_BumpMapping.cg entry_point main_shadowreceiver_vp profiles vs_1_1 arbvp1 } // Bump map vertex program shadow receiver vertex_program Lava/BumpMapVPShadowRcvGLSLES glsles { source Example_BumpMappingShadowRcvVp.glsles profiles glsles } vertex_program Lava/BumpMapVPShadowRcvGLSL glsl { source Example_BumpMappingShadowRcvVp.glsl } vertex_program Lava/BumpMapVPShadowRcv unified { delegate Lava/BumpMapVPShadowRcvGLSL delegate Lava/BumpMapVPShadowRcvGLSLES delegate Lava/BumpMapVPShadowRcvCg } // Bump map fragment program shadow receiver, support for this is optional fragment_program Lava/BumpMapFPShadowRcvCg cg { source Example_BumpMapping.cg entry_point main_shadowreceiver_fp profiles ps_2_0 arbfp1 fp20 } // Bump map fragment program shadow receiver, support for this is optional fragment_program Lava/BumpMapFPShadowRcvGLSLES glsles { source Example_BumpMappingShadowRcvFp.glsles profiles glsles default_params { // assign samplers as required by GLSL param_named shadowMap int 0 param_named normalMap int 1 } } fragment_program Lava/BumpMapFPShadowRcvGLSL glsl { source Example_BumpMappingShadowRcvFp.glsl default_params { // assign samplers as required by GLSL param_named shadowMap int 0 param_named normalMap int 1 } } fragment_program Lava/BumpMapFPShadowRcv unified { delegate Lava/BumpMapFPShadowRcvGLSL delegate Lava/BumpMapFPShadowRcvGLSLES delegate Lava/BumpMapFPShadowRcvCg } // Bump map with specular vertex program, support for this is required vertex_program Lava/BumpMapVPSpecularCg cg { source Example_BumpMapping.cg entry_point specular_vp profiles vs_4_0 vs_1_1 arbvp1 } // Bump map with specular vertex program, support for this is required vertex_program Lava/BumpMapVPSpecularGLSLES glsles { source Example_BumpMappingSpecularVp.glsles profiles glsles } vertex_program Lava/BumpMapVPSpecularGLSL glsl { source Example_BumpMappingSpecularVp.glsl } vertex_program Lava/BumpMapVPSpecular unified { delegate Lava/BumpMapVPSpecularGLSL delegate Lava/BumpMapVPSpecularGLSLES delegate Lava/BumpMapVPSpecularCg } // Bump map fragment program, support for this is optional fragment_program Lava/BumpMapFPSpecularCg cg { source Example_BumpMapping.cg entry_point specular_fp profiles ps_4_0 ps_2_0 arbfp1 fp20 } // Bump map fragment program, support for this is optional fragment_program Lava/BumpMapFPSpecularGLSLES glsles { source Example_BumpMappingSpecularFp.glsles profiles glsles default_params { // assign samplers as required by GLSL param_named normalMap int 0 } } fragment_program Lava/BumpMapFPSpecularGLSL glsl { source Example_BumpMappingSpecularFp.glsl default_params { // assign samplers as required by GLSL param_named normalMap int 0 } } fragment_program Lava/BumpMapFPSpecular unified { delegate Lava/BumpMapFPSpecularGLSL delegate Lava/BumpMapFPSpecularGLSLES delegate Lava/BumpMapFPSpecularCg } //------------------------ // Material //------------------------ // Any number of lights, diffuse material Cube_Lava_Normal { // This is the preferred technique which uses both vertex and // fragment programs, supports coloured lights technique { // Base ambient pass pass ambient { // base colours, not needed for rendering, but as information // to lighting pass categorisation routine ambient 1 1 1 diffuse 0 0 0 specular 0 0 0 0 // Really basic vertex program // NB we don't use fixed function here because GL does not like // mixing fixed function and vertex programs, depth fighting can // be an issue vertex_program_ref AmbientOneTextureUnified { param_named_auto ambient ambient_light_colour } fragment_program_ref PassthroughFP { } } // Now do the lighting pass // NB we don't do decal texture here because this is repeated per light pass perlight { // base colours, not needed for rendering, but as information // to lighting pass categorisation routine ambient 0 0 0 // do this for each light iteration once_per_light scene_blend add // Vertex program reference vertex_program_ref Lava/BumpMapVP { param_named_auto lightPosition light_position_object_space 0 param_named_auto worldViewProj worldviewproj_matrix } // Fragment program fragment_program_ref Lava/BumpMapFP { param_named_auto lightDiffuse light_diffuse_colour 0 } // texture shadow receiver program shadow_receiver_vertex_program_ref Lava/BumpMapVPShadowRcv { param_named_auto lightPosition light_position_object_space 0 param_named_auto worldViewProj worldviewproj_matrix param_named_auto worldMatrix world_matrix param_named_auto texViewProj texture_viewproj_matrix } // Additive texture shadow receiver program shadow_receiver_fragment_program_ref Lava/BumpMapFPShadowRcv { param_named_auto lightDiffuse light_diffuse_colour 0 } // Base bump map texture_unit normalmap { texture Cube_Lava_NORM.jpg tex_address_mode wrap scale 1.0 1.0 colour_op replace } } // Decal pass pass decal { // base colours, not needed for rendering, but as information // to lighting pass categorisation routine lighting off // Really basic vertex program // NB we don't use fixed function here because GL does not like // mixing fixed function and vertex programs, depth fighting can // be an issue vertex_program_ref AmbientOneTextureUnified { param_named_auto worldViewProj worldviewproj_matrix param_named ambient float4 1 1 1 1 } fragment_program_ref PassthroughFP { } scene_blend dest_colour zero texture_unit { texture Cube_Lava_COLOR.jpg tex_address_mode wrap scale 1.0 1.0 colour_op modulate } } } }