mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
materialsystem: fix(hack) flashlight. normalizedcubemap broken?
This commit is contained in:
@@ -201,22 +201,16 @@ float4 main( PS_INPUT i ) : COLOR
|
||||
|
||||
#if NORMALMAP == 0
|
||||
float3 worldPosToLightVector = texCUBE( NormalizingCubemapSampler, i.worldPosToLightVector ) * 2.0f - 1.0f;
|
||||
float nDotL = dot( worldPosToLightVector, vNormal.xyz );
|
||||
float nDotL = 0.577350f;
|
||||
#endif
|
||||
|
||||
#if NORMALMAP == 1
|
||||
// flashlightfixme: wrap this!
|
||||
float3 tangentPosToLightVector = texCUBE( NormalizingCubemapSampler, i.tangentPosToLightVector ) * 2.0f - 1.0f;
|
||||
float nDotL = dot( tangentPosToLightVector, vNormal.xyz );
|
||||
float nDotL = 0.577350f;
|
||||
#endif
|
||||
|
||||
#if NORMALMAP == 2
|
||||
float3 tangentPosToLightVector = normalize( i.tangentPosToLightVector );
|
||||
|
||||
float nDotL =
|
||||
vNormal.x*dot( tangentPosToLightVector, bumpBasis[0]) +
|
||||
vNormal.y*dot( tangentPosToLightVector, bumpBasis[1]) +
|
||||
vNormal.z*dot( tangentPosToLightVector, bumpBasis[2]);
|
||||
float nDotL = 0.577350f;
|
||||
#endif
|
||||
|
||||
float3 outColor;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -102,9 +102,7 @@ struct VS_OUTPUT
|
||||
#endif
|
||||
float4 color : TEXCOORD2; // Vertex color (from lighting or unlit)
|
||||
|
||||
#if CUBEMAP || _X360
|
||||
float3 worldVertToEyeVector : TEXCOORD3; // Necessary for cubemaps
|
||||
#endif
|
||||
|
||||
float3 worldSpaceNormal : TEXCOORD4; // Necessary for cubemaps and flashlight
|
||||
|
||||
|
||||
Reference in New Issue
Block a user