revert shader
This commit is contained in:
@@ -10,13 +10,12 @@ uniform float inbounds;
|
||||
uniform vec4 color;
|
||||
|
||||
void main() {
|
||||
// vec2 pos = (gl_PointCoord * 2.0 - 1.0) * root2 / 2.0 + 0.5;
|
||||
vec2 pos = (gl_PointCoord * 2.0 - 1.0) * root2 / 2.0 + 0.5;
|
||||
|
||||
// float inbounds = step(0.0, pos.x) * step(0.0, pos.y) *
|
||||
// (1.0 - step(1.0, pos.x)) * (1.0 - step(1.0, pos.y));
|
||||
float inbounds = step(0.0, pos.x) * step(0.0, pos.y) *
|
||||
(1.0 - step(1.0, pos.x)) * (1.0 - step(1.0, pos.y));
|
||||
|
||||
// vec4 color = texture2D(u_image, mix(u_tl, u_br, pos)) * inbounds;
|
||||
vec4 color = vec4(gl_PointCoord.s, gl_PointCoord.t, 0, 1);
|
||||
vec4 color = texture2D(u_image, mix(u_tl, u_br, pos)) * inbounds;
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ const shader_source llmr::shaders[SHADER_COUNT] = {
|
||||
},
|
||||
{
|
||||
"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform float u_size;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_PointSize = u_size;\n}\n",
|
||||
"#define root2 1.4142135623730951\n\nuniform sampler2D u_image;\nuniform vec2 u_tl;\nuniform vec2 u_br;\nuniform vec4 u_color;\n\nuniform vec2 pos;\nuniform float inbounds;\nuniform vec4 color;\n\nvoid main() {\n // vec2 pos = (gl_PointCoord * 2.0 - 1.0) * root2 / 2.0 + 0.5;\n\n // float inbounds = step(0.0, pos.x) * step(0.0, pos.y) *\n // (1.0 - step(1.0, pos.x)) * (1.0 - step(1.0, pos.y));\n\n // vec4 color = texture2D(u_image, mix(u_tl, u_br, pos)) * inbounds;\n vec4 color = vec4(gl_PointCoord.s, gl_PointCoord.t, 0, 1);\n\n gl_FragColor = color;\n}\n",
|
||||
"#define root2 1.4142135623730951\n\nuniform sampler2D u_image;\nuniform vec2 u_tl;\nuniform vec2 u_br;\nuniform vec4 u_color;\n\nuniform vec2 pos;\nuniform float inbounds;\nuniform vec4 color;\n\nvoid main() {\n vec2 pos = (gl_PointCoord * 2.0 - 1.0) * root2 / 2.0 + 0.5;\n\n float inbounds = step(0.0, pos.x) * step(0.0, pos.y) *\n (1.0 - step(1.0, pos.x)) * (1.0 - step(1.0, pos.y));\n\n vec4 color = texture2D(u_image, mix(u_tl, u_br, pos)) * inbounds;\n\n gl_FragColor = color;\n}\n",
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user