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\$ 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.