1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

Shader adjustments

Clamp directional per-vertex diffuse lighting
Simplify vectors
This commit is contained in:
Capostrophic 2019-05-01 11:33:19 +03:00
parent c3cebbfaf6
commit e49232074b
4 changed files with 16 additions and 4 deletions

View file

@ -63,7 +63,7 @@ vec4 doLighting(vec3 viewPos, vec3 viewNormal, vec4 vertexColor, out vec3 shadow
lightResult.xyz += gl_FrontMaterial.emission.xyz;
#if @clamp
lightResult = clamp(lightResult, vec4(0.0, 0.0, 0.0, 0.0), vec4(1.0, 1.0, 1.0, 1.0));
lightResult = clamp(lightResult, vec4(0.0), vec4(1.0));
#else
lightResult = max(lightResult, 0.0);
#endif

View file

@ -98,7 +98,7 @@ void main()
#if @diffuseMap
gl_FragData[0] = texture2D(diffuseMap, adjustedDiffuseUV);
#else
gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0);
gl_FragData[0] = vec4(1.0);
#endif
#if @detailMap
@ -117,7 +117,13 @@ void main()
float shadowing = unshadowedLightRatio();
#if !PER_PIXEL_LIGHTING
#if @clamp
gl_FragData[0] *= clamp(lighting + vec4(shadowDiffuseLighting * shadowing, 0), vec4(0.0), vec4(1.0));
#else
gl_FragData[0] *= lighting + vec4(shadowDiffuseLighting * shadowing, 0);
#endif
#else
gl_FragData[0] *= doLighting(passViewPos, normalize(viewNormal), passColor, shadowing);
#endif

View file

@ -69,7 +69,13 @@ void main()
float shadowing = unshadowedLightRatio();
#if !PER_PIXEL_LIGHTING
#if @clamp
gl_FragData[0] *= clamp(lighting + vec4(shadowDiffuseLighting * shadowing, 0), vec4(0.0), vec4(1.0));
#else
gl_FragData[0] *= lighting + vec4(shadowDiffuseLighting * shadowing, 0);
#endif
#else
gl_FragData[0] *= doLighting(passViewPos, normalize(viewNormal), passColor, shadowing);
#endif

View file

@ -170,7 +170,7 @@ void main(void)
vec2 screenCoords = screenCoordsPassthrough.xy / screenCoordsPassthrough.z;
screenCoords.y = (1.0-screenCoords.y);
vec2 nCoord = vec2(0.0,0.0);
vec2 nCoord = vec2(0.0);
#define waterTimer osg_SimulationTime
@ -186,7 +186,7 @@ void main(void)
if (rainIntensity > 0.01)
rainRipple = rainCombined(position.xy / 1000.0,waterTimer) * clamp(rainIntensity,0.0,1.0);
else
rainRipple = vec4(0.0,0.0,0.0,0.0);
rainRipple = vec4(0.0);
vec3 rippleAdd = rainRipple.xyz * rainRipple.w * 10.0;