patriciogonzalezvivo / glslViewer

Console-based GLSL Sandbox for 2D/3D shaders
BSD 3-Clause "New" or "Revised" License
4.62k stars 350 forks source link

Windows: WARNING: 0:2: '' : #version directive missing (on default generated shaders) #310

Open AxiomeCG opened 1 year ago

AxiomeCG commented 1 year ago

On Windows with the glslViewer version 3.0.7, I have a warning on the generated shaders by default (I didn't change anything in the shader).

$ glslViewer.exe test.frag -l
Found warning  while compiling vertex shader
WARNING: 0:2: '' :  #version directive missing

Found warning  while compiling fragment shader
WARNING: 0:2: '' :  #version directive missing

// > Found warning  while compiling vertex shader
WARNING: 0:2: '' :  #version directive missing

The generated .frag file :

#ifdef GL_ES
precision mediump float;
#endif

uniform vec2    u_resolution;
uniform vec2    u_mouse;
uniform float   u_time;

varying vec2    v_texcoord;

void main(void) {
    vec4 color = vec4(vec3(0.0), 1.0);
    vec2 pixel = 1.0/u_resolution.xy;
    vec2 st = gl_FragCoord.xy * pixel;
    vec2 uv = v_texcoord;

    color.rgb = vec3(st.x,st.y,abs(sin(u_time * 3.)));

    gl_FragColor = color;
}

Otherwise it is perfectly working for what I tested so far.

snibbe commented 3 weeks ago

I am working on Windows and had the same problem today! The shader runs fine, but it would be nice to eliminate the error.