Reinterpret bits cast float ->int in GLSL

馋奶兔 提交于 2020-05-16 05:02:46

问题


I need the GLSL equivalent of

float f; 
int   i = *(int *)&f;

I know that there is floatBitsToInt() , but unfortunately it's in 3.3 GL version and upper. I need it for 3.0.

Any thoughts?

来源:https://stackoverflow.com/questions/48025910/reinterpret-bits-cast-float-int-in-glsl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!