0
\$\begingroup\$

Are there any reasons or situations one would use in their shader float(1) over just 1.0 ?

\$\endgroup\$
2
  • \$\begingroup\$ to be a rebel! I'm pretty sure that's not even valid it just compiles on reasonable drivers. \$\endgroup\$
    – MickLH
    Commented 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\$ Commented Oct 14, 2013 at 15:51

1 Answer 1

0
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .