Jump to content

  • Log In with Google      Sign In   
  • Create Account

Request for Advise - Smoothing Line Edges and Otherwise improving Quality ...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 tmason   Members   -  Reputation: 296

Like
1Likes
Like

Posted 16 May 2014 - 06:05 AM

Hello,

So I finally got my project on the Oculus Rift! It was a good feeling but now it's a matter of drastically improving display quality.

One of the most striking things I have noticed is that line edges are not really smooth at all. Below is a picture.

How can I have crisp (or crisper) edges?

Thank you for your time.

 

Line_Smoothing_Help.png



Sponsor:

#2 swiftcoder   Senior Moderators   -  Reputation: 10364

Like
1Likes
Like

Posted 16 May 2014 - 08:53 AM

Looks like you need some form of anti-aliasing.

Initially, I'd try turning on MSAA, assuming that your hardware/driver support multisample framebuffers (recent cards/drivers should be fine). If that is insufficient (or doesn't work), there are a variety of more complicated/nuanced approaches to anti-aliasing which would be worth looking into.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#3 tmason   Members   -  Reputation: 296

Like
0Likes
Like

Posted 16 May 2014 - 09:00 AM

Looks like you need some form of anti-aliasing.

Initially, I'd try turning on MSAA, assuming that your hardware/driver support multisample framebuffers (recent cards/drivers should be fine). If that is insufficient (or doesn't work), there are a variety of more complicated/nuanced approaches to anti-aliasing which would be worth looking into.

 

Thank you so much for your quick reply.

 

The MSAA hardware anti-aliasing isn't something easy to implement, is it?

 

Here is my code now for my framebuffer:

glGenFramebuffers(1, &g_OculusRiftFrameBufferObject_ID);
	glBindFramebuffer(GL_FRAMEBUFFER, g_OculusRiftFrameBufferObject_ID);
	glGenTextures(1, &g_OculusRiftTexture_ID);
	glBindTexture(GL_TEXTURE_2D, g_OculusRiftTexture_ID);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, l_TextureSize.w, l_TextureSize.h, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
	glGenRenderbuffers(1, &g_OculusRiftDepthBufferObject_ID);
	glBindRenderbuffer(GL_RENDERBUFFER, g_OculusRiftDepthBufferObject_ID);
	glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, l_TextureSize.w, l_TextureSize.h);
	glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, g_OculusRiftDepthBufferObject_ID);
	glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, g_OculusRiftTexture_ID, 0);

	GLenum l_GLDrawBuffers[1] = { GL_COLOR_ATTACHMENT0 };
	glDrawBuffers(1, l_GLDrawBuffers); // "1" is the size of DrawBuffers

	g_DrawBufferStatusCheck_ENUM = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);

	if (g_DrawBufferStatusCheck_ENUM != GL_FRAMEBUFFER_COMPLETE)
	{
		glBindRenderbuffer(GL_RENDERBUFFER, 0);
		glBindTexture(GL_TEXTURE_2D, 0);
		glBindFramebuffer(GL_FRAMEBUFFER, 0);
		return false;
	}
	else
	{}


#4 swiftcoder   Senior Moderators   -  Reputation: 10364

Like
1Likes
Like

Posted 16 May 2014 - 09:27 AM

GL_EXT_framebuffer_multisample. The extension was moved into the Core library of OpenGL from version 3.0 onwards.


Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#5 tmason   Members   -  Reputation: 296

Like
0Likes
Like

Posted 17 May 2014 - 06:01 AM

GL_EXT_framebuffer_multisample. The extension was moved into the Core library of OpenGL from version 3.0 onwards.


Ok, thank you. I will give this a shot.

#6 h3xl3r   Members   -  Reputation: 173

Like
2Likes
Like

Posted 18 May 2014 - 12:24 AM

You could also give FXAA a try, pure post-processing-based AA in a shader:
http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/

#7 tmason   Members   -  Reputation: 296

Like
1Likes
Like

Posted 18 May 2014 - 03:43 PM

You could also give FXAA a try, pure post-processing-based AA in a shader:
http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/

 

Thank you, I am giving both a try; I ran into a bit of trouble but I will elaborate in a separate post.

 

Thanks again.



#8 tmason   Members   -  Reputation: 296

Like
2Likes
Like

Posted 18 May 2014 - 04:21 PM

Thanks for the help folks!

 

Success:

 

Line_Smoothing_Success.png



#9 swiftcoder   Senior Moderators   -  Reputation: 10364

Like
0Likes
Like

Posted 18 May 2014 - 08:02 PM

That looks much better. Is that FXAA or multisample?

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#10 tmason   Members   -  Reputation: 296

Like
1Likes
Like

Posted 19 May 2014 - 03:32 AM

That looks much better. Is that FXAA or multisample?

 

4x Multisample...






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS