forked from mirror/openmw-tes3mp
changed shading to be more like MW (completely replace material ambient with vertex colors if present), fixes some too dark daedric ruins
This commit is contained in:
parent
f58a4ada7a
commit
8ac2d11f56
1 changed files with 9 additions and 6 deletions
|
@ -116,8 +116,9 @@
|
||||||
shInput(float3, normalPassthrough)
|
shInput(float3, normalPassthrough)
|
||||||
shInput(float3, objSpacePositionPassthrough)
|
shInput(float3, objSpacePositionPassthrough)
|
||||||
shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour)
|
shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour)
|
||||||
//shUniform(float, passIteration) @shAutoConstant(passIteration, pass_iteration_number)
|
#if !HAS_VERTEXCOLOR
|
||||||
shUniform(float4, materialAmbient) @shAutoConstant(materialAmbient, surface_ambient_colour)
|
shUniform(float4, materialAmbient) @shAutoConstant(materialAmbient, surface_ambient_colour)
|
||||||
|
#endif
|
||||||
shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour)
|
shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour)
|
||||||
shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)
|
shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)
|
||||||
@shForeach(@shGlobalSettingString(num_lights))
|
@shForeach(@shGlobalSettingString(num_lights))
|
||||||
|
@ -178,8 +179,13 @@
|
||||||
float3 lightDir;
|
float3 lightDir;
|
||||||
float3 diffuse = float3(0,0,0);
|
float3 diffuse = float3(0,0,0);
|
||||||
float d;
|
float d;
|
||||||
|
|
||||||
|
#if HAS_VERTEXCOLOR
|
||||||
|
// ambient vertex colour tracking, FFP behaviour
|
||||||
|
float3 ambient = colourPassthrough.xyz * lightAmbient.xyz;
|
||||||
|
#else
|
||||||
float3 ambient = materialAmbient.xyz * lightAmbient.xyz;
|
float3 ambient = materialAmbient.xyz * lightAmbient.xyz;
|
||||||
|
#endif
|
||||||
|
|
||||||
// shadows only for the first (directional) light
|
// shadows only for the first (directional) light
|
||||||
#if SHADOWS
|
#if SHADOWS
|
||||||
|
@ -237,10 +243,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@shEndForeach
|
@shEndForeach
|
||||||
|
|
||||||
#if HAS_VERTEXCOLOR
|
|
||||||
ambient *= colourPassthrough.xyz;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
shOutputColour(0).xyz *= (ambient + diffuse + materialEmissive.xyz);
|
shOutputColour(0).xyz *= (ambient + diffuse + materialEmissive.xyz);
|
||||||
#endif
|
#endif
|
||||||
|
@ -293,6 +295,7 @@
|
||||||
#if MRT
|
#if MRT
|
||||||
shOutputColour(1) = float4(depthPassthrough / far,1,1,1);
|
shOutputColour(1) = float4(depthPassthrough / far,1,1,1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue