We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since glslx doesn't support preprocessing, how to check e.g. if highp is available in a fragment shader ?
#ifndef GL_FRAGMENT_PRECISION_HIGH precision mediump float; #else precision highp float; #endif
The text was updated successfully, but these errors were encountered:
Usage of #define is detected as a syntax error.
#define
<stdin>:7:1: error: Unexpected PRAGMA #define ITERATIONS 8
#version 100 precision highp float; #define ITERATIONS 8 varying vec2 fragTexCoord; varying vec4 fragColor; uniform sampler2D texture0; uniform vec4 colDiffuse; uniform sampler2D texture1; uniform float power; float map(float value, float min1, float max1, float min2, float max2) { return min2 + (value - min1) * (max2 - min2) / (max1 - min1); } int modulo(int value, int interval) { while (value >= interval) { value -= interval; } return value; } vec2 getPos(vec2 uv, float scale, int iter) { float shuffle = float(iter / 4); vec2 mapped = uv + vec2(shuffle * -5.4894, shuffle * 12.546); vec4 color = texture2D(texture1, mapped); float x = color[modulo(iter+0, 4)]; float y = color[modulo(iter+1, 4)]; return uv + vec2(x,y) * scale; } void main() { float scale = map(power, 0.0, 1.0, 0.0, 0.12); vec4 col = vec4(0.0, 0.0, 0.0, 0.0); for (int i = 0; i < ITERATIONS; i++) { col += texture2D(texture0, getPos(fragTexCoord, scale, i)); } vec4 outputColor = col / float(ITERATIONS); gl_FragColor = vec4(outputColor.xyz, 1.0); }
Workaround is just declaring a variable. ¯\(ツ)/¯
int ITERATIONS = 8;
Sorry, something went wrong.
No branches or pull requests
Since glslx doesn't support preprocessing, how to check e.g. if highp is available in a fragment shader ?
The text was updated successfully, but these errors were encountered: