Esempio n. 1
0
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();
}
Esempio n. 2
0
void
Light::setSkyLightingSpecular(const GraphicsTexturePtr& texture) noexcept
{
	assert(!texture || texture->getGraphicsTextureDesc().getTexDim() == GraphicsTextureDim::GraphicsTextureDimCube);
	_skySpecularIBL = texture;
}
Esempio n. 3
0
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 );
}