string description = "Flying Lab Sail Shader"; #include "shaderAttrs.fxh" #include "shadows.fxh" #include "Sails.hlsl" float4 otherData[ MAX_TRANSFORM_COUNT ] < string Usage = "pbs.sail.other"; >; float4 DamageUVOffset[ MAX_TRANSFORM_COUNT ] < string Usage = "pbs.sail.damage"; >; float flutterSpeed < int _unitID = 1; > = 1.f; float SailAlpha < int _unitID = 5; > = 0.2; float3 damageColor < int _unitID = 8; > = 1; float3 sailAmbient < string Usage = "pbs.sail.ambient"; > = 0; float4 sailColors[2] < string Usage = "pbs.sail.sailColors"; >; float sailZBias < string Usage = "pbs.sail.zBias"; > = 0; float4x4 sailBlendTransforms[ MAX_TRANSFORM_COUNT ] < string Usage = "pbs.sail.blendTransforms"; >; float4 sailTextureTransforms[ MAX_TRANSFORM_COUNT ] < string Usage = "pbs.sail.textureTransforms"; >; texture SailTexture < string UIName = "Sails Texture"; >; texture DamageTexture < string UIName = "Damage Texture"; >; texture DirtyTexture < string UIName = "Dirty Texture"; >; texture LogoTexture < string UIName = "Logo Texture"; >; texture RampTexture < string UIName = "Ramp Texture"; >; sampler colorMap = sampler_state { texture = ; }; sampler damageMap = sampler_state { texture = ; }; sampler dirtyMap = sampler_state { texture = ; }; sampler logoMap = sampler_state { texture = ; }; sampler rampMap = sampler_state { texture = ; }; #define ID 10 //10/31 technique Sails { pass sail_shadowPass { VertexShader = compile vs_3_0 sailShadowVS( modelViewProjection, otherData, flutterSpeed, time, sailBlendTransforms, ID ); CullMode = NONE; AlphaRef = 0; ZWriteEnable = TRUE; PixelShader = compile ps_3_0 sailShadowPS( ID ); } pass sail_shader_noglow_pass { VertexShader = compile vs_3_0 sailVS( modelViewProjection, modelWorld, shadowTextureWorldTransform, flutterSpeed, sunDirectionObject, sunAmbient, time, otherData, DamageUVOffset, pointLightDiffuseColors, pointLightPositions, pointLightAttenuations, pointLightCount, sailBlendTransforms, fogColor, fogParams, sailTextureTransforms, ID ); PixelShader = compile ps_3_0 sailPS ( colorMap, damageMap, dirtyMap, logoMap, rampMap, samplerShadow, sailAmbient, damageColor, sailColors, sunColor, shadowSampleScale, SailAlpha, sailZBias ); AlphaTestEnable = TRUE; AlphaRef = 2; // 0.01 * 255 CullMode = CW; // Back face culling ZWriteEnable = TRUE; } }