- Added getters to IRenderTarget interface.
- Improved D24S8 color format handling in OpenGL. - Fixed issue with wrong size for OpenGL RT when FBO isn't available. Thx CuteAlien for report that. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5222 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
bc9fe27e30
commit
966e05b51b
|
@ -25,6 +25,18 @@ namespace video
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Returns an array of previously set textures.
|
||||||
|
const core::array<ITexture*>& getTexture() const
|
||||||
|
{
|
||||||
|
return Texture;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! Returns a of previously set depth / depth-stencil texture.
|
||||||
|
ITexture* getDepthStencil() const
|
||||||
|
{
|
||||||
|
return DepthStencil;
|
||||||
|
}
|
||||||
|
|
||||||
//! Set multiple textures.
|
//! Set multiple textures.
|
||||||
/** Set multiple textures for the render target.
|
/** Set multiple textures for the render target.
|
||||||
\param texture Array of texture objects. These textures are used for a color outputs.
|
\param texture Array of texture objects. These textures are used for a color outputs.
|
||||||
|
|
|
@ -3636,11 +3636,7 @@ ITexture* COpenGLDriver::addRenderTargetTexture(const core::dimension2d<u32>& si
|
||||||
bool generateMipLevels = getTextureCreationFlag(ETCF_CREATE_MIP_MAPS);
|
bool generateMipLevels = getTextureCreationFlag(ETCF_CREATE_MIP_MAPS);
|
||||||
setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, false);
|
setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, false);
|
||||||
|
|
||||||
bool supportForFBO = false;
|
bool supportForFBO = (Feature.ColorAttachment > 0);
|
||||||
|
|
||||||
#if defined(GL_VERSION_3_0) || defined(GL_ARB_framebuffer_object) || defined(GL_EXT_framebuffer_object)
|
|
||||||
supportForFBO = FeatureAvailable[IRR_EXT_framebuffer_object] || FeatureAvailable[IRR_ARB_framebuffer_object];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
core::dimension2du destSize(size);
|
core::dimension2du destSize(size);
|
||||||
|
|
||||||
|
@ -3650,7 +3646,7 @@ ITexture* COpenGLDriver::addRenderTargetTexture(const core::dimension2d<u32>& si
|
||||||
destSize = destSize.getOptimalSize((size == size.getOptimalSize()), false, false);
|
destSize = destSize.getOptimalSize((size == size.getOptimalSize()), false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
COpenGLTexture* renderTargetTexture = new COpenGLTexture(name, size, format, this);
|
COpenGLTexture* renderTargetTexture = new COpenGLTexture(name, destSize, format, this);
|
||||||
addTexture(renderTargetTexture);
|
addTexture(renderTargetTexture);
|
||||||
renderTargetTexture->drop();
|
renderTargetTexture->drop();
|
||||||
|
|
||||||
|
@ -4078,14 +4074,23 @@ void COpenGLDriver::getColorFormatParameters(ECOLOR_FORMAT format, GLint& intern
|
||||||
case ECF_D16:
|
case ECF_D16:
|
||||||
internalFormat = GL_DEPTH_COMPONENT16;
|
internalFormat = GL_DEPTH_COMPONENT16;
|
||||||
pixelFormat = GL_DEPTH_COMPONENT;
|
pixelFormat = GL_DEPTH_COMPONENT;
|
||||||
pixelType = GL_UNSIGNED_BYTE;
|
pixelType = GL_UNSIGNED_SHORT;
|
||||||
break;
|
break;
|
||||||
case ECF_D32:
|
case ECF_D32:
|
||||||
internalFormat = GL_DEPTH_COMPONENT32;
|
internalFormat = GL_DEPTH_COMPONENT32;
|
||||||
pixelFormat = GL_DEPTH_COMPONENT;
|
pixelFormat = GL_DEPTH_COMPONENT;
|
||||||
pixelType = GL_UNSIGNED_BYTE;
|
pixelType = GL_UNSIGNED_INT;
|
||||||
break;
|
break;
|
||||||
case ECF_D24S8:
|
case ECF_D24S8:
|
||||||
|
#ifdef GL_VERSION_3_0
|
||||||
|
if (Version >= 300)
|
||||||
|
{
|
||||||
|
internalFormat = GL_DEPTH_STENCIL;
|
||||||
|
pixelFormat = GL_DEPTH_STENCIL;
|
||||||
|
pixelType = GL_UNSIGNED_INT_24_8;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
#ifdef GL_EXT_packed_depth_stencil
|
#ifdef GL_EXT_packed_depth_stencil
|
||||||
if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_EXT_packed_depth_stencil))
|
if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_EXT_packed_depth_stencil))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue