Are there any reasons or situations one would use in their shader float(1) over just 1.0 ?
\$\begingroup\$
\$\endgroup\$
2
-
\$\begingroup\$ to be a rebel! I'm pretty sure that's not even valid it just compiles on reasonable drivers. \$\endgroup\$MickLH– MickLH2013-10-14 10:30:28 +00:00Commented Oct 14, 2013 at 10:30
-
\$\begingroup\$ Why wouldn't it be valid? Section 5.4.1 of the GLSL spec says nothing about constants, any scalar value should work. \$\endgroup\$Robert Rouhani– Robert Rouhani2013-10-14 15:51:22 +00:00Commented Oct 14, 2013 at 15:51
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
Not really, any decent compiler will evaluate float(1) to 1.0 at compile time. The only thing you're doing by using float(1) is making your shader a little less readable.