Results 1 to 3 of 3

Thread: only lighting the front of an object

  1. #1

    only lighting the front of an object

    I have a spot light orbiting a sphere.
    The problem is, the back of the sphere behind the light is being lit too. It happens on the demo posted here a while ago http://www.opengl.org/discussion_boa...ML/004796.html
    Is there a way to stop this?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    365

    Re: only lighting the front of an object

    If you draw a small sphere to simulate the shape and position of the light source, is it where you thought it would be?

  3. #3

    Re: only lighting the front of an object

    The light source is in the right place, and shinging in the correct direction; with a narrow beam, the front side of the sphere has a spot lit correctly, but it's as though the beam is continuing through the sphere to light the far side as well.
    After experimentation, it seems that I have to set the lights ambient colour to zero to stop it.

Similar Threads

  1. 2D texture in front of 3D object
    By Ellusion in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 01-22-2016, 02:47 PM
  2. A fly-through camera with an object in front?
    By MastahYodah in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 05-04-2009, 03:06 PM
  3. Replies: 6
    Last Post: 04-26-2005, 04:57 PM
  4. object staying in front of camera, please help
    By Dark_Streak in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-27-2002, 10:09 AM
  5. lighting back and front
    By phanie in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-06-2001, 07:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean