python-moderngl

How to enable Anti-aliasing in Moderngl EGL backend?

泪湿孤枕 提交于 2020-05-30 19:19:32
问题 This code renders a colored triangle when there is no anti-aliasing ( samples=0 ). But when I turn on anti-aliasing ( samples=1...32 ) it can't render anything. How to make it work with anti-aliasing? Perhaps I cannot read pixels from multisample fbos or textures directly but I don't know how to fix that. import numpy as np from PIL import Image import moderngl ctx = moderngl.create_standalone_context(backend='egl') fbo = ctx.framebuffer( color_attachments=ctx.texture((512, 512), 4, samples=2

How to enable Anti-aliasing in Moderngl EGL backend?

◇◆丶佛笑我妖孽 提交于 2020-05-30 19:19:11
问题 This code renders a colored triangle when there is no anti-aliasing ( samples=0 ). But when I turn on anti-aliasing ( samples=1...32 ) it can't render anything. How to make it work with anti-aliasing? Perhaps I cannot read pixels from multisample fbos or textures directly but I don't know how to fix that. import numpy as np from PIL import Image import moderngl ctx = moderngl.create_standalone_context(backend='egl') fbo = ctx.framebuffer( color_attachments=ctx.texture((512, 512), 4, samples=2

How to add a depth buffer in Moderngl EGL backend?

时光怂恿深爱的人放手 提交于 2020-05-15 08:08:57
问题 This code renders a colored triangle with anti-aliasing ( samples=8 ) when a depth buffer line depth_attachment=ctx.depth_texture((512, 512), samples=8) is commented. But when I add a depth buffer it returns a GL error at the binding fbo_msaa framebuffer to GL_READ_FRAMEBUFFER . Do you know how to fix this error? import numpy as np from PIL import Image import moderngl import OpenGL.GL as gl ctx = moderngl.create_standalone_context(backend='egl') fbo = ctx.framebuffer( color_attachments=ctx