Timeline for GLSL: How do I cast a float to an int?
Current License: CC BY-SA 2.5
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 7, 2019 at 20:34 | comment | added | lesolorzanov | How cna I convert this to const so that I can sample an array? | |
| Apr 22, 2018 at 5:29 | comment | added | Ricket | Sorry, I have absolutely no idea what that forum post from 7 years ago was, and archive.org seems to be missing it. Not gonna update the link. But I'll leave it in case some other web archaeologist is more skilled than me. | |
| Apr 20, 2018 at 18:49 | comment | added | Bora | Thanks, it also worked in my case. Could you update the reference that you have put, since the page doesn't exist? | |
| Jul 5, 2015 at 6:11 | comment | added | Léon Pelletier | Is highp important here? (On an Integer) | |
| Feb 18, 2011 at 3:05 | comment | added | Ricket | @Joe That's an interesting fact that I never thought about, and I just confirmed it with a Java test case. | |
| Feb 17, 2011 at 20:19 | comment | added | user744 | In most languages the rounding mode is truncate / round-to-zero, which is equivalent to floor for positive numbers but not negative numbers. I don't remember if this applies to GLSL, but I'd be surprised if it doesn't. | |
| Feb 17, 2011 at 20:03 | comment | added | Ricket | Also note that casting a float to an int automatically floors it (at least in any implementation I've ever seen) so your call to floor should be unnecessary. | |
| Feb 17, 2011 at 19:10 | vote | accept | dugla | ||
| Feb 17, 2011 at 18:47 | history | answered | Ricket | CC BY-SA 2.5 |