my first shader in WebGL
Posted
by Diego
on Stack Overflow
See other posts from Stack Overflow
or by Diego
Published on 2010-06-17T20:07:53Z
Indexed on
2010/06/17
20:13 UTC
Read the original article
Hit count: 252
Hello,
I am writing my first shader in WebGL. I was wondering if the GLSL language has any way to evaluate if an attribute or a uniform is null. According to the specs it does not support to do something like
if (attributeX) {
dothis();
}
else{
dothat():
}
And I think it would be a waste to write a bool attribute for each of these cases would be a waste.
Another question: what happen during rendering when you don't pass along the uniforms or attribs to the shader?
Thanks!
© Stack Overflow or respective owner