Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/PostprocManager.cpp
Show First 20 Lines • Show All 671 Lines • ▼ Show 20 Lines | |||||
void CPostprocManager::CreateMultisampleBuffer() | void CPostprocManager::CreateMultisampleBuffer() | ||||
{ | { | ||||
glEnable(GL_MULTISAMPLE); | glEnable(GL_MULTISAMPLE); | ||||
m_MultisampleColorTex = Renderer::Backend::GL::CTexture::Create( | m_MultisampleColorTex = Renderer::Backend::GL::CTexture::Create( | ||||
Renderer::Backend::GL::CTexture::Type::TEXTURE_2D_MULTISAMPLE, | Renderer::Backend::GL::CTexture::Type::TEXTURE_2D_MULTISAMPLE, | ||||
Renderer::Backend::Format::R8G8B8A8, m_Width, m_Height, | Renderer::Backend::Format::R8G8B8A8, m_Width, m_Height, | ||||
Renderer::Backend::Sampler::MakeDefaultSampler( | Renderer::Backend::Sampler::MakeDefaultSampler( | ||||
Renderer::Backend::Sampler::Filter::LINEAR, | Renderer::Backend::Sampler::Filter::NEAREST, | ||||
Renderer::Backend::Sampler::AddressMode::CLAMP_TO_EDGE), 1); | Renderer::Backend::Sampler::AddressMode::CLAMP_TO_EDGE), 1); | ||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_MultisampleColorTex->GetHandle()); | glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_MultisampleColorTex->GetHandle()); | ||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, m_MultisampleCount, GL_RGBA, m_Width, m_Height, GL_TRUE); | glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, m_MultisampleCount, GL_RGBA, m_Width, m_Height, GL_TRUE); | ||||
// Allocate the Depth/Stencil texture. | // Allocate the Depth/Stencil texture. | ||||
m_MultisampleDepthTex = Renderer::Backend::GL::CTexture::Create( | m_MultisampleDepthTex = Renderer::Backend::GL::CTexture::Create( | ||||
Renderer::Backend::GL::CTexture::Type::TEXTURE_2D_MULTISAMPLE, | Renderer::Backend::GL::CTexture::Type::TEXTURE_2D_MULTISAMPLE, | ||||
Renderer::Backend::Format::D24_S8, m_Width, m_Height, | Renderer::Backend::Format::D24_S8, m_Width, m_Height, | ||||
Renderer::Backend::Sampler::MakeDefaultSampler( | Renderer::Backend::Sampler::MakeDefaultSampler( | ||||
Renderer::Backend::Sampler::Filter::LINEAR, | Renderer::Backend::Sampler::Filter::NEAREST, | ||||
Renderer::Backend::Sampler::AddressMode::CLAMP_TO_EDGE), 1); | Renderer::Backend::Sampler::AddressMode::CLAMP_TO_EDGE), 1); | ||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_MultisampleDepthTex->GetHandle()); | glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_MultisampleDepthTex->GetHandle()); | ||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, m_MultisampleCount, GL_DEPTH24_STENCIL8_EXT, m_Width, m_Height, GL_TRUE); | glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, m_MultisampleCount, GL_DEPTH24_STENCIL8_EXT, m_Width, m_Height, GL_TRUE); | ||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); | ||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0); | glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0); | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator