mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-27 18:41:05 +00:00
remove object shader path
This commit is contained in:
parent
9cbbd2fff5
commit
07e32c0fa6
@ -1273,4 +1273,3 @@ namespace MWWorld
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -518,7 +518,11 @@ namespace Shader
|
||||
|
||||
bool simpleLighting = false;
|
||||
node.getUserValue("simpleLighting", simpleLighting);
|
||||
defineMap["simpleLighting"] = simpleLighting ? "1" : "0";
|
||||
if (simpleLighting)
|
||||
{
|
||||
defineMap["forcePPL"] = "1";
|
||||
defineMap["endLight"] = "0";
|
||||
}
|
||||
|
||||
if (writableStateSet->getMode(GL_ALPHA_TEST) != osg::StateAttribute::INHERIT && !previousAddedState->hasMode(GL_ALPHA_TEST))
|
||||
removedState->setMode(GL_ALPHA_TEST, writableStateSet->getMode(GL_ALPHA_TEST));
|
||||
|
@ -87,16 +87,6 @@ void doLighting(vec3 viewPos, vec3 viewNormal, out vec3 diffuseLight, out vec3 a
|
||||
}
|
||||
}
|
||||
|
||||
// Simplest lighting which only takes into account sun and ambient. Currently used for our weather particle systems.
|
||||
void doSimpleLighting(vec3 viewPos, vec3 viewNormal, out vec3 diffuseLight, out vec3 ambientLight)
|
||||
{
|
||||
vec3 ambientOut, diffuseOut;
|
||||
|
||||
perLightSun(diffuseOut, viewPos, viewNormal);
|
||||
ambientLight = gl_LightModel.ambient.xyz;
|
||||
diffuseLight = diffuseOut;
|
||||
}
|
||||
|
||||
vec3 getSpecular(vec3 viewNormal, vec3 viewDirection, float shininess, vec3 matSpec)
|
||||
{
|
||||
vec3 lightDir = normalize(lcalcPosition(0));
|
||||
|
@ -63,7 +63,7 @@ uniform bool simpleWater;
|
||||
varying float euclideanDepth;
|
||||
varying float linearDepth;
|
||||
|
||||
#define PER_PIXEL_LIGHTING ((@normalMap || @forcePPL) && !@simpleLighting)
|
||||
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
||||
|
||||
#if !PER_PIXEL_LIGHTING
|
||||
centroid varying vec3 passLighting;
|
||||
@ -170,9 +170,6 @@ void main()
|
||||
#endif
|
||||
|
||||
float shadowing = unshadowedLightRatio(linearDepth);
|
||||
#if @simpleLighting
|
||||
gl_FragData[0].xyz *= passLighting;
|
||||
#else
|
||||
vec3 lighting;
|
||||
#if !PER_PIXEL_LIGHTING
|
||||
lighting = passLighting + shadowDiffuseLighting * shadowing;
|
||||
@ -183,8 +180,8 @@ void main()
|
||||
lighting = diffuseColor.xyz * diffuseLight + getAmbientColor().xyz * ambientLight + emission;
|
||||
clampLightingResult(lighting);
|
||||
#endif
|
||||
|
||||
gl_FragData[0].xyz *= lighting;
|
||||
#endif
|
||||
|
||||
#if @envMap && !@preLightEnv
|
||||
gl_FragData[0].xyz += texture2D(envMap, envTexCoordGen).xyz * envMapColor.xyz * envLuma;
|
||||
@ -210,7 +207,6 @@ void main()
|
||||
#endif
|
||||
gl_FragData[0].xyz += getSpecular(normalize(viewNormal), normalize(passViewPos.xyz), shininess, matSpec) * shadowing;
|
||||
}
|
||||
|
||||
#if @radialFog
|
||||
float depth;
|
||||
// For the less detailed mesh of simple water we need to recalculate depth on per-pixel basis
|
||||
|
@ -50,7 +50,7 @@ varying vec2 specularMapUV;
|
||||
varying float euclideanDepth;
|
||||
varying float linearDepth;
|
||||
|
||||
#define PER_PIXEL_LIGHTING ((@normalMap || @forcePPL) && !@simpleLighting)
|
||||
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
||||
|
||||
#if !PER_PIXEL_LIGHTING
|
||||
centroid varying vec3 passLighting;
|
||||
@ -126,11 +126,7 @@ void main(void)
|
||||
|
||||
#if !PER_PIXEL_LIGHTING
|
||||
vec3 diffuseLight, ambientLight;
|
||||
#if @simpleLighting
|
||||
doSimpleLighting(passViewPos, viewNormal, diffuseLight, ambientLight);
|
||||
#else
|
||||
doLighting(passViewPos, viewNormal, diffuseLight, ambientLight, shadowDiffuseLighting);
|
||||
#endif
|
||||
doLighting(viewPos.xyz, viewNormal, diffuseLight, ambientLight, shadowDiffuseLighting);
|
||||
vec3 emission = getEmissionColor().xyz * emissiveMult;
|
||||
passLighting = getDiffuseColor().xyz * diffuseLight + getAmbientColor().xyz * ambientLight + emission;
|
||||
clampLightingResult(passLighting);
|
||||
|
@ -31,7 +31,7 @@ void paintClouds(inout vec4 color)
|
||||
color.xyz = clamp(color.xyz * gl_FrontMaterial.emission.xyz, 0.0, 1.0);
|
||||
|
||||
// ease transition between clear color and atmosphere/clouds
|
||||
color = mix(vec4(gl_Fog.color.xyz, color.a), color, passColor.a * passColor.a);
|
||||
color = mix(vec4(gl_Fog.color.xyz, color.a), color, passColor.a);
|
||||
}
|
||||
|
||||
void paintMoon(inout vec4 color)
|
||||
|
Loading…
x
Reference in New Issue
Block a user