//=================================================================== // Pure ambient light shader // @author jboldiga //=================================================================== #ifdef _MAX_ // Max includes are in ../3dsMax/MaterialLibraries/ #include "KFF_Macros" #include "lighting.fx" #else #include "c:/_project/Fatburger/Assets/Shaders/lighting.fx" #include "c:/_project/Fatburger/Assets/Shaders/KFF_Macros" #endif float3 AmbientColor : Ambient < string UIName = "Ambient Light"; string UIWidget = "Color"; > = {1.0f,1.0f,1.0f}; // matrices float4x4 wvp : WorldViewProjection < string UIType = "None"; >; // input from application struct a2v { float4 position : POSITION; }; // output to fragment program struct v2f { float4 position : POSITION; }; //Vertex Shader v2f av(a2v In) { v2f Out = (v2f)0; Out.position = matmul(In.position, wvp); //transform vert position to homogeneous clip space return Out; } //Pixel Shader float4 af(v2f In) : COLOR { float3 Material = AmbientColor; return float4(Material, 1.0f); } technique Complete { pass ambient { VertexShader = compile vs_3_0 av(); ZEnable = true; ZWriteEnable = true; CullMode = cw; ShadeMode = Gouraud; AlphaBlendEnable = false; AlphaTestEnable = false; PixelShader = compile ps_3_0 af(); } }