68 lines
2.2 KiB
Plaintext
68 lines
2.2 KiB
Plaintext
{
|
|
parms {
|
|
stageSort sortCoverage
|
|
|
|
fadePerturbProgram = modelFadePerturb;
|
|
}
|
|
state {
|
|
depthfunc GL_LEQUAL
|
|
}
|
|
hlsl_vp {
|
|
#include "includes/vertex.inc"
|
|
|
|
CALC_TEXCOORDS( result.texcoord0 );
|
|
float4 position;
|
|
float4 normal;
|
|
float4 tangent;
|
|
float3 worldPosition;
|
|
CALC_PNT( position, normal, tangent );
|
|
CALC_SKINNED_POSITION_NORMALS( result.position, result.texcoord1, result.texcoord2, result.texcoord3, result.texcoord4, position, normal, tangent, worldPosition );
|
|
CALC_MUZZLE_FLASH_VECTOR( $muzzleFlashOffset, result.texcoord5 )
|
|
}
|
|
hlsl_fp {
|
|
#include "includes/vmtr.inc"
|
|
|
|
half4 sampleSpecular;
|
|
half4 sampleYCoCg;
|
|
half4 sampleNormal;
|
|
half2 feedbackTexCoord;
|
|
float4 feedback;
|
|
half3 surfaceDiffuse;
|
|
half3 surfaceSpecular;
|
|
half3 fromViewerN;
|
|
half3 globalNormal;
|
|
half4 globalReflection;
|
|
half4 color;
|
|
|
|
APPLY_MODEL_FADE;
|
|
|
|
FETCH_VMTR( sampleSpecular, sampleYCoCg, sampleNormal, feedbackTexCoord );
|
|
CALC_VMTR_FEEDBACK( feedback, feedbackTexCoord );
|
|
CALC_DIFFUSE_RGB( surfaceDiffuse, sampleYCoCg );
|
|
CALC_SPECULAR_RGB( surfaceSpecular, sampleSpecular, sampleNormal.z );
|
|
CALC_FROM_VIEWER( fromViewerN, fragment.htexcoord4.xyz );
|
|
CALC_GLOBAL_NORMAL( globalNormal, sampleNormal, fragment.texcoord1.xyz, fragment.texcoord2.xyz, fragment.texcoord3.xyz );
|
|
CALC_GLOBAL_REFLECTION( globalReflection, globalNormal, fromViewerN );
|
|
|
|
half3 diffuse = surfaceDiffuse;
|
|
half3 specular = surfaceSpecular;
|
|
|
|
BRANCH if ( $lightingModel.x > 0 ) {
|
|
float3 fragmentXYZ;
|
|
CALC_FRAGMENT_POS( fragmentXYZ, fragment.htexcoord4.xyz );
|
|
APPLY_LIGHTING_LOCAL( color, diffuse, specular, sampleNormal.x, globalNormal, fragmentXYZ, globalReflection );
|
|
} else {
|
|
APPLY_GRAZING( diffuse, specular, globalNormal, fromViewerN );
|
|
APPLY_SPECULAR_REFLECTION( specular, sampleNormal.x, globalReflection );
|
|
APPLY_SCALING( diffuse, specular );
|
|
APPLY_LIGHTING( color, diffuse, specular, globalNormal );
|
|
APPLY_MUZZLE_FLASH( color, surfaceDiffuse, globalNormal, fragment.texcoord5.xyz );
|
|
}
|
|
APPLY_HIGHLIGHT( color, fromViewerN, fragment.texcoord1, fragment.texcoord2, fragment.texcoord3 );
|
|
|
|
result.color0 = color;
|
|
result.color1 = feedback;
|
|
|
|
OUTPUT_SURFACE_ATTRIBUTES( surfaceDiffuse, surfaceSpecular, sampleNormal.x, globalNormal );
|
|
}
|
|
} |