-
"If" with Vertex shader
If i have understood the documentations, it seems to be impossible to use "if","else"... with the ARB_Vertex_program extension (?)
Do i have to use GLSL if i want to use "if" in a vertex shader ? (using ARB extension only)
Thanks.
-
Super Moderator
OpenGL Guru
Re: "If" with Vertex shader
Often you can multiply the result of a code segment by 1 or 0 where that operand is derived from the parameter you want to branch on.
-
Re: "If" with Vertex shader
-
Advanced Member
Frequent Contributor
Re: "If" with Vertex shader
Yes, when it comes about math you can emulate branching by using SGE and SLT instructions combined with things like x*1=x and x*0=0.
And if you want more advanced branching, you can take a look at the GL_NV_vertex_program2_option (only supported on NVIDIA hardware for now).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules