Is there a way to make fog visibility not only cover the ground, but also the sky?

28 views
Skip to first unread message

newli...@gmail.com

unread,
May 11, 2021, 10:20:57 PM5/11/21
to OpenSceneGraph Users
Is there a way to make fog visibility not only cover the ground, but also the sky?

Give me a hint

Robert Osfield

unread,
May 12, 2021, 2:56:35 AM5/12/21
to OpenSceneGraph Users
On Wed, 12 May 2021 at 03:21, newli...@gmail.com <newli...@gmail.com> wrote:
Is there a way to make fog visibility not only cover the ground, but also the sky?

The OSG itself mostly doesn't know what "ground" or "sky" is, it just works with state and geometries that it passes to OpenGL.

So what your scene graph uses to represent ground and sky is down to what you've done in your application, something you haven't specified, so we can't know unless you tell us, the best we can do is guess and give general answers.

If you've used osg::Fog to enable OpenGL fog then just decorating the Sky subgraph with an osg::StateSet that contains an osg:Fog would be sufficient, if the sky uses fixed function pipeline.  If it doesn't use a fixed function pipeline then you'll need to modify your shaders.

Cheers,
Robert.
Reply all
Reply to author
Forward
0 new messages