Sign in to follow this  
iEat_Babies

[XNA 4.0] Sky sphere

Recommended Posts

I have a sky sphere to surround my 3d world. It will always be centered at the camera's location so the sky is "endless". Therefore the camera is inside the sphere.
However, the only way I can get it to render properly is if I change "CullMode.CullCounterClockwiseFace" to "CullMode.None" when I draw the sky sphere, then back again once it has been drawn. Is there a way to fix this other than to change the cull mode?

Share this post


Link to post
Share on other sites
When you're building your sphere mesh, invert the order of each faces' vertices. That way the visible face will be inside the sphere instead of outside.

Share this post


Link to post
Share on other sites
[quote name='Flimflam' timestamp='1310349245' post='4833554']
When you're building your sphere mesh, invert the order of each faces' vertices. That way the visible face will be inside the sphere instead of outside.
[/quote]
Ok that makes complete sense..... but how?
I'm sorry but I'm completely new to this. I am completely new to Maya (2012), that is what I am using. Could you please give me some direction on how to do that? All that I did was create a sphere in Maya and export it as a .fbx and import it.


Thanks!

Share this post


Link to post
Share on other sites
[quote name='iEat_Babies' timestamp='1310357485' post='4833579']
Ok that makes complete sense..... but how?
I'm sorry but I'm completely new to this. I am completely new to Maya (2012), that is what I am using. Could you please give me some direction on how to do that? All that I did was create a sphere in Maya and export it as a .fbx and import it.Thanks!
[/quote]

[url="http://www.google.com/search?q=maya+2012+invert+normals"]http://www.google.com/search?q=maya+2012+invert+normals[/url]

Share this post


Link to post
Share on other sites
[font="Arial"][size="2"][quote name='EJH' timestamp='1310398953' post='4833779']
[quote name='iEat_Babies' timestamp='1310357485' post='4833579']
Ok that makes complete sense..... but how?
I'm sorry but I'm completely new to this. I am completely new to Maya (2012), that is what I am using. Could you please give me some direction on how to do that? All that I did was create a sphere in Maya and export it as a .fbx and import it.Thanks!
[/quote]

[url="http://www.google.com/search?q=maya+2012+invert+normals"]http://www.google.co...+invert+normals[/url]
[/quote]
Is inverting the normals the same as[color=#1C2837] inverting the order of e[/color][color=#1C2837]ach faces' vertices?[/color][/size][/font]

Share this post


Link to post
Share on other sites
[quote name='iEat_Babies' timestamp='1310401070' post='4833795']
[font="Arial"][size="2"][quote name='EJH' timestamp='1310398953' post='4833779']
[quote name='iEat_Babies' timestamp='1310357485' post='4833579']
Ok that makes complete sense..... but how?
I'm sorry but I'm completely new to this. I am completely new to Maya (2012), that is what I am using. Could you please give me some direction on how to do that? All that I did was create a sphere in Maya and export it as a .fbx and import it.Thanks!
[/quote]

[url="http://www.google.com/search?q=maya+2012+invert+normals"]http://www.google.co...+invert+normals[/url]
[/quote]
Is inverting the normals the same as[color="#1C2837"] inverting the order of e[/color][color="#1C2837"]ach faces' vertices?[/color][/size][/font]
[/quote]

It's not the same thing, but it results in the same thing, namely the inversion of the plane normal. It has to do with the way the normal of a triangle is calculated in the GPU.

Share this post


Link to post
Share on other sites
You should be able to change the culling to front facing so that the sphere will not be culled. This way you dont have to worry about changing the winding order of the triangles.

But, just so you are not confused, inverting the normals will not allow you to use the cull setting you wish to render the skysphere correctly.

The easiest change is the one I just suggested.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this