Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large Area SkyDome Error #21

Open
GoogleCodeExporter opened this issue Mar 16, 2015 · 3 comments
Open

Large Area SkyDome Error #21

GoogleCodeExporter opened this issue Mar 16, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What is the expected output? What do you see instead?
My terrains are very large scale... about 65k x 65k and more. I start off
the scenario very far from the origin.... lets say about (35000,35000,50)... 
When osgOcean initializes, the sky dome and the sky shaders dont seem to
work....its like everything that has to do with the sky dome gets turned
off, and all i see is a black sky. When i start to move around.... after
some time...usually after i look up...it suddenly turns on and after that
works just fine...

What version of the product are you using? On what operating system?
osgOcean 1.0.1
winXP 
vs2008

Original issue reported on code.google.com by [email protected] on 27 Jan 2010 at 5:36

@GoogleCodeExporter
Copy link
Author

I suspect this is something to do with the camera tracking on the sky dome, I 
believe 
there was a similar problem with the ocean surface tracking a while back.

I'll have a look at this. If you need an urgent fix, take a look at the 
callback 
attached to the skydome.

Kim

Original comment by [email protected] on 27 Jan 2010 at 9:21

@GoogleCodeExporter
Copy link
Author

Hey Kim, 

Don't know if you looked at this or not.....but i found out that it has 
something to
do with culling. 
As i said before, the dome comes back when I move around.....well...its more 
when the
database origin gets inside the cameras culling volume. Also, i can see the 
dome snap
back into place above me if i start my prog very far off looking at the 
origin....if
im looking away from the origin, there will be no sky until i turn to it.....
Also if you play around with various camera culling modes....the sky will work 
with
some...and not with others....  

MS 

Original comment by [email protected] on 16 Mar 2010 at 11:57

@GoogleCodeExporter
Copy link
Author

I've seen the same problem in my application. You can reproduce that issue in 
oceanExample by setting the camera far off the origin (for example "osgOcean 
--initialCameraPosition -10400 -10100 120"). In this case the cull stage sees 
the OceanScene and the SkyDome outside of viewing frustum. Those nodes get 
rejected after computing the bounding sphere. Therefore the cull callbacks are 
never called and the ocean and sky stays at origin.

I've done a crude workaround. I apply a custom bounding sphere callback to both 
the OceanScene and the SkyDome. It returns a huge bounding sphere:
struct BoundingSphereCallbackHack : public 
osg::Node::ComputeBoundingSphereCallback
{
    virtual osg::BoundingSphere computeBound(const osg::Node &) const
    {
        return osg::BoundingSphere(osg::Vec3(0.0, 0.0, 0.0), 1.0e10);
    }
};

However I don't like this hack. I guess there is a better way achieve this by 
customizing the cull traversal. I don't know much of the details of the cull 
stage, so any comments are welcome.

Jean-Claude


Original comment by [email protected] on 21 Dec 2011 at 4:27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant