Page 1 of 1

Solutions for some problems

Posted: 12.10.2009, 13:57
by duds26
Seen a few idea's, solutions for a few Celestia problems:

links: http://www.slideshare.net/Mark_Kilgard/opengl-32-and-more

1) Problem: body disappearing and flickering when going very close to it
Example: Going to earth to a few tenths or hundredths of a meter, you will notice the earth will flicker and disappear
(I get it starting from around 0,7-0,2 meters).
Solution: Using the new OpenGL Depth Clamp within an if statement (for opengl versions) :

Code: Select all

if (gl_FragCoord.z == 0)
    gl_FragColor = vec4(0,0,0,1);

Presentation: Slide 50-53

2)Problem: Cube map seams, was discussed but aborted
Example: not applicable, cube maps were never implemented
Solution: Using the new OpenGL seamless cube map thing within an if statement (for opengl versions):

Code: Select all

glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS)

Presentation: Slide 54-55

I'll started and I'll continued with this:

3)Problem: Aliasing
Example: goto earth, zoom in/out until the earth is a few pixels across (20-40), move so that the body of the earth intersects the sun. Look closely to see the jaggies.
Look at smaller planet's edge in this image, first switch to full resolution to see it good: http://www.shatters.net/forum/download/file.php?id=1734&mode=view
Another image: http://www.shatters.net/forum/download/file.php?id=1706&mode=view
Solution: Use the new OpenGL multisample stuff
Links:

Scroll to bottom to see a good image comparison, unfortunately in Direct X 10, all other links are about OpenGL but the technique is roughly the same:
http://drilian.com/category/development/graphics/deferred-shading/

http://dabroz.scythe.pl/tag/OpenGL

http://dabroz.scythe.pl/2009/09/15/deferred-global-illumination

http://www.geeks3d.com/20090917/opengl-3-2-explicit-multisample-demo/

http://docs.google.com/gview?a=v&q=cache:nmIRUeNetvwJ:www.ii.uj.edu.pl/~filipek/tutorials/pracownia_letni/podstawy1/GDC2002_Multisample.pdf+nvidia+true+multisample+texture&hl=nl&gl=be&sig=AFQjCNFILfTIlSB1z37qVT0ltwn4sGVAzA

Re: Solutions for some problems

Posted: 27.10.2009, 21:11
by chris
duds26 wrote:Seen a few idea's, solutions for a few Celestia problems:

links: http://www.slideshare.net/Mark_Kilgard/opengl-32-and-more

1) Problem: body disappearing and flickering when going very close to it
Example: Going to earth to a few tenths or hundredths of a meter, you will notice the earth will flicker and disappear
(I get it starting from around 0,7-0,2 meters).
Solution: Using the new OpenGL Depth Clamp within an if statement (for opengl versions) :

Code: Select all

if (gl_FragCoord.z == 0)
    gl_FragColor = vec4(0,0,0,1);


This a useful little OpenGL extension, and it's worthwhile experimenting with it. It's not a complete solution though--objects in front of the near clip plane won't get depth sorted. (NVIDIA has actually supported this extension since the GeForce FX.)

2)Problem: Cube map seams, was discussed but aborted
Example: not applicable, cube maps were never implemented
Solution: Using the new OpenGL seamless cube map thing within an if statement (for opengl versions):

Code: Select all

glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS)

Presentation: Slide 54-55

Celestia doesn't currently use cube maps for anything other than per-pixel normalization in pre-OpenGL 2.0 render paths. But, that will change in the future: cube maps are very useful for environment maps, and possibly for planet textures. The seamless cube map extension will be useful here. It's very easy to use: just enable it and the seams are gone!

I'll started and I'll continued with this:

3)Problem: Aliasing
Example: goto earth, zoom in/out until the earth is a few pixels across (20-40), move so that the body of the earth intersects the sun. Look closely to see the jaggies.
Look at smaller planet's edge in this image, first switch to full resolution to see it good: http://www.shatters.net/forum/download/file.php?id=1734&mode=view
Another image: http://www.shatters.net/forum/download/file.php?id=1706&mode=view
Solution: Use the new OpenGL multisample stuff
Links:

Celestia has been able to use multisample anti-aliasing for a long time. Edit celestia.cfg and uncomment the 'AntialiasingSamples 4' line. If you've got a modern and fast graphics card, you can set the value of AntialiasingSamples to 8 for even better quality. In the next major release, you'll be able to enable anti-aliasing from the Celestia GUI.

--Chris

Re: Solutions for some problems

Posted: 30.10.2009, 18:09
by duds26
Thanks for answering.

1) Not a complete solution? Damned!

3) About aliasing:
What you are referring too is supersampling, I meant per-pixel true multi-sample images.
The differences are discussed best in the latest, most bottom link of my original post.

Re: Solutions for some problems

Posted: 30.10.2009, 20:20
by chris
duds26 wrote:3) About aliasing:
What you are referring too is supersampling, I meant per-pixel true multi-sample images.
The differences are discussed best in the latest, most bottom link of my original post.

No: Celestia is using multisampling now, not supersampling.

The OpenGL pages that you linked to describe the new explicit multisample feature available in recent NVIDIA drivers. Celestia doesn't use these new OpenGL extensions, but you can be sure that it's still using multisampling. Explicit multisampling doesn't offer a lot of benefit to Celestia; it won't produce edges that are any smoother than what you see with conventional multisample anti-aliasing.

--Chris