本文介绍了Opengl透明度问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 Hello Everyone, void mainRender() { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderSTLs(); glEnable(GL_ALPHA_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); renderPoints(); } 我需要实现相互透明度。如果点的alpha值改变了,它应该显示它后面的stls。在上面的例子中它是成功的,因为stls在点之前呈现,因此该点可以与stls混合。但是,如果我更改stls点的透明度值,则不会通过它显示。我猜是因为在渲染之前没有任何东西可以与stls融合。 我需要两个案例才能工作。虽然通过首先调用renderPoints()更改render函数调用然后renderSTLs()将使stl transprency工作。 点和stls的透明度如何工作同时。我陷入了这个问题。请有人帮忙。 谢谢, Arpan 解决方案 Hello Everyone,void mainRender(){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderSTLs(); glEnable(GL_ALPHA_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); renderPoints();}I need to achieve mutual transparency. if alpha value for points is changed it should show the stls behind it. In the above case it is a success because the stls is rendered before the points, so the point can blend with stls. But if I Change the transparency value for stls points are not shown through it. I guess because there is nothing to blend with for stls before it is render.I need both the cases to work. though changing the render function call by first calling renderPoints() and then renderSTLs() will make the stl transprency work.how can both the transparency of points and stls works at the same time. I am stuck in this problem. Please somebody help.Thank you,Arpan 解决方案 这篇关于Opengl透明度问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-09 17:48