Hi!
I'm working on implementing simple shadow mapping for displaying something like a torch carried by the player.
For this, I have to implement depth-map offline rendering from the perspective of the light source. This requires me creating my own camera. However, when I try using the camera I just created (no matter whether I use it for my render-to-texture code or as the target for the render window), I get the OpenGL error "Invalid value (1281)":
SEVERE: Main game loop broken by uncaught exception
org.lwjgl.opengl.OpenGLException: Invalid value (1281)
at org.lwjgl.opengl.Util.checkGLError(Util.java:53)
at org.lwjgl.opengl.Display.swapBuffers(Display.java:591)
at org.lwjgl.opengl.Display.update(Display.java:609)
at com.jme.renderer.lwjgl.LWJGLRenderer.displayBackBuffer(Unknown Source)
at com.jmex.game.StandardGame.run(Unknown Source)
at java.lang.Thread.run(Thread.java:613)
This is the code for creating the camera:
playerCam = new LWJGLCamera(1024,1024,this);
playerCam.setFrustumPerspective(180f, 1f, 0.1f, 1000f);
playerCam.update();
I'm updating its position in the update method:
playerCam.setFrame(node.getWorldTranslation().add(0f,0f,2f), node.getWorldRotation());
In my render method, I'm setting the camera right before actually rendering the rootNode:
renderer.setCamera(playerCam);
I'm calling updateRenderState on my rootNode on every update. Did I miss anything there? The only example for multiple views I found was re-using the single camera object, but that's not what I want (I'd have to reset the camera on every frame)...