Jump to content
  • Advertisement
Sign in to follow this  
eppo

Edge smoothing

This topic is 819 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello.
 
I'm looking to smooth out lighting discontinuities around hard edges when drawing low resolution geometry:

 
bevel_0.png


I considered blurring normals in screen space (or somehow mark hard edges), but as that seemed both expensive (large kernel sizes etc.) and prone to rendering artifacts, I opted for an edge bevel algorithm that operates on the actual geometry. Essentially, it lays out an additional strip of detail around a hard edge to secure its unwelded normal orientation, then smooths the normals of vertices on the original edge:
 

bevel_1.png
 

This properly softens the edges, but it does result in an almost x2 increment of vertices needed. (It's actually more, as lights that render shadow maps can still use the unbeveled geometry since I don't displace any vertices on the bevel).
 
I think it's a fair tradeoff, but I still wonder if this can somehow be done without creating any additional geometry. It seems to boil down to knowing the distance to the nearest hard edge from any point (pixel) on a mesh and blend normals based on that. Though I fear that would either require a lot of connectivity information tied to the mesh, or a search in screen space.
Edited by eppo

Share this post


Link to post
Share on other sites
Advertisement

K. thanks.

I should mention that many of these meshes are auto-generated in large quantities, so whatever I do has to work as a post-processor without having to manually touch up the geometry. The beveler can smooth anything you throw at it, so I'll use that method for now. 

Share this post


Link to post
Share on other sites

It also seems that your solution ended up showing some artifacts on some edges (see your bottom left cube, the one with the yellow ball).

 

Or is it due to something else (slight motion in the camera, difference in lighting maybe) ?

 

Also, I really love your images. Some people have very nice imagination, and it's needless to say (but I'll tell it anyway) that it helps a lot when wanting to show what you do. Congrats.

 

PS: sorry for the out of topic...

Share this post


Link to post
Share on other sites

It also seems that your solution ended up showing some artifacts on some edges (see your bottom left cube, the one with the yellow ball).

 

I noticed that too. Most of those irregularities are because of specular aliasing/undersampling. (More rounded corners won't actually help in that regard.)
 

 

Interesting. It's a bit hard to read, but it deals exactly with what I'm trying to do. Thanks.
 
They create a normal vector that's a blend between two weighted smoothed/unsmoothed normals based on the distance to the nearest (hard) edge.

Edited by eppo

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!