问题
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.
回答1:
Have you tried changing the float precision in the shader?
precision highp float;
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.
来源:https://stackoverflow.com/questions/36381785/opengl-es-issue-while-rendering-close-by-objects