Results 1 to 4 of 4

Thread: Shaders, Depth testing and lighting problems

  1. #1

    Shaders, Depth testing and lighting problems

    Hi all,
    I have yet another question lol,

    I have built in support shaders as i mentioned before, but for some reason the animation i have in the shaders will not work while GL_LIGHTING is enabled, the animation that im using at the most uses the alpha of the texture.. Does GL_LIGHTING disable the use of the alpha channel?

    Secondly, i change the Depth func to GL_NEVER or GL_EQUAL in the shaders, and then change it back GL_LESS but i always seem to be able to see the shader on the other side of the wall in my world editor, i have tried to change this to all the values GL_EQUAL, GL_LEQUAL, GL_GREATER, etc but i cant get rid of the effect, iv tried turning of DL_DEPTH_TEST and this of course doesnt help much at all, i have included a screenshot of whats happening..

    I am probably missing something really dumb but i cant seem to get rid of it unless i remove the DepthFunc from the shader, and then the shader doesnt look right lol

    Thanx for any help
    M109uk
    <br />--------------------------------------------------------
    <br />www.pulse-soft.oneuk.com

  2. #2

    Shaders, Depth testing and lighting problems

    As lighting is part of the fixed function pipeline you?_Tll have to do your own lighting calculations in the shader. And why would you want to use alpha testing in that way, just draw you?_Tre opaque geometry front to back, and then transparent geometry back to front.

  3. #3

    Shaders, Depth testing and lighting problems

    Ok, the lighting isnt really a problem since it is only used in the editor when a lightsource is selected.

    Im not quite sure what you mean, i use the alpha value in glColor4f to set the blink state of a section of a shader in my case its the light part of the shader. I have some how solved the problem, but all i did was change something of the shader in my shader editor, but i cant remember what i was doing, and i cant get the problem back lol :roll:

    Thanx for your help..
    M109uk
    <br />--------------------------------------------------------
    <br />www.pulse-soft.oneuk.com

  4. #4

    Shaders, Depth testing and lighting problems

    Urgh sorry, I took a look at you?_Tre post in a hurry and somehow managed to get the idea you were talking about alpha func instead of depth func.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL