//shading: constant color //lighting model: none //lighting type: none // -------------------------------------------------------------------------------------------------- // PARAMETERS: // -------------------------------------------------------------------------------------------------- //transforms float4x4 tW: WORLD; //the models world matrix float4x4 tV: VIEW; //view matrix as set via Renderer (EX9) float4x4 tP: PROJECTION; //projection matrix as set via Renderer (EX9) float4x4 tWVP: WORLDVIEWPROJECTION; float VVVVloat[48] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; float2 VVVVloat2[24] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; float3 VVVVloat3[16] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; float4 VVVVloat4[12] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; half Halvvvv[48] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; half2 Halvvvv2[24] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; half3 Halvvvv3[16] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; half4 Halvvvv4[12] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; //double Dubbl[24] = double Dubbl[48] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; double2 Dubbl2[24] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; double3 Dubbl3[16] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; double4 Dubbl4[12] = { -0.4359, 0.1607, 0.1664, 0.5123, 0.3133, 0.3036,-0.1008, 0.4993, -0.3530, 0.1366, 0.3797, 0.2241, 0.1543,-0.3514, 0.1237, 0.4231, 0.0219,-0.2624,-0.4057, 0.0491, 0.0495, 0.4009,-0.3441, 0.0879, 0.0414, 0.1031, 0.5815,-0.0840, 0.4988,-0.2451, 0.0952, 0.2564, -0.3005,-0.3880,-0.1673, 0.0923, 0.0785,-0.5410,-0.2227,-0.0161, 0.3025,-0.1511, 0.2928, 0.1136, 0.0747,-0.3719,-0.0444, 0.2673, }; int Integer[24] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; int2 Integer2[12] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; int3 Integer3[8] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; int4 Integer4[6] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; bool Boolean[24] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; bool2 Boolean2[12] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; bool3 Boolean3[8] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; bool4 Boolean4[6] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; //material properties float4 cAmb : COLOR = {1, 1, 1, 1}; float Alpha = 1; //texture texture Tex ; sampler Samp = sampler_state //sampler for doing the texture-lookup { Texture = (Tex); //apply a texture to the sampler MipFilter = LINEAR; //sampler states MinFilter = LINEAR; MagFilter = LINEAR; }; float4x4 tTex: TEXTUREMATRIX ; //the data structure: "vertexshader to pixelshader" //used as output data with the VS function //and as input data with the PS function struct vs2ps { float4 Pos : POSITION; float4 TexCd : TEXCOORD0; }; // -------------------------------------------------------------------------------------------------- // VERTEXSHADERS // -------------------------------------------------------------------------------------------------- vs2ps VS( float4 Pos : POSITION, float4 TexCd : TEXCOORD0) { //inititalize all fields of output struct with 0 vs2ps Out = (vs2ps)0; //transform position Out.Pos = mul(Pos, tWVP); //transform texturecoordinates Out.TexCd = mul(TexCd, tTex); return Out; } // -------------------------------------------------------------------------------------------------- // PIXELSHADERS: // -------------------------------------------------------------------------------------------------- float4 PS(vs2ps In): COLOR { //In.TexCd = In.TexCd / In.TexCd.w; // for perpective texture projections (e.g. shadow maps) ps_2_0 float4 col = tex2D(Samp, In.TexCd) * cAmb; col.a *= Alpha; return col; } // -------------------------------------------------------------------------------------------------- // TECHNIQUES: // -------------------------------------------------------------------------------------------------- technique TConstant { pass P0 { //Wrap0 = U; // useful when mesh is round like a sphere VertexShader = compile vs_1_1 VS(); PixelShader = compile ps_1_0 PS(); } } technique TConstantFF { pass P0 { //transformations WorldTransform[0] = (tW); ViewTransform = (tV); ProjectionTransform = (tP); //material MaterialAmbient = {1, 1, 1, 1}; MaterialDiffuse = {1, 1, 1, 1}; //texturing Sampler[0] = (Samp); TextureTransform[0] = (tTex); TexCoordIndex[0] = 0; TextureTransformFlags[0] = COUNT4 | PROJECTED; //Wrap0 = U; // useful when mesh is round like a sphere //lighting LightEnable[0] = TRUE; Lighting = TRUE; SpecularEnable = FALSE; LightType[0] = DIRECTIONAL; LightAmbient[0] = (cAmb); LightDiffuse[0] = {0, 0, 0, 0}; LightDirection[0] = {0, 0, 1, 1}; //shading ShadeMode = FLAT; VertexShader = NULL; PixelShader = NULL; } }