// // Generated by Microsoft (R) D3DX9 Shader Compiler 4.09.00.1126 // // fxc /E VSShipHull /T vs_1_1 /Fc ..\DX9\VSShipHull_11.vsh ShipHull.hlsl // // // Parameters: // // float2 f2Depths; // float3 f3FogValues; // float3 f3LightColor; // float3 f3LightDir; // float4 f4AmbientColor; // float4 f4MaterialDiffuse; // float4x4 mtxWorld; // float4x4 mtxWorldViewProj; // // // Registers: // // Name Reg Size // ----------------- ----- ---- // mtxWorldViewProjT c0 4 // mtxWorldT c4 3 // f3Depths c7 1 // [0] = start fade depth, [1] = 1 / fade length, [2] = darken start, [3] = 1 / darken distance // f3FogValues c8 1 // f4FogColor c9 1 // f4LightDir c10 1 // f3LightColor c11 1 // f4AmbientColor c12 1 // f4MaterialDiffuse c13 1 // f4C14 c14 1 // [0] = 1.0, [0] = 0.0 // f4WaterColor c15 1 vs_1_1 dcl_position v0 dcl_normal v1 dcl_texcoord v2 dcl_texcoord1 v3 // The following instructions multiply the input position by the world matrix mov r0.xyz, v0 // 1 // Move the object position into r0 mov r0.w, c14.x // 1 // w = 1. dp4 r8.xyz, r0, c6 // 1 // Get the world height of this point m3x3 r4, v1, c4 // 3 // Translate the normal into world space dp3 r4.w, r4, r4 // 1 // Normalize the normal rsq r4.w, r4.w // 1 mul r4, r4, r4.w // 1 m4x4 oPos, r0, c0 // 4 (13) // This translates the final world position into screen space // Now find the fogging values (assume that the fog center is [0,0,0]). mul r6.w, r8.z, c8.x // 1 // sqrt( (WP - FC) dot (WP - FC) ) / (Far plane distance) = Fogging, [0..1] add r2, r6.w, -c8.y // 1 // ( Fogging - MinFogValue ) mul r2, r2, c8.z // 1 // ( Fogging - MinFogValue ) / ( 1 - MinFogValue ) sge r3, r6.w, c8.y // 1 // If (Fogging >= MinFogValue ) { r3 = 1 } else { r3 = 0 } mul oFog, r3.x, r2.x // 1 (18) // Put the fogging value in the fog register // Light calculations dp3 r11, -c10, r4 // 1 // (Light Vector) dot (Normal) (L.N) mul r11, r11, c11 // 1 // Modulate diffuse by its color max r11, c14.y, r11 // 1 // Clamp the minimum value to 0 add r11, r11, c12 // 1 // Add the ambient color to this value. min r7, c14.x, r11 // 1 (23) // Clamp the maximum value to 1 // Do depth colorizing add r9, r8.z, -c7.z // 1 mov r1, c7.w // 1 mad r9, r9, r1.w, c14.x // 1 add r6, -r9, c14.x // 1 mad r9, r6, c15, r9 // 1 min r9, r9, c14.x // 1 (29) // Clamp the maximum value to 1 mul oD0.rgb, r9, r7 // 1 (30) // Copy over the texture coordinates mov oT0.xy, v2 // 1 // mov oT1.xy, v2 // 1 // mov oT2.xy, v2 // 1 // mov oT3.xy, v3 // 1 (34) // // Now find the alpha of this point add r9, r8.z, -c7.x // 1 // r9 = ( depth.start - worldz ) mov r1, c7.y // 1 mad r9, r9, r1.y, c14.x // 1 // r9 = 1.0 - ( worldz - depth.start ) / depth.length mul r9, r9, c13.a // 1 // Modulate by the material's alpha value max r11, c14.y, r9 // 1 // Clamp the minimum value to 0 min oD0.a, c14.x, r11 // 1 (43) // Clamp the maximum value to 1 // approximately 39 instruction slots used