Add dynamic ChronoVortexRenderable.
This commit is contained in:
14
glsl/postprocess_textured.vert
Normal file
14
glsl/postprocess_textured.vert
Normal file
@@ -0,0 +1,14 @@
|
||||
#version {VERSION}
|
||||
|
||||
uniform vec2 Pos, Scroll;
|
||||
uniform vec2 p1, p2;
|
||||
|
||||
in vec2 aVertexPosition;
|
||||
in vec2 aVertexTexCoord;
|
||||
out vec2 vTexCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4((aVertexPosition + Pos - Scroll) * p1 + p2, 0, 1);
|
||||
vTexCoord = aVertexTexCoord;
|
||||
}
|
||||
22
glsl/postprocess_textured_vortex.frag
Normal file
22
glsl/postprocess_textured_vortex.frag
Normal file
@@ -0,0 +1,22 @@
|
||||
#version {VERSION}
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
uniform sampler2D VortexTexture;
|
||||
uniform sampler2D WorldTexture;
|
||||
|
||||
in vec2 vTexCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 vtx = texture(VortexTexture, vTexCoord.xy);
|
||||
|
||||
vec2 delta = (vtx.bg - 0.5) * 256.0;
|
||||
float frac = 16.0 * vtx.r + 0.0625;
|
||||
if (vtx.r > 0.055)
|
||||
discard;
|
||||
|
||||
fragColor = texelFetch(WorldTexture, ivec2(gl_FragCoord.xy + delta), 0) * vec4(frac, frac, frac, 1);
|
||||
}
|
||||
Reference in New Issue
Block a user