16 #ifndef SURGSIM_GRAPHICS_OSGRENDERTARGET_INL_H 17 #define SURGSIM_GRAPHICS_OSGRENDERTARGET_INL_H 32 m_colorTargetCount(0),
33 m_textures(OsgSupportedTextureCount)
69 int result = (count < 16) ? count : 16;
93 std::shared_ptr<Texture> result;
106 std::shared_ptr<T> result;
154 osg::Texture* osgTexture =
m_textures[type]->getOsgTexture();
157 osgTexture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR);
158 osgTexture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR);
159 osgTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
160 osgTexture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);
163 osgTexture->setInternalFormat(GL_DEPTH_COMPONENT32F);
164 osgTexture->setSourceFormat(GL_DEPTH_COMPONENT);
165 osgTexture->setSourceType(GL_FLOAT);
166 osgTexture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::NEAREST);
167 osgTexture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::NEAREST);
171 osgTexture->setInternalFormat(GL_RGBA32F_ARB);
172 osgTexture->setSourceFormat(GL_RGBA);
173 osgTexture->setSourceType(GL_FLOAT);
int setColorTargetCount(int count)
Sets color target count.
Definition: OsgRenderTarget-inl.h:67
Definition: DriveElementFromInputBehavior.cpp:27
virtual void getSize(int *width, int *height) const override
Gets a size.
Definition: OsgRenderTarget-inl.h:60
int m_colorTargetCount
Number of color targets.
Definition: OsgRenderTarget.h:116
OsgRenderTarget()
Default constructor.
Definition: OsgRenderTarget-inl.h:29
virtual std::shared_ptr< Texture > getColorTarget(int index) const override
Generic accessor for a specific color target texture.
Definition: OsgRenderTarget-inl.h:91
virtual bool doesUseDepthTarget() const override
Determines if RenderTarget does use a depth target.
Definition: OsgRenderTarget-inl.h:130
Definition: OsgRenderTarget.h:106
std::shared_ptr< OsgTexture > getColorTargetOsg(int index) const
Accessor for the color target as an OsgTexture.
Definition: OsgRenderTarget-inl.h:104
virtual int getColorTargetCount() const override
Definition: OsgRenderTarget-inl.h:85
void useDepthTarget(bool val)
Use depth target.
Definition: OsgRenderTarget-inl.h:117
Definition: OsgRenderTarget.h:105
int m_width
The width of this RenderTarget.
Definition: OsgRenderTarget.h:110
~OsgRenderTarget()
Destructor.
Definition: OsgRenderTarget-inl.h:55
void setupTexture(int type)
Sets up the texture with a given target type (depth or color w/ index).
Definition: OsgRenderTarget-inl.h:148
int m_height
The height of this RenderTarget.
Definition: OsgRenderTarget.h:113
std::vector< std::shared_ptr< TextureType > > m_textures
The textures that are being used as target, size of this is 16 (ColorTargets) + 1 (Depth)...
Definition: OsgRenderTarget.h:119
virtual std::shared_ptr< Texture > getDepthTarget() const override
Generic accessor for the depth Target.
Definition: OsgRenderTarget-inl.h:136
const int OsgSupportedTextureCount
Definition: OsgRenderTarget-inl.h:26
std::shared_ptr< OsgTexture > getDepthTargetOsg() const
Accessor for the depth target as an OsgTexture.
Definition: OsgRenderTarget-inl.h:142