Howdy, Stranger!

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

Shader syntax

edited April 2014 in Shaders Posts: 425

In my shader i am trying to define col but I keep getting syntax errors. Instead of using

lowp vec4 col = texture2D(texture,vTexCoord)* vColor;

I want to use

lowp col = vec4(1,1,1,1);

Or something to the same effect

Comments

  • IgnatzIgnatz Mod
    edited April 2014 Posts: 5,396

    @Coder - you left out "vec4" on the left hand side in your version

  • edited April 2014 Posts: 425

    @Igntaz I tried using

    lowp vec4 col = vec4(1,1,1,1);

    But it just says that col hasn't been declared

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Coder - I assume you remembered the semi-colon on the end of the line?

  • Posts: 425

    @Ignatz yes sorry i forgot to put that in my post

  • Posts: 2,161

    Try

    lowp vec4 col = vec4(1.,1.,1.,1.);
    

    In the shader code then there's no automatic conversion between floats and ints, so 1 and 1. are different.

  • Posts: 425

    Thanks it works now

Sign In or Register to comment.