Sign in to follow this  

BasicEffect

This topic is 3489 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 am creating a simple 3D representation of Solar system. When I draw a planet I set: effect.EnableDefaultLighting(); effect.DirectionalLight0.Enabled = false; So I get a nice sphere whose one side is illuminated and the other is not. When I draw the Sun, I don't do any operations (don't add code lines which are shown above) in order to get a sphere which is illuminated from all sides. But the result is that I get a sphere whose one side is illuminated and the other is not (like a planet). Maybe I should use effect.Clone() but I have no idea here. Please help me and provide a little code snippet how to solve this problem. Thanks in advance.

Share this post


Link to post
Share on other sites

You could try turning off the lighting for the sun like this:


effect.LightingEnabled = false;


This should make the effect forego any lighting calculations, making it seem as if the object is lit equally from all sides (which should be appropriate for the sun).

Share this post


Link to post
Share on other sites
Thanks for answer, remigius.

I have tried your suggestion, but it doesn't solve the problem.

I think the main problem is that both models reference to the same BasicEffect, so changing it for one changes it for all.

Share this post


Link to post
Share on other sites

This topic is 3489 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.

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