#define saturate_color #define nopacked #define floatinterpolation #define depth_compare #pragma warning(disable : 3205) typedef float3 SLT_POINT3; typedef float4 SLT_POINT4; typedef float4x4 SLT_POINT4x4; typedef float SLT_VECTOR1; typedef float3 SLT_VECTOR3; typedef half SLT_DIR1; typedef half3 SLT_DIR3; typedef half4 SLT_DIR4; typedef half SLT_COLOR1; typedef half3 SLT_COLOR3; typedef half4 SLT_COLOR4; typedef half4 SLT_TEXCOORD4; typedef float4 SLT_SHADOWMAP4; typedef float4 SLT_PARAM_FLOAT4; typedef float4x4 SLT_PARAM_FLOAT4x4; typedef float4 SLT_PARAM_HALF4; struct slSParallelLight { SLT_DIR3 vcDir; SLT_COLOR3 clDiffuse; }; SLT_PARAM_HALF4 litDir[2]:register(c6); SLT_PARAM_HALF4 litCol[2]:register(c8); SLT_PARAM_HALF4 ambLit:register(c10); SLT_PARAM_FLOAT4 vEye:register(c11); SLT_PARAM_HALF4 cDiff:register(c12); SLT_PARAM_HALF4 cAmb:register(c13); SLT_PARAM_HALF4 cSpec:register(c14); SLT_COLOR4 slGetMaterialDiffuseColor() { return ( half4 )cDiff; } SLT_COLOR4 slGetMaterialAmbientColor() { return ( half4 )cAmb; } SLT_COLOR4 slGetMaterialSpecularColor() { return ( half4 )cSpec; } SLT_COLOR4 slGetDiffuseColorDefault_unfolded0000(half4 _pipe_vtxColor0) { SLT_COLOR4 _clMaterialDiffuse; _clMaterialDiffuse = slGetMaterialDiffuseColor(); _clMaterialDiffuse *= _pipe_vtxColor0; return _clMaterialDiffuse; } SLT_COLOR4 slGetDiffuseColor_unfolded0000(half4 _pipe_vtxColor0) { return slGetDiffuseColorDefault_unfolded0000( _pipe_vtxColor0 ); } SLT_COLOR4 slGetAmbientColorDefault_unfolded0000(half4 _pipe_vtxColor0) { SLT_COLOR4 _clMaterialAmbient; _clMaterialAmbient = slGetMaterialAmbientColor(); _clMaterialAmbient *= _pipe_vtxColor0; return _clMaterialAmbient; } SLT_COLOR4 slGetAmbientColor_unfolded0000(half4 _pipe_vtxColor0) { return slGetAmbientColorDefault_unfolded0000( _pipe_vtxColor0 ); } SLT_COLOR4 slGetSpecularColorDefault_unfolded0001() { SLT_COLOR4 _clMaterialSpecular; _clMaterialSpecular = slGetMaterialSpecularColor(); return _clMaterialSpecular; } SLT_COLOR4 slGetSpecularColorDefault_unfolded0000() { SLT_COLOR4 _clMaterialSpecular; _clMaterialSpecular = slGetMaterialSpecularColor(); return _clMaterialSpecular; } SLT_COLOR4 slGetSpecularColor_unfolded0001() { return slGetSpecularColorDefault_unfolded0001(); } SLT_COLOR4 slGetSpecularColor_unfolded0000() { return slGetSpecularColorDefault_unfolded0000(); } SLT_COLOR3 slGetEmissiveColor_unfolded0000() { return half3( 0.0, 0.0, 0.0 ); } SLT_VECTOR3 slGetRelativeVector(SLT_POINT3 _pos1, SLT_POINT3 _pos0) { return ( float3 )( _pos1 - _pos0 ); } SLT_DIR3 slNormalizeVector(SLT_VECTOR3 _vec) { return ( half3 )normalize( _vec ); } SLT_DIR3 slNormalizeDirection(SLT_DIR3 _vec) { return normalize( _vec ); } SLT_POINT4 slApplyMatrix(SLT_POINT4x4 mat, SLT_POINT4 vec) { return mul( vec, mat ); } slSParallelLight slGetParallelMainLight() { slSParallelLight _light; _light.vcDir = ( half3 )litDir[0]; _light.clDiffuse = ( half3 )litCol[0]; return _light; } slSParallelLight slGetParallelMainLight_unfolded0001() { slSParallelLight _light; _light = slGetParallelMainLight(); return _light; } slSParallelLight slGetParallelMainLight_unfolded0000() { slSParallelLight _light; _light = slGetParallelMainLight(); return _light; } slSParallelLight slGetParallelSubLight_unfolded0000() { const int _nIndex = 0; slSParallelLight _light; _light.vcDir = ( half3 )litDir[( 0 + 1 ) + _nIndex]; _light.clDiffuse = ( half3 )litCol[( 0 + 1 ) + _nIndex]; return _light; } slSParallelLight slGetParallelSubLight_unfolded0001() { return slGetParallelSubLight_unfolded0000(); } slSParallelLight slGetFirstParallelLight_unfolded0000() { return slGetParallelMainLight_unfolded0001(); } SLT_COLOR3 slGetAmbientLight() { return ( half3 )ambLit; } SLT_DIR3 slGetWorldEyeDirection_unfolded0001(half3 _pipe_vEyeDir) { return _pipe_vEyeDir; } SLT_DIR3 slGetLightingEyeDirection_unfolded0001(half3 _pipe_vEyeDir) { return slGetWorldEyeDirection_unfolded0001( _pipe_vEyeDir ); } SLT_DIR3 slGetWorldEyeDirection_unfolded0000(half3 _pipe_vEyeDir) { return _pipe_vEyeDir; } SLT_DIR3 slGetLightingEyeDirection_unfolded0000(half3 _pipe_vEyeDir) { return slGetWorldEyeDirection_unfolded0000( _pipe_vEyeDir ); } SLT_DIR3 slGetWorldNormal_unfolded0001(half3 _pipe_vcWorldNormal) { return _pipe_vcWorldNormal; } SLT_DIR3 slGetLightingNormal_unfolded0001(half3 _pipe_vcWorldNormal) { return slGetWorldNormal_unfolded0001( _pipe_vcWorldNormal ); } SLT_DIR3 slGetWorldNormal_unfolded0000(half3 _pipe_vcWorldNormal) { return _pipe_vcWorldNormal; } SLT_DIR3 slGetLightingNormal_unfolded0000(half3 _pipe_vcWorldNormal) { return slGetWorldNormal_unfolded0000( _pipe_vcWorldNormal ); } SLT_COLOR3 slGetLightingCoeffs(SLT_DIR1 _fDot, SLT_DIR3 _vcNormal, SLT_DIR3 _vcEyeDir, SLT_DIR3 _vcHalf, SLT_COLOR1 _fSpecularPower) { SLT_COLOR3 _result; { _result = ( half3 )lit( _fDot, dot( _vcNormal, _vcHalf ), _fSpecularPower ); } return _result; } void slAddDiffuseTerm_unfolded0001(inout half4 _pipe_clDiffuse, SLT_COLOR3 _clDiffuse) { _pipe_clDiffuse.rgb += _clDiffuse; } void slAddDiffuseTerm_unfolded0000(inout half3 _pipe_clMainDiffuse, SLT_COLOR3 _clDiffuse) { _pipe_clMainDiffuse += _clDiffuse; } void slAddSpecularTerm_unfolded0001(inout half3 _pipe_clSpecular, SLT_COLOR3 _clSpecular) { _pipe_clSpecular += _clSpecular; } void slAddSpecularTerm_unfolded0000(inout half3 _pipe_clMainSpecular, SLT_COLOR3 _clSpecular) { _pipe_clMainSpecular += _clSpecular; } void slApplyBlinnPhongLighting_unfolded0001(half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, inout half4 _pipe_clDiffuse, inout half3 _pipe_clSpecular, half _pipe_fSpecularDecay, SLT_COLOR3 _clLightColor, SLT_DIR3 _vcLightDir) { SLT_COLOR3 _clDiffuse; SLT_COLOR3 _clSpecular; SLT_DIR3 _vEyeDir = slGetLightingEyeDirection_unfolded0001( _pipe_vEyeDir ); SLT_DIR3 _vNormal = slGetLightingNormal_unfolded0001( _pipe_vcWorldNormal ); SLT_DIR1 _fDot = dot( _vNormal, -_vcLightDir ); SLT_DIR3 _vcHalf = slNormalizeDirection( _vEyeDir - _vcLightDir ); { SLT_COLOR3 _result = slGetLightingCoeffs( _fDot, _vNormal, _vEyeDir, _vcHalf, _pipe_fSpecularDecay ); _clDiffuse = _clLightColor * _result.y; _clSpecular = _clLightColor * _result.z; } slAddDiffuseTerm_unfolded0001( _pipe_clDiffuse, _clDiffuse ); slAddSpecularTerm_unfolded0001( _pipe_clSpecular, _clSpecular ); } void slApplyBlinnPhongLighting_unfolded0000(half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, inout half3 _pipe_clMainDiffuse, inout half3 _pipe_clMainSpecular, half _pipe_fSpecularDecay, SLT_COLOR3 _clLightColor, SLT_DIR3 _vcLightDir) { SLT_COLOR3 _clDiffuse; SLT_COLOR3 _clSpecular; SLT_DIR3 _vEyeDir = slGetLightingEyeDirection_unfolded0000( _pipe_vEyeDir ); SLT_DIR3 _vNormal = slGetLightingNormal_unfolded0000( _pipe_vcWorldNormal ); SLT_DIR1 _fDot = dot( _vNormal, -_vcLightDir ); SLT_DIR3 _vcHalf = slNormalizeDirection( _vEyeDir - _vcLightDir ); { SLT_COLOR3 _result = slGetLightingCoeffs( _fDot, _vNormal, _vEyeDir, _vcHalf, _pipe_fSpecularDecay ); _clDiffuse = _clLightColor * _result.y; _clSpecular = _clLightColor * _result.z; } slAddDiffuseTerm_unfolded0000( _pipe_clMainDiffuse, _clDiffuse ); slAddSpecularTerm_unfolded0000( _pipe_clMainSpecular, _clSpecular ); } void slApplyLighting_unfolded0001(half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, inout half4 _pipe_clDiffuse, inout half3 _pipe_clSpecular, half _pipe_fSpecularDecay, SLT_COLOR3 _clLightColor, SLT_DIR3 _vcLightDir) { slApplyBlinnPhongLighting_unfolded0001( _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clDiffuse, _pipe_clSpecular, _pipe_fSpecularDecay, _clLightColor, _vcLightDir ); } void slApplyParallelLight_unfolded0001(half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, inout half4 _pipe_clDiffuse, inout half3 _pipe_clSpecular, half _pipe_fSpecularDecay, slSParallelLight _lit) { slApplyLighting_unfolded0001( _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clDiffuse, _pipe_clSpecular, _pipe_fSpecularDecay, _lit.clDiffuse, _lit.vcDir ); } void slApplyLighting_unfolded0000(half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, inout half3 _pipe_clMainDiffuse, inout half3 _pipe_clMainSpecular, half _pipe_fSpecularDecay, SLT_COLOR3 _clLightColor, SLT_DIR3 _vcLightDir) { slApplyBlinnPhongLighting_unfolded0000( _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clMainDiffuse, _pipe_clMainSpecular, _pipe_fSpecularDecay, _clLightColor, _vcLightDir ); } void slApplyParallelLight_unfolded0000(half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, inout half3 _pipe_clMainDiffuse, inout half3 _pipe_clMainSpecular, half _pipe_fSpecularDecay, slSParallelLight _lit) { slApplyLighting_unfolded0000( _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clMainDiffuse, _pipe_clMainSpecular, _pipe_fSpecularDecay, _lit.clDiffuse, _lit.vcDir ); } void slApplyMainLight_unfolded0000(half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, inout half3 _pipe_clMainDiffuse, inout half3 _pipe_clMainSpecular, half _pipe_fSpecularDecay) { slApplyParallelLight_unfolded0000( _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clMainDiffuse, _pipe_clMainSpecular, _pipe_fSpecularDecay, slGetParallelMainLight_unfolded0000() ); } void slApplyParallelSubLights_unfolded0000(half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, inout half4 _pipe_clDiffuse, inout half3 _pipe_clSpecular, half _pipe_fSpecularDecay) { slSParallelLight paralitP; paralitP = slGetParallelSubLight_unfolded0001(); slApplyParallelLight_unfolded0001( _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clDiffuse, _pipe_clSpecular, _pipe_fSpecularDecay, paralitP ); } void slApplyDiffuseMaterialDefault_unfolded0000(half4 _pipe_vtxColor0, inout half3 _pipe_clMainDiffuse, inout half4 _pipe_clDiffuse) { SLT_COLOR4 _clMaterialDiffuse = slGetDiffuseColor_unfolded0000( _pipe_vtxColor0 ); _pipe_clMainDiffuse.rgb *= ( half3 )_clMaterialDiffuse; _pipe_clDiffuse *= _clMaterialDiffuse; } void slApplySpecularMaterialDefault_unfolded0000(inout half3 _pipe_clMainSpecular, inout half3 _pipe_clSpecular) { SLT_COLOR4 _clMaterialSpecular = slGetSpecularColor_unfolded0001(); _pipe_clMainSpecular.rgb *= ( half3 )_clMaterialSpecular; _pipe_clSpecular.rgb *= ( half3 )_clMaterialSpecular; } void slApplyDiffuseMaterial_unfolded0000(half4 _pipe_vtxColor0, inout half3 _pipe_clMainDiffuse, inout half4 _pipe_clDiffuse) { slApplyDiffuseMaterialDefault_unfolded0000( _pipe_vtxColor0, _pipe_clMainDiffuse, _pipe_clDiffuse ); } void slCompositAmbientLightingResult_unfolded0000(half4 _pipe_vtxColor0, half3 _pipe_clAmbient, inout half4 _pipe_clDiffuse) { { SLT_COLOR4 _clMaterialAmbient = slGetAmbientColor_unfolded0000( _pipe_vtxColor0 ); _pipe_clDiffuse.rgb += ( _pipe_clAmbient * _clMaterialAmbient.rgb ); } } void slCompositEmissiveLightingResult_unfolded0000(inout half4 _pipe_clDiffuse) { _pipe_clDiffuse.rgb += slGetEmissiveColor_unfolded0000(); } void slPrepareLightingDefault_unfolded0000(out half3 _pipe_clAmbient, out half3 _pipe_clMainDiffuse, out half4 _pipe_clDiffuse, out half3 _pipe_clMainSpecular, out half3 _pipe_clSpecular, out half _pipe_fSpecularDecay) { SLT_COLOR4 _clZero = half4(0, 0, 0, 1 ); _pipe_clAmbient = slGetAmbientLight(); _pipe_clMainDiffuse = _clZero.rgb; _pipe_clDiffuse = _clZero; { _pipe_clMainSpecular = _clZero.rgb; _pipe_clSpecular = _clZero.rgb; SLT_COLOR4 _clMaterialSpecular = slGetSpecularColor_unfolded0000(); _pipe_fSpecularDecay = ( half )_clMaterialSpecular.w; } } void slPrepareLighting_unfolded0000(out half3 _pipe_clAmbient, out half3 _pipe_clMainDiffuse, out half4 _pipe_clDiffuse, out half3 _pipe_clMainSpecular, out half3 _pipe_clSpecular, out half _pipe_fSpecularDecay) { slPrepareLightingDefault_unfolded0000( _pipe_clAmbient, _pipe_clMainDiffuse, _pipe_clDiffuse, _pipe_clMainSpecular, _pipe_clSpecular, _pipe_fSpecularDecay ); } void slApplySpecularMaterial_unfolded0000(inout half3 _pipe_clMainSpecular, inout half3 _pipe_clSpecular) { slApplySpecularMaterialDefault_unfolded0000( _pipe_clMainSpecular, _pipe_clSpecular ); } void slApplyVertexLightingBody_unfolded0000(half4 _pipe_vtxColor0, half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, out half3 _pipe_clAmbient, out half3 _pipe_clMainDiffuse, out half4 _pipe_clDiffuse, out half3 _pipe_clMainSpecular, out half3 _pipe_clSpecular, out half _pipe_fSpecularDecay) { slPrepareLighting_unfolded0000( _pipe_clAmbient, _pipe_clMainDiffuse, _pipe_clDiffuse, _pipe_clMainSpecular, _pipe_clSpecular, _pipe_fSpecularDecay ); slApplyMainLight_unfolded0000( _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clMainDiffuse, _pipe_clMainSpecular, _pipe_fSpecularDecay ); slApplyParallelSubLights_unfolded0000( _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clDiffuse, _pipe_clSpecular, _pipe_fSpecularDecay ); slApplySpecularMaterial_unfolded0000( _pipe_clMainSpecular, _pipe_clSpecular ); slApplyDiffuseMaterial_unfolded0000( _pipe_vtxColor0, _pipe_clMainDiffuse, _pipe_clDiffuse ); slCompositAmbientLightingResult_unfolded0000( _pipe_vtxColor0, _pipe_clAmbient, _pipe_clDiffuse ); slCompositEmissiveLightingResult_unfolded0000( _pipe_clDiffuse ); } void slApplyVertexLighting_unfolded0000(half4 _pipe_vtxColor0, half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, out half3 _pipe_clAmbient, out half3 _pipe_clMainDiffuse, out half4 _pipe_clDiffuse, out half3 _pipe_clMainSpecular, out half3 _pipe_clSpecular, out half _pipe_fSpecularDecay) { slApplyVertexLightingBody_unfolded0000( _pipe_vtxColor0, _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clAmbient, _pipe_clMainDiffuse, _pipe_clDiffuse, _pipe_clMainSpecular, _pipe_clSpecular, _pipe_fSpecularDecay ); } SLT_PARAM_FLOAT4x4 mL2P:register(c0); SLT_POINT4x4 slGetMatrixL2P() { return ( float4x4 )mL2P; } SLT_POINT4 slGetWorldPosition_unfolded0001(float4 _pipe_vWorldPos) { return _pipe_vWorldPos; } void slInsertVertexVectors_unfolded0000(float4 _pipe_vWorldPos, out float3 _pipe_vEye, out half3 _pipe_vEyeDir) { _pipe_vEye = slGetRelativeVector( ( float3 )vEye, ( float3 )( _pipe_vWorldPos ) ); _pipe_vEyeDir = slNormalizeVector( _pipe_vEye ); } SLT_POINT4x4 mW2Pt:register(c15); SLT_POINT4 slGetPatternMapSourcePosition_unfolded0000(float4 _pipe_vWorldPos) { return slGetWorldPosition_unfolded0001( _pipe_vWorldPos ); } void slOutputPatternMapParameters_unfolded0000(float4 _pipe_vWorldPos, out half2 _pipe_vPatternPos) { SLT_TEXCOORD4 _vPatternPos; _vPatternPos = mul( slGetPatternMapSourcePosition_unfolded0000( _pipe_vWorldPos ), mW2Pt ); _pipe_vPatternPos = ( half2 )_vPatternPos; } void slOutputPatternMapVertex_unfolded0000(float4 _pipe_vWorldPos, out half2 _pipe_vPatternPos) { slOutputPatternMapParameters_unfolded0000( _pipe_vWorldPos, _pipe_vPatternPos ); } void slApplyAccessoryVertexLighting_unfolded0000(half4 _pipe_vtxColor0, half3 _pipe_vcWorldNormal, half3 _pipe_vEyeDir, out half3 _pipe_clAmbient, out half3 _pipe_clMainDiffuse, out half4 _pipe_clDiffuse, out half3 _pipe_clMainSpecular, out half3 _pipe_clSpecular, out half _pipe_fSpecularDecay) { slApplyVertexLighting_unfolded0000( _pipe_vtxColor0, _pipe_vcWorldNormal, _pipe_vEyeDir, _pipe_clAmbient, _pipe_clMainDiffuse, _pipe_clDiffuse, _pipe_clMainSpecular, _pipe_clSpecular, _pipe_fSpecularDecay ); } void slOutputAccessoryVertex_unfolded0000(float4 _pipe_vWorldPos, out half2 _pipe_vPatternPos) { slOutputPatternMapVertex_unfolded0000( _pipe_vWorldPos, _pipe_vPatternPos ); } SLT_PARAM_FLOAT4x4 mW2S[1]:register(c19); SLT_POINT4x4 slGetMatrixW2S_unfolded0000() { const int _n = 0; return mW2S[_n]; } SLT_SHADOWMAP4 slGetShadowMapFacePositionFromWorld_unfolded0000(SLT_POINT4 _pos) { SLT_SHADOWMAP4 _vShadowPos; _vShadowPos = ( float4 )slApplyMatrix( slGetMatrixW2S_unfolded0000(), _pos ); return _vShadowPos; } SLT_SHADOWMAP4 slGetShadowMapFacePosition_unfolded0000(float4 _pipe_vWorldPos) { SLT_SHADOWMAP4 _vShadowPos; _vShadowPos = slGetShadowMapFacePositionFromWorld_unfolded0000( _pipe_vWorldPos ); return _vShadowPos; } void slInsertShadowMapPosition_unfolded0000(float4 _pipe_vWorldPos, out float4 _pipe_vShadowPos0) { _pipe_vShadowPos0 = slGetShadowMapFacePosition_unfolded0000( _pipe_vWorldPos ); } void slOutputVertexShadowMapPosition_unfolded0000(float4 _pipe_vWorldPos, out float4 _pipe_vShadowPos0) { slInsertShadowMapPosition_unfolded0000( _pipe_vWorldPos, _pipe_vShadowPos0 ); } SLT_PARAM_FLOAT4 fog:register(c23); SLT_PARAM_FLOAT4 Scat[4]:register(c24); SLT_COLOR3 slGetRayleigh(SLT_COLOR1 _fLV) { return Scat[2].rgb * ( 1.0 + _fLV * _fLV ); } SLT_COLOR3 slGetMie(SLT_COLOR1 _fLV) { return Scat[3].rgb * pow( Scat[3].a + Scat[2].a * _fLV, -1.500000 ); } SLT_COLOR3 slGetInScattering(SLT_COLOR1 _fLV) { return slGetMie( _fLV ) + slGetRayleigh( _fLV ) + Scat[1].rgb; } SLT_COLOR3 slGetScatteringExtinction(SLT_COLOR1 _fDepth) { SLT_COLOR3 _fD = saturate( exp2( ( half3 )( Scat[0].rgb * _fDepth ) ) ); return _fD; } void slGetScatteringExtinction_unfolded0000(out half3 _pipe_vScatExtinct, SLT_COLOR1 _fDepth) { _pipe_vScatExtinct = slGetScatteringExtinction( _fDepth ); } void slGetScatteringParameters_unfolded0000(out half3 _pipe_vScatExtinct, out half3 _pipe_cInScat, SLT_COLOR1 _fDepth, SLT_DIR1 _fLV) { slGetScatteringExtinction_unfolded0000( _pipe_vScatExtinct, _fDepth ); _pipe_cInScat = slGetInScattering( _fLV ); } SLT_DIR3 slGetScatteringLightDirection_unfolded0000() { slSParallelLight result = slGetFirstParallelLight_unfolded0000(); return result.vcDir; } void slGetScatteringParameters_unfolded0001(out half3 _pipe_vScatExtinct, out half3 _pipe_cInScat, SLT_VECTOR3 _vcEye) { SLT_VECTOR1 _fLen = dot( _vcEye, _vcEye ); SLT_VECTOR1 _fRLen = rsqrt( _fLen ); _fLen *= _fRLen; SLT_COLOR1 _fDepth = fog.x * _fLen + fog.y; { SLT_DIR3 _vcLight = slGetScatteringLightDirection_unfolded0000(); _vcEye *= _fRLen; slGetScatteringParameters_unfolded0000( _pipe_vScatExtinct, _pipe_cInScat, _fDepth, dot( _vcEye, _vcLight ) ); } } void slGetVSOutScattering_unfolded0000(float3 _pipe_vEye, out half3 _pipe_vScatExtinct, out half3 _pipe_cInScat) { slGetScatteringParameters_unfolded0001( _pipe_vScatExtinct, _pipe_cInScat, _pipe_vEye ); } void slOutputVertexFogDepth_unfolded0000(float3 _pipe_vEye, out half3 _pipe_vScatExtinct, out half3 _pipe_cInScat) { slGetVSOutScattering_unfolded0000( _pipe_vEye, _pipe_vScatExtinct, _pipe_cInScat ); } SLT_PARAM_FLOAT4 scale:register(c4); SLT_PARAM_FLOAT4 gMrpRng:register(c5); void slTransformTerrainVertex_unfolded0000(float4 _pipe_vtxPos, half3 _pipe_vtxNormal, out float4 _pipe_vProjPos, out float4 _pipe_vWorldPos, out half3 _pipe_vcWorldNormal, out float3 _pipe_vEye, out half3 _pipe_vEyeDir) { _pipe_vProjPos = slApplyMatrix( slGetMatrixL2P(), _pipe_vtxPos ); _pipe_vWorldPos = _pipe_vtxPos; _pipe_vcWorldNormal = _pipe_vtxNormal.xyz; slInsertVertexVectors_unfolded0000( _pipe_vWorldPos, _pipe_vEye, _pipe_vEyeDir ); } SLT_DIR3 slDecodeTerrainNormal_unfolded0000(half4 _pipe_vtxColor0, half4 _pipe_vtxColor1) { SLT_DIR3 _vcNormal; _vcNormal.x = _pipe_vtxColor0.w * 255.0 / 127.0 - 128.0 / 127.0; _vcNormal.z = _pipe_vtxColor1.w * 255.0 / 127.0 - 128.0 / 127.0; _vcNormal.y = sqrt( 1.0 - dot( _vcNormal.xz, _vcNormal.xz ) ); return _vcNormal; } SLT_COLOR4 slDecodeTerrainVertexColor_unfolded0000(half4 _pipe_vtxColor0, half4 _pipe_vtxColor1, half _pipe_fMorph) { SLT_DIR4 _vColor; _vColor.rgb = lerp( _pipe_vtxColor0.rgb, _pipe_vtxColor1.rgb, _pipe_fMorph ); _vColor.a = 1.0; return _vColor; } void slDecodeTerrainVertex_unfolded0000(inout float4 _pipe_vtxPos, inout half4 _pipe_vtxColor0, half4 _pipe_vtxColor1, out half _pipe_fMorph, out half3 _pipe_vtxNormal) { SLT_POINT4 _vDecodePos; _vDecodePos.xyz = scale.xyz * _pipe_vtxPos.xyz; _vDecodePos.w = 1.0; _pipe_fMorph = saturate( dot( _vDecodePos, gMrpRng ) ); _vDecodePos.y = scale.y * ( _pipe_vtxPos.y + _pipe_vtxPos.w * _pipe_fMorph ); _vDecodePos.y += scale.w; _pipe_vtxNormal = slDecodeTerrainNormal_unfolded0000( _pipe_vtxColor0, _pipe_vtxColor1 ); _pipe_vtxColor0 = slDecodeTerrainVertexColor_unfolded0000( _pipe_vtxColor0, _pipe_vtxColor1, _pipe_fMorph ); _pipe_vtxPos = _vDecodePos; } struct SVSInput { float4 vtxPos : POSITION0; saturate_color half4 vtxColor0 : NORMAL; saturate_color half4 vtxColor1 : COLOR0; }; struct SVSOutput { float4 vOutPos : POSITION; float4 vWorldPos : TEXCOORD0; half4 clDiffuse : TEXCOORD1; floatinterpolation float4 vShadowPos0 : TEXCOORD2; half3 cInScat : TEXCOORD3; half3 vScatExtinct : TEXCOORD4; half3 clSpecular : TEXCOORD5; half3 clMainSpecular : TEXCOORD6; half3 clMainDiffuse : TEXCOORD7; half2 vPatternPos : TEXCOORD8; }; void main(in SVSInput ktglInput, out SVSOutput ktglOutput) { half ktglInside_fMorph; half3 ktglInside_vtxNormal; float4 ktglInside_vProjPos; half3 ktglInside_vcWorldNormal; float3 ktglInside_vEye; half3 ktglInside_vEyeDir; half3 ktglInside_clAmbient; half ktglInside_fSpecularDecay; slDecodeTerrainVertex_unfolded0000( ktglInput.vtxPos, ktglInput.vtxColor0, ktglInput.vtxColor1, ktglInside_fMorph, ktglInside_vtxNormal ); slTransformTerrainVertex_unfolded0000( ktglInput.vtxPos, ktglInside_vtxNormal, ktglInside_vProjPos, ktglOutput.vWorldPos, ktglInside_vcWorldNormal, ktglInside_vEye, ktglInside_vEyeDir ); ktglOutput.vOutPos = ktglInside_vProjPos; { { slApplyAccessoryVertexLighting_unfolded0000( ktglInput.vtxColor0, ktglInside_vcWorldNormal, ktglInside_vEyeDir, ktglInside_clAmbient, ktglOutput.clMainDiffuse, ktglOutput.clDiffuse, ktglOutput.clMainSpecular, ktglOutput.clSpecular, ktglInside_fSpecularDecay ); slOutputVertexShadowMapPosition_unfolded0000( ktglOutput.vWorldPos, ktglOutput.vShadowPos0 ); slOutputVertexFogDepth_unfolded0000( ktglInside_vEye, ktglOutput.vScatExtinct, ktglOutput.cInScat ); } slOutputAccessoryVertex_unfolded0000( ktglOutput.vWorldPos, ktglOutput.vPatternPos ); } }