Howdy, Stranger!

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

Shader strange/cool bug?

edited August 2013 in Shaders Posts: 25

I was playing around with shaders and found this strange bug(?) when using empty variables


// // A basic fragment shader // //Default precision qualifier precision highp float; //This represents the current texture on the mesh uniform lowp sampler2D texture; //The interpolated vertex color for this fragment varying lowp vec4 vColor; //The interpolated texture coordinate for this fragment varying highp vec2 vTexCoord; void main() { //Sample the texture at the interpolated coordinate lowp vec4 col = texture2D( texture, vTexCoord ) * vColor; lowp vec3 shade; //Set the output color to the texture color gl_FragColor = vec4(col.rgb * shade, col.a); }

Comments

  • edited August 2013 Posts: 1,976

    Can you explain what it does? I'm too lazy to paste it. :P

    Maybe a picture of video?

  • Posts: 175

    Interesting effect, seems to cause the colours to become distorted. It looks like the precision has some bearing over it, changing shade from lowpto highp produces a more obvious result (colour is removed and it becomes black) it also looks awesome using add or subtract instead of multiply but why it happens I don't know :D

  • Posts: 1,976

    Okay, wow, that is cool. I think that'd be an OpenGL bug though, not Codea.

Sign In or Register to comment.