Jump to content
  • Advertisement
Sign in to follow this  
Montynis

BasicEffect

This topic is 3704 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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!