//**************************************************************************************// // // // BASIC STUFF // // // //**************************************************************************************// material WhiteVertex { technique { pass { lighting on ambient 0.0 0.0 0.0 1 diffuse 1 1 1 1 specular 1 1 1 1 127 } } } material PerVertex { technique { // Base ambient pass pass { vertex_program_ref Ambient { } } pass { // do this for each light iteration once_per_light scene_blend add vertex_program_ref PerVertex_Vert { } } } } //**************************************************************************************// // // // PERPIXEL LIGHTING // // A + D + S // // (NO TEXTURING ADDED) // //**************************************************************************************// material Simple_Perpixel { technique { // Base ambient pass pass { vertex_program_ref Ambient { } } pass { // do this for each light iteration once_per_light scene_blend add vertex_program_ref Simple_Perpixel_Vert { } fragment_program_ref Simple_PerPixel_Frag { } } } } material Perpixel { technique { // Base ambient pass pass { vertex_program_ref Ambient { } } pass { // do this for each light iteration once_per_light scene_blend add vertex_program_ref PerPixel_Vert { } fragment_program_ref PerPixel_Frag { } } } } //The limitation worth us ~20..100 FPS.It worth it. material Perpixel_Limited_3 { technique { pass { vertex_program_ref PerPixel_Lim3_Vert { } fragment_program_ref PerPixel_Lim3_Frag { } } } } //**************************************************************************************// // // // BUMP - NORMAL - OFFSET/PARALLAX - RELIEF // // MAPPING COMES NOW // // (WITH TEXTURING) // //**************************************************************************************// //Any lights, offset with specular //Apart from being slow, this sax, 'cuz diffuse texture's uv's cannot be offsetted //due to the iteration (or at least I can't do it easily) //(and due to I cannot transfer data beetwen Fragshaders of different passes) material Offset { technique { pass { vertex_program_ref Ambient { } } pass { // do this for each light iteration once_per_light scene_blend add // Vertex program reference vertex_program_ref Offset_Vert { param_named scale float 5 } // Fragment program fragment_program_ref Offset_Frag { } // Base bump map texture_unit { texture notex_normal.png filtering trilinear //filtering anisotropic //max_anisotropy 3 //colour_op replace } } //Decal pass pass { lighting off vertex_program_ref OneTexture { param_named scale float 5 } scene_blend modulate texture_unit { //filtering anisotropic //max_anisotropy 3 filtering trilinear texture notex_diffuse.png } } } } material Base { set $DiffuseMap "notex_diffuse.png" set $NormalMap "notex_normal.png" technique { // pass // { // vertex_program_ref Ambient // { // } // } pass { // do this for each light // iteration once_per_light // scene_blend add // Vertex program reference vertex_program_ref BaseNormal_Vert { param_named scale float 1 } // Fragment program fragment_program_ref BaseNormal_Frag { } // Base bump map texture_unit { texture $NormalMap filtering trilinear //filtering anisotropic //max_anisotropy 3 //colour_op replace } texture_unit { //filtering anisotropic //max_anisotropy 3 filtering trilinear texture $DiffuseMap } } } } material Offset_Limited3 { set $DiffuseMap "notex_diffuse.png" set $NormalMap "notex_normal.png" technique { // pass // { // vertex_program_ref Ambient // { // } // } pass { // do this for each light // iteration once_per_light // scene_blend add // Vertex program reference vertex_program_ref Offset_Lim3_Vert { param_named scale float 1 // param_named lightnum float 2 } // Fragment program fragment_program_ref Offset_Lim3_Frag { // param_named lightnum float 2 } // Base bump map texture_unit { texture $NormalMap filtering trilinear //filtering anisotropic //max_anisotropy 3 //colour_op replace } texture_unit { //filtering anisotropic //max_anisotropy 3 filtering trilinear texture $DiffuseMap } } } } material Base/NormalMap : Base {} material Base/ParallaxMap : Offset_Limited3 {}