Beispiel #1
0
void Framebuffer::buildColorAttachment()
{
	Texture::Pointer target = buildTexture(_description.size, _description.target, 
		_description.colorInternalformat, _description.colorFormat, _description.colorType);
	target->setWrap(_rc, TextureWrap::ClampToEdge, TextureWrap::ClampToEdge);
	addRenderTarget(target);
}
Beispiel #2
0
void Framebuffer::buildDepthAttachment()
{
	Texture::Pointer target = buildTexture(_description.size, _description.target,
		_description.depthInternalformat, _description.depthFormat, _description.depthType);

	target->setWrap(_rc, TextureWrap::ClampToEdge, TextureWrap::ClampToEdge);

	setDepthTarget(target);
}
Beispiel #3
0
void Framebuffer::addSameRendertarget()
{
	if (_description.colorIsRenderbuffer)
	{
		ET_ASSERT(!_colorRenderBuffers.empty());
		uint32_t newRenderTarget = buildColorRenderbuffer(0);
		_colorRenderBuffers.push_back(newRenderTarget);
		setColorRenderbuffer(newRenderTarget, 1);
	}
	else
	{
		ET_ASSERT(!_renderTargets.empty());
		
		const Texture::Pointer& basic = _renderTargets.front();
		
		Texture::Pointer target = buildTexture(vec3i(basic->size(), basic->description()->layersCount),
			basic->target(), basic->internalFormat(), basic->format(), basic->dataType());
		target->setName(name() + "_color_" + intToStr(_renderTargets.size() + 1));
		target->setWrap(_rc, TextureWrap::ClampToEdge, TextureWrap::ClampToEdge);
		addRenderTarget(target);
	}
}