Implemented basic ShadowMap technique

This commit is contained in:
Robert Osfield
2007-02-19 14:20:18 +00:00
parent d5c68cfa02
commit 37526e3bea
5 changed files with 303 additions and 8 deletions

View File

@@ -31,6 +31,11 @@ ShadowTexture::ShadowTexture(const ShadowTexture& copy, const osg::CopyOp& copyo
{
}
void ShadowTexture::setTextureUnit(unsigned int unit)
{
_textureUnit = unit;
}
void ShadowTexture::init()
{
if (!_shadowedScene) return;
@@ -64,7 +69,7 @@ void ShadowTexture::init()
// tell the camera to use OpenGL frame buffer object where supported.
_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
//_camera->setRenderTargetImplementation(osg::Camera::SEPERATE_WINDOW);
_camera->setRenderTargetImplementation(osg::Camera::SEPERATE_WINDOW);
// attach the texture and use it as the color buffer.
_camera->attach(osg::Camera::COLOR_BUFFER, _texture.get());