Use of undeclared identifier. . . . . help with slab shader


    Jan 25 2017 | 4:24 am
    I decided to port this noise shader from shadertoy (https://www.shadertoy.com/view/MlSSRR) and am not compiling in the slab due to variable names, it seems. I'm declaring the variables in the shader, though?
    I get these warnings from the max window:
    jit.gl.slab: -- START GLSL INFO LOG: fp -- ERROR: 0:104: Use of undeclared identifier 'iResolution' ERROR: 0:105: Use of undeclared identifier 'uv' ERROR: 0:105: Use of undeclared identifier 'iResolution' ERROR: 0:105: Use of undeclared identifier 'iResolution' ERROR: 0:106: Use of undeclared identifier 'uv' ERROR: 0:107: Use of undeclared identifier 't' ERROR: 0:107: Use of undeclared identifier 't' ERROR: 0:107: Use of undeclared identifier 't' ERROR: 0:108: Use of undeclared identifier 'finalColor' jit.gl.slab: -- END GLSL INFO LOG: fp -- jit.gl.slab: jit.gl.shader: GLSL program failed to compile.
    Here's the shader:
    //is this perlin? we'll find out after it's working
    Max Patcher
    In Max, select New From Clipboard.

    • Jan 25 2017 | 11:29 am
      You are not declaring them, you are only handling the bindings in the xml header. You need to declare them after the header:
      uniform vec2 iResolution; .... ...
      float hash(vec2 p) { return fract(sin(dot(p, vec2(15.79,81.93)))*45678.9123); }
    • Jan 25 2017 | 4:42 pm
      Thank you Luca Neil! Super exciting!
      //is this perlin? we'll find out after it's working
    • Jan 25 2017 | 11:44 pm
      Side note... Since you are in the fragment shader you don't need to declare varyings, only uniforms. Use varyings if you need to pass data from vertex or geom passes. And it's easier to use the build in states:
      have a look at:
    • Jan 30 2017 | 12:10 am
      Cool, thank you.