Rotating the OpenGL camera

Memory scanning, code injection, debugger internals and other gamemodding related discussion
Post Reply
br0ast
What is cheating?
What is cheating?
Posts: 1
Joined: Sat Aug 22, 2020 3:51 am
Reputation: 0

Rotating the OpenGL camera

Post by br0ast »

Hello

I've been hacking a very old fixed function pipeline OpenGL 1.x game. I've been intercepting opengl calls and injecting all sorts of modern opengl elements, such that I've achieved new lighting and added post processing shaders (programmable pipeline).

I'd like to generate a shadow map (for real time shadows) for this game which does not currently support this. As I understand, I need to perform multipass rendering which the game currently does not support, and I need one of those passes to use the light source as the camera position, to produce a shadow map.

I was thinking I could double up the draw calls (drawelements and drawarrays) and for one of each call, use gluLookAt to transform the scene to the perspective of the light position, and render this to a framebuffer, and then revert the camera and proceed rendering

i'm not sure i understand the opengl state well enough to do this however, as every use of gluLookAt gives me very funky results, even if I supply the current camera position I pull from the modelview matrix. these funky results are just like, some random vertices are in the correct place and many are not, and they are flashing and moving all over the place - ok so i assume i should not be trying to transform the camera at the moment of the individual render call for a vertex array.. but im not sure what to do next because i need two passes

if any one has any suggestions, such as get a life, or something, please let me know

Post Reply

Who is online

Users browsing this forum: No registered users