mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Changes to GLSL files for OpenGL
This commit is contained in:
parent
2142d452d4
commit
6aea37b407
98 changed files with 3366 additions and 2686 deletions
|
|
@ -20,9 +20,11 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
varying vec2 texCoord;
|
||||
varying vec4 color;
|
||||
varying float fade;
|
||||
in vec2 texCoord;
|
||||
in vec4 color;
|
||||
in float fade;
|
||||
|
||||
out vec4 OUT_FragColor0;
|
||||
|
||||
uniform sampler2D inputTex;
|
||||
uniform vec4 ambient;
|
||||
|
|
@ -30,17 +32,6 @@ uniform vec4 ambient;
|
|||
|
||||
void main()
|
||||
{
|
||||
vec3 LUMINANCE_VECTOR = vec3(0.2125f, 0.4154f, 0.1721f);
|
||||
float esmFactor = 200.0;
|
||||
|
||||
float lum = dot( ambient.rgb, LUMINANCE_VECTOR );
|
||||
|
||||
gl_FragColor.rgb = ambient.rgb * lum;
|
||||
gl_FragColor.a = 0.0;
|
||||
float depth = texture2D(inputTex, texCoord).a;
|
||||
|
||||
depth = depth * exp(depth - 10.0);
|
||||
depth = exp(esmFactor * depth) - 1.0;
|
||||
|
||||
gl_FragColor.a = clamp(depth * 300.0, 0.0, 1.0) * (1.0 - lum) * fade * color.a;
|
||||
float shadow = texture( inputTex, texCoord ).a * color.a;
|
||||
OUT_FragColor0 = ( ambient * shadow ) + ( 1 - shadow );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue