bool OGLCoreFramebuffer::bindRenderTexture(GraphicsTexturePtr renderTexture, GLenum attachment, GLint level, GLint layer) noexcept { assert(renderTexture); auto texture = renderTexture->downcast<OGLCoreTexture>(); auto textureID = texture->getInstanceID(); auto& textureDesc = renderTexture->getGraphicsTextureDesc(); if (textureDesc.getTexDim() == GraphicsTextureDim::GraphicsTextureDim2DArray || textureDesc.getTexDim() == GraphicsTextureDim::GraphicsTextureDimCube || textureDesc.getTexDim() == GraphicsTextureDim::GraphicsTextureDimCubeArray) { glNamedFramebufferTextureLayer(_fbo, attachment, textureID, level, layer); } else { glNamedFramebufferTexture(_fbo, attachment, textureID, level); } return OGLCheck::checkError(); }
void Light::setSkyLightingSpecular(const GraphicsTexturePtr& texture) noexcept { assert(!texture || texture->getGraphicsTextureDesc().getTexDim() == GraphicsTextureDim::GraphicsTextureDimCube); _skySpecularIBL = texture; }
void Light::setSkyBox(const GraphicsTexturePtr& texture) noexcept { assert(!texture || texture->getGraphicsTextureDesc().getTexDim() == GraphicsTextureDim::GraphicsTextureDim2D); _skybox = texture; }
void GraphicsDriver::SetPSTexture(GraphicsTexturePtr inTexture, int inStartSlot) { auto texture = inTexture.get(); g_pImmediateContext->PSSetShaderResources( inStartSlot, 1, &texture ); }