问题描述
我开发使用OpenGL ES 2.0和Java在Android ICS 2D游戏。我想使用的照明系统要做到这一点我呈现所有的帧缓冲,而在另一个场景中的灯光,意图利用片段着色器重新创建的Photoshop叠加效果融入他们。
I am developing a 2d game on Android ICS using OpenGL es 2.0 and java. I am trying to use a lighting system and to do that I render all the lights on a framebuffer and the scene on another, with the intent to blend them using the fragment shader to recreate photoshop overlay effect.
我遇到一个问题,虽然,它似乎FBO不与多重采样工作,所以如果我在FBO画我得到的锯齿线。我注意到,有使用IOS人的解决方案,但我没有找到任何的Android。
有没有更好的方式来实现什么,我想比我approching这个问题的方法呢?请原谅,我,我有点新的OpenGL的
I encountered a problem though, it seems that the fbo doesn't work with multisampling, so if I draw on the fbo I get jagged lines. I noticed that there is a solution for people using ios, but I didn't find anything on Android.Is there a better way to achieve what I am trying to do than the way I am approching this problem? Forgive, me I am a bit new to opengl.
非常感谢你。
推荐答案
多重采样(当你创建OpenGL上下文其中设置)仅适用于默认的帧缓冲。
Multisampling (which you set when you create OpenGL context) works only on default framebuffer.
要具有多重采样FBO上必须使用这些扩展名之一:
To have multisampling on FBO you must use one of these extensions:
另外,您可以使用像实现全屏抗锯齿。这是PC控制台的版本是pretty快速甚至是移动设备。
Alternatively you can use something like FXAA to achieve full screen anti-aliasing. It's "PC console" version is pretty quick even for mobile devices.
这篇关于在Android上使用的OpenGL ES 2.0,在一个帧缓冲区渲染时,有没有办法preserve多重采样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!