Opengl ES,在按对象渲染时发出 [英] Opengl ES, issue while rendering close by objects

查看:68
本文介绍了Opengl ES,在按对象渲染时发出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Android上使用opengl es.我有一个3D人形模型,可以在上面放置一个发型,这是另一个3D模型.在进行渲染时,我发现在两个对象非常靠近/重合的区域(头发区域),渲染是不合适的,实际上,我在不同的移动设备上得到了不同的结果.我怀疑这是Z战.是否存在一些使用opengl正确渲染对象附近的解决方案,该解决方案将在所有移动设备上保持一致.我已附上快照以供参考.

I am working with opengl es on android. I have a 3d humanoid model on which i can put a hairstyle which is another 3d model. While rendering i could find that on the area where the two objects are very close/coincides (the head-hair region) the rendering is not proper, in fact i get different results on different mobile devices. I doubt it is z-fighting. Are there some solution for rendering close by objects properly with opengl es which will be consistent across all mobile devices. I have attached a snapshot for reference.

在这里,我有一个面部模型,上面放置了一个头发模型,但是我没有将头发显示在头顶上,而是得到了这种渲染.

Here i have a face model on which i have placed a hair model but instead of showing the hair on top of the head, i get this kind of rendering.

推荐答案

您是否尝试过更改着色器中的float精度?

Have you tried changing the float precision in the shader?

precision highp float; 

例如.我也注意到在不同的手机上会有不同的结果,如果在某些手机上未启用highp,则结果会很差.

for example. I've noticed different results on different handsets as well, and bad results if highp was not enabled on some.

缩放场景也可以解决问题.

Scaling the scene can also solve the issue.

这篇关于Opengl ES,在按对象渲染时发出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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