Results 1 to 4 of 4

Thread: Lighting Problems

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2019
    Posts
    3

    Lighting Problems

    Shader code

    I have two problems with the shader code. I'm trying to get lighting to work and:
    1. Parts of the bunny I'm using the shader on are transparent.
    2. The lighting is static.

    This is kinda new for me so I don't really know how to debug this. Please ask anything, Thanks.
    Video

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2014
    Posts
    109
    Do the following:

    Set your clear color to red.

    If you see any red inside the model...
    ... disable blending or set the 4.th parameter of the output fragment to 1. If that helps, check your alpha values of the model and the resulting alpha values of all involved transformations. if that does not help...
    ... disable face culling. If that helps, your triangles have different winding orders and you need to fix it. If it does not help
    ... you are probably not drawing all triangles correctly, which can have different reasons

    If you DON't see any red in the model...
    ... enable depth testing. If that does not help...
    ... disable face culling. If that helps, your triangles have different winding orders and you need to fix it. If that does not help...
    ... you are probably not drawing all triangles correctly, which can have different reasons.

    My bet is that you didn't enable depth testing since as far as I noticed the "transparency" disappears when there are no overlapping geometries.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2019
    Posts
    3
    Depth testing was the problem for the transparent thing, I had forgotten it after setting up a layer stack. However, the lighting problem still persists, it doesn't change as the bunny moves. What's wrong with my shader code?

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2019
    Posts
    3
    Nevermind, fixed it.

Similar Threads

  1. lighting problems
    By Lurking in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 12-31-2003, 12:30 PM
  2. Lighting problems
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-20-2003, 03:26 AM
  3. Lighting Problems
    By wpcmmx in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-03-2001, 11:34 AM
  4. Two Problems with Lighting
    By B. Jacob in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-10-2001, 03:29 AM
  5. Problems with lighting
    By mcbastian in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-19-2001, 03:50 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