Shadow Maps with GL_RGB instead of GL_DEPTH_COMPONENT

Started by elias4444, March 07, 2009, 22:00:48

Previous topic - Next topic

elias4444

Anyone know how to do shadowmaps with a GL_RGB texture instead of GL_DEPTH_COMPONENT? I have the depth component method working fine with framebuffer objects, but for my backup (using glCopyTexSubImage2D), it has to be the same format as my screen (GL_RGB) or I suffer a 2fps game.

The shadows cast fine, but self-shadowing is all messed up. For an example, the first picture is with the FBO (looks correct), but the second picture is the fallback method of GL_RGB:



Is there some texture settings or something? Or can shadow maps only be done with GL_DEPTH_COMPONENT textures?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias4444

NOTE: I totally hijacked my own thread and revamped it.  ;D
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

EgonOlsen

Even when using glCopy... instead of FBOs, the texture for the shadow map isn't an RGB texture. It's still GL_DEPTH_COMPONENT. The glCopy... takes care of copying the correct data (i.e. the depth buffer in this case).

elias4444

Yeah, I've been learning all the ins-and-outs of shadow mapping this past while (still, I thank you for replying). I'm unfortunately to the point now of trying to implement it with shaders so I can add things like per-pixel-lighting. I do the same matrix conversions and math, but the shaders (I'm using the ones right out of the GLSL orange book) don't seem to match things up as well GL_EYE_LINEAR does in the fixed function pipeline. You can see my updated issue on the gamdev forums at this link: http://www.gamedev.net/community/forums/topic.asp?topic_id=528645.

I would have kept posting here, but the LWJGL forums have been a little quiet.  ;)
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com