Implemented basic ShadowMap technique
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user