Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Reload breaks hard coded shaders?

edited April 27 in Bugs Posts: 122

i noticed in my project when i use the reload button in the viewer panel, it breaks the hard coded shaders i have (the shader example project works fine)

is this because i define shaders directly in my files?

e.g. of a "hard coded shader"

Color = {
  v = [[
    uniform mat4 modelViewProjection;

    uniform vec3 modColor;
    uniform float modAlpha;

    attribute vec4 position;
    attribute vec4 color;
    attribute vec2 texCoord;
    varying lowp vec4 vColor;
    varying highp vec2 vTexCoord;
    void main() {
        vColor=vec4( color.rgb * modColor.rgb, color.a * modAlpha );
        vTexCoord = texCoord;
        gl_Position = modelViewProjection * position;
    }
  ]],
  f = [[
    precision highp float;
    uniform lowp sampler2D texture;
    varying lowp vec4 vColor;
    varying highp vec2 vTexCoord;
    void main() {
      lowp vec4 col = texture2D( texture, vTexCoord)*vColor;
      gl_FragColor = vec4( vColor.r, vColor.g, vColor.b, vColor.a );
    }
  ]]
}

myColorShader = shader(Color.v, Color.f)

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,587

    I'll give this a try, thanks for the report

  • Posts: 122

    ive retested this and it’s not happening anymore, maybe i just had some issue in my implementation

  • SimeonSimeon Admin Mod
    Posts: 5,587

    Thanks for the update @skar let me know if it happens again

Sign In or Register to comment.