I’m fairly unexperienced in shader programming and I can’t really grasp how could I transform my OrthographicCamera pixel coors
to shader coords. I know there are some matrices, modelview, eye coord and a few more but I don’t know how to make them work.
Made a picture quickly to help me xeplain my problem better.
- Black rectangle is the whole 2d scene (map, since it is a platformer game) with 10000 x 4000 size.
- Red rectangle is the Orthograpic camera centered at the Gray moving box which is the player.
- Orange circles are static light sources.
http://s29.postimg.org/xa1czmq47/help.jpg
Basicly the only thing done with shaders here is the light sources wich lights normal mapped textures using the Lambertian Illumination Model.
The light sources’ positions are uniform values and they are all static, so they stay at the position they were created until they are destroyed.
My reals question is how could I pass the light’s position to the shader and the transform it inside the shader so they won’t follow the camera but they stay where they should.
(no matter what I tried the lights were following the camera as I moved or they were appearing at wrong positions)