• 0

[OpenGL, C++] Turn off ambient light?


Question

I am creating a solar system for a computer graphics project and I was wondering if anyone knew how to turn off ambient lighting? I have created a glowing sphere for the sun (for now) and I want it to be the only source of light. I think I may have done it, but I don't see any shadows from where the light is not reaching. Should I be able to see shadows or do I need to do some more work to make shadows appear? Thanks in advance for any help.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

There are not lights in opengl aside from the ones that you yourself create. So if you didnt specifically create ambient lighting, then there will be none in your scene.

As for shadows, opengl does not do shadows - this is something you must implement yourself. Doing shadows is one of the hardest things to do well in graphics programming, so be prepared to spend some time learning how to do it. Doing a google search on "opengl shadows" should give you some decent tutorials to follow.

Link to comment
Share on other sites

  • 0
when you get done with your solar system can you post it.. i'd really like to see it

Sure, but I don't know how good it will be. It is only an eight week class and we only need to implement certain things, beyond that we will just do as much as we can.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.