multisampling

where is GL_MULTISAMPLE defined?

不羁岁月 提交于 2019-12-08 18:33:15
问题 Although I have been discouraged from reading the OpenGL redbook, I am still doing it, because it is the only book designed for beginners, and tutorials and/or documentation don't quite substitute for a book although very important. So much for justifying myself :) Now, there's an example for antialiasing using multisampling, which involved glEnable(GL_MULTISAMPLE); I am using Qt, and I get a compile error, because GL_MULTISAMPLE is an undeclared identifier. I currently see the following

Enabling antialising in SlimDX (D3D9)

二次信任 提交于 2019-12-08 13:43:05
问题 I would like to enable antialiasing when drawing triangles like on the following picture: I found a way to do it with XNA on this page but I want to do the same with SlimDX . 回答1: On SlimDX/Directx9, when you create your swapchain, use this in PresentParameters: Multisample = MultisampleType.FourSamples, MultisampleQuality = 4 Also make sure that the multisample state is on (By default it is, but never sure): device.SetRenderState(RenderState.MultisampleAntialias, true); There's of course

How to render anti-aliased image to a texture (and then write to PNG)?

强颜欢笑 提交于 2019-12-08 12:51:02
问题 I'd like to use the "render to texture" paradigm to write a .png screenshot of my OpenGL 3D rendering. I have it working without multi-sampling, but I'm struggling to get an anti-aliased image. First of all, is this possible? Second, what is the right combination of API calls? (meta third question, how can I better debug this? glCheckFramebufferStatus is clearly not enough). Here's what I'm working with: // https://stackoverflow.com/questions/7402504/multisampled-render-to-texture-in-ios

With OpenGL ES 2.0 on Android, is there a way preserve multisampling when rendering on a framebuffer?

人走茶凉 提交于 2019-12-08 05:15:46
问题 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. 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

With OpenGL ES 2.0 on Android, is there a way preserve multisampling when rendering on a framebuffer?

故事扮演 提交于 2019-12-07 20:14:28
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. 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

How to render Framebuffer Objects on multi-sampled textures?

﹥>﹥吖頭↗ 提交于 2019-12-07 06:32:23
问题 I currently have a rendering engine using multiple passes in which various parts of the image are rendered on textures, and then combined using shaders. It works, and now I would like to activate multi-sampling. I read here ( http://www.opengl.org/wiki/Framebuffer_Object_Examples#MSAA ) that, with OpenGL, you can't attach a GL_TEXTURE2D_MULTISAMPLE to a framebuffer object. It seems one way to use multi-sampling and still have access to the result as texture is to use a multi-sampled render

ResolveMultisampleFramebufferAPPLE generates INVALID_OPERATION

房东的猫 提交于 2019-12-05 23:19:44
I can't figure out, why glResolveMultisampleFramebufferAPPLE generates error 1282 (0x0502, GL_INVALID_OPERATION ). Setup code: glGenFramebuffers(1, &framebuffer); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); glGenRenderbuffers(1, &colorRenderbuffer); glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer); [context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(id<EAGLDrawable>)self.layer]; glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRenderbuffer); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth);

Issue with Android OpenGL Multisampling/Antialiasing

↘锁芯ラ 提交于 2019-12-05 22:44:20
I'm working on an app for Android allows the user to tap the screen to draw colors. I've got all of the drawing code working nicely under OpenGL (testing on Android 4.0.4, Galaxy Nexus, though I'm trying to make this backward compatible as far as possible; my SDK targets API 14 but has a minSDK of 8). The issue I've run into is with antialiasing; I want all my polygons and lines to be antialiased, but they're coming out jagged. I'm positive the Galaxy Nexus supports antialiasing (I've seen it in other apps), so I'm sure I'm doing something wrong. I've been up and down Google for over an hour

WGL: No double buffering + multi sampling = FAIL?

对着背影说爱祢 提交于 2019-12-04 07:25:07
I usually create a pixel format using wglChoosePixelFormatARB() with these arguments (among others): WGL_DOUBLE_BUFFER_ARB = GL_TRUE WGL_SAMPLE_BUFFERS_ARB = GL_TRUE WGL_SAMPLES_ARB = 4 i.e. double buffering on and x4 multisampling. This works just fine. But when I try to turn of the double buffering: WGL_DOUBLE_BUFFER_ARB = GL_FALSE WGL_SAMPLE_BUFFERS_ARB = GL_TRUE WGL_SAMPLES_ARB = 4 The call to wglChoosePixelFormatARB() fails (or rather indicates it didn't create anything) When I effectively turn multisampling off: WGL_DOUBLE_BUFFER_ARB = GL_FALSE WGL_SAMPLE_BUFFERS_ARB = GL_TRUE WGL

FBO Blitting is not working

≯℡__Kan透↙ 提交于 2019-12-04 06:38:41
I'm trying to render a multisampled scene to texture, here is the code I'm using. I'm getting a black screen. I check the fbo completeness at the end of init, and they report that both fbo's are complete. void init_rendered_FBO() { glGenFramebuffers(1,&fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); glGenTextures(1,&fbo_tex); glBindTexture(GL_TEXTURE_2D, fbo_tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE