Sprites now have a distance lighting calculation that's the same as the raycaster using a shader.
This commit is contained in:
parent
a19bc47904
commit
3986e6978e
4 changed files with 21 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
uniform sampler2D source;
|
||||
uniform sampler2D source;
|
||||
uniform sampler2D bloom;
|
||||
uniform vec2 offsetFactor;
|
||||
uniform vec2 offsetFactor;
|
||||
uniform float darkness;
|
||||
|
||||
void main()
|
||||
|
@ -19,5 +19,7 @@ void main()
|
|||
|
||||
vec4 sourceFragment = texture2D(source, gl_TexCoord[0].xy);
|
||||
vec4 bloomFragment = texture2D(bloom, gl_TexCoord[0].xy);
|
||||
gl_FragColor = color + sourceFragment - bloomFragment - darkness;
|
||||
float alpha = color.a;
|
||||
gl_FragColor = (color + sourceFragment - bloomFragment) / darkness;
|
||||
gl_FragColor.a = alpha;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue