Mark Sachs (ksleet) wrote,
Mark Sachs
ksleet

  • Mood:
  • Music:

Dude... you got to FLIP it. TURN-WAYS.

After a giant hassle I managed to un-break the lighting in my engine, so I can finally show you rings.



See? Rings.

I'm not pleased as I'm not confident in my understanding of why the fix works, though. Since I'm sending my own arbitrary light position into the shader instead of using the built-in OpenGL constants, and I'm transforming it into modelview space myself, I apparently need to apply that transformation before setting the model transformation matrices in OpenGL (the glRotate, glTransform, et cetera, operations used to place the model I'm rendering at its location in the world.) Why that is, is not clear. It doesn't help that there are virtually no properly thorough examples around of how to do lighting in GLSL when you're not using the built-in constants; or rather, there are thousands of forum posts from people saying "use your own uniform variable" and none explaining the hidden gotchas involved. In other words, standard operating procedure for the Internet.

Oh well. At any rate, that's that. I'm not actually certain what I was going to work on next. Maybe I should work on playing Ace Attorney and sleeping all weekend.
Tags: neon galaxy
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 7 comments