mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Misc fixes
This commit is contained in:
parent
523410e8cf
commit
2e0fd4ac4a
3 changed files with 7 additions and 6 deletions
|
@ -60,6 +60,7 @@ void main( PS_IN fragment, out PS_OUT result ) {
|
|||
|
||||
half3 lightVector = normalize( fragment.texcoord0.xyz );
|
||||
half3 diffuseMap = sRGBToLinearRGB( ConvertYCoCgToRGB( YCoCG ) );
|
||||
//diffuseMap.r = 1.0;
|
||||
|
||||
half3 localNormal;
|
||||
// RB begin
|
||||
|
@ -73,7 +74,7 @@ void main( PS_IN fragment, out PS_OUT result ) {
|
|||
localNormal = normalize( localNormal );
|
||||
|
||||
// traditional very dark Lambert light model used in Doom 3
|
||||
half ldotN = dot3( localNormal, lightVector );
|
||||
half ldotN = saturate( dot3( localNormal, lightVector ) );
|
||||
|
||||
#if defined(USE_HALF_LAMBERT)
|
||||
// RB: http://developer.valvesoftware.com/wiki/Half_Lambert
|
||||
|
|
|
@ -54,11 +54,11 @@ void main( PS_IN fragment, out PS_OUT result ) {
|
|||
half4 lightFalloff = idtex2Dproj( samp1, fragment.texcoord2 );
|
||||
half4 lightProj = idtex2Dproj( samp2, fragment.texcoord3 );
|
||||
half4 YCoCG = tex2D( samp3, fragment.texcoord4.xy );
|
||||
half4 specMap = tex2D( samp4, fragment.texcoord5.xy );
|
||||
half4 specMap = sRGBAToLinearRGBA( tex2D( samp4, fragment.texcoord5.xy ) );
|
||||
|
||||
const half3 ambientLightVector = half3( 0.5f, 9.5f - 0.385f, 0.8925f );
|
||||
half3 lightVector = normalize( ambientLightVector );
|
||||
half3 diffuseMap = ConvertYCoCgToRGB( YCoCG );
|
||||
half3 diffuseMap = sRGBToLinearRGB( ConvertYCoCgToRGB( YCoCG ) );
|
||||
|
||||
half3 localNormal;
|
||||
// RB begin
|
||||
|
@ -76,8 +76,8 @@ void main( PS_IN fragment, out PS_OUT result ) {
|
|||
// RB: added abs
|
||||
half3 specularContribution = _half3( pow( abs( hDotN ), specularPower ) );
|
||||
|
||||
half3 diffuseColor = diffuseMap * rpDiffuseModifier.xyz;
|
||||
half3 specularColor = specMap.xyz * specularContribution * rpSpecularModifier.xyz;
|
||||
half3 diffuseColor = diffuseMap * sRGBToLinearRGB( rpDiffuseModifier.xyz );
|
||||
half3 specularColor = specMap.xyz * specularContribution * sRGBToLinearRGB( rpSpecularModifier.xyz );
|
||||
half3 lightColor = lightProj.xyz * lightFalloff.xyz; // ambient fix
|
||||
|
||||
result.color.xyz = ( diffuseColor + specularColor ) * lightColor * fragment.color.xyz;
|
||||
|
|
|
@ -83,7 +83,7 @@ void main( PS_IN fragment, out PS_OUT result )
|
|||
localNormal = normalize( localNormal );
|
||||
|
||||
// traditional very dark Lambert light model used in Doom 3
|
||||
half ldotN = dot3( localNormal, lightVector );
|
||||
half ldotN = saturate( dot3( localNormal, lightVector ) );
|
||||
|
||||
#if defined(USE_HALF_LAMBERT)
|
||||
// RB: http://developer.valvesoftware.com/wiki/Half_Lambert
|
||||
|
|
Loading…
Reference in a new issue