GLSL ES 2.0(用于iPhone/iPod touch/iPad)中的高浮子的精度是多少? [英] What is the precision of highp floats in GLSL ES 2.0 (for iPhone/iPod touch/iPad)?

查看:81
本文介绍了GLSL ES 2.0(用于iPhone/iPod touch/iPad)中的高浮子的精度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个着色器,理想情况下它需要28位的尾数,尽管我可以减少使用并降低性能.如何确定OpenGL ES中"highp"的精度?它可能是FP24,尾数为16位,但是我无法确定或如何询问OpenGL.有什么想法吗?

I have a shader that ideally needs 28 bits of mantissa, though I can use less and degrade performance. How can I determine what the precision of 'highp' is in OpenGL ES? It's probably an FP24, with 16bits mantissa, but I cannot figure out for sure or how to ask OpenGL. Any ideas?

推荐答案

您希望GetShaderPrecisionFormat查询着色器类型的范围和精度

You want GetShaderPrecisionFormat to query the range and precision of of shader types

int range[2], precision;
glGetShaderPrecisionFormat(GL_FRAGMENT_SHADER, GL_HIGH_FLOAT, range, &precision);

将为您提供上浮的范围和精度.

will give you the range and precision of highp float.

这篇关于GLSL ES 2.0(用于iPhone/iPod touch/iPad)中的高浮子的精度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆