Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/PostprocManager.cpp
Context not available. | |||||
#if !CONFIG2_GLES | #if !CONFIG2_GLES | ||||
Stan: Nuke. | |||||
CPostprocManager::CPostprocManager() | CPostprocManager::CPostprocManager() | ||||
: m_IsInitialized(false), m_PingFbo(0), m_PongFbo(0), m_PostProcEffect(L"default"), m_ColorTex1(0), m_ColorTex2(0), | : m_IsInitialized(false), m_PingFbo(0), m_PongFbo(0), m_PostProcEffect(L"default"), m_ColorTex1(0), m_ColorTex2(0), | ||||
m_DepthTex(0), m_BloomFbo(0), m_BlurTex2a(0), m_BlurTex2b(0), m_BlurTex4a(0), m_BlurTex4b(0), | m_DepthTex(0), m_BloomFbo(0), m_BlurTex2a(0), m_BlurTex2b(0), m_BlurTex4a(0), m_BlurTex4b(0), | ||||
Context not available. | |||||
m_Height = g_Renderer.GetHeight(); | m_Height = g_Renderer.GetHeight(); | ||||
UpdateAntiAliasingTechnique(); | UpdateAntiAliasingTechnique(); | ||||
UpdateSharpeningTechnique(); | |||||
UpdateSharpnessFactor(); | |||||
RecreateBuffers(); | RecreateBuffers(); | ||||
m_IsInitialized = true; | m_IsInitialized = true; | ||||
Context not available. | |||||
shader->Uniform(str_zNear, m_NearPlane); | shader->Uniform(str_zNear, m_NearPlane); | ||||
shader->Uniform(str_zFar, m_FarPlane); | shader->Uniform(str_zFar, m_FarPlane); | ||||
shader->Uniform(str_sharpness, m_Sharpness); | |||||
shader->Uniform(str_brightness, g_LightEnv.m_Brightness); | shader->Uniform(str_brightness, g_LightEnv.m_Brightness); | ||||
shader->Uniform(str_hdr, g_LightEnv.m_Contrast); | shader->Uniform(str_hdr, g_LightEnv.m_Contrast); | ||||
shader->Uniform(str_saturation, g_LightEnv.m_Saturation); | shader->Uniform(str_saturation, g_LightEnv.m_Saturation); | ||||
Context not available. | |||||
ApplyEffect(m_AATech, pass); | ApplyEffect(m_AATech, pass); | ||||
} | } | ||||
if (m_SharpTech) | |||||
{ | |||||
for (int pass = 0; pass < m_SharpTech->GetNumPasses(); ++pass) | |||||
ApplyEffect(m_SharpTech, pass); | |||||
} | |||||
pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PongFbo); | pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PongFbo); | ||||
pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_DepthTex, 0); | pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_DepthTex, 0); | ||||
Context not available. | |||||
} | } | ||||
} | } | ||||
void CPostprocManager::UpdateSharpeningTechnique() | |||||
{ | |||||
if (!g_RenderingOptions.GetPreferGLSL()) | |||||
return; | |||||
CStr newSharpName; | |||||
CFG_GET_VAL("sharpening", newSharpName); | |||||
if (m_SharpName == newSharpName) | |||||
return; | |||||
m_SharpName = newSharpName; | |||||
m_SharpTech.reset(); | |||||
if (m_SharpName == "cas") | |||||
{ | |||||
m_SharpTech = g_Renderer.GetShaderManager().LoadEffect(CStrIntern("cas")); | |||||
StanUnsubmitted Done Inline ActionsWondering if it wouldn't be better to always call m_SharpTech = g_Renderer.GetShaderManager().LoadEffect(CStrIntern(m_SharpName)); and let it error out if it isn't found. Maybe even better if you can load the json to figure that out. Stan: Wondering if it wouldn't be better to always call
```lang=cpp
m_SharpTech = g_Renderer. | |||||
OptimusShepardAuthorUnsubmitted Done Inline ActionsYou're right. If we check with the if (line 595) the allowed configurations, we don't need the errors, I think? OptimusShepard: You're right. If we check with the if (line 595) the allowed configurations, we don't need the… | |||||
StanUnsubmitted Not Done Inline ActionsWell the question is what should we do when the user enters an incorrect / unsupported value, should we tell him? Stan: Well the question is what should we do when the user enters an incorrect / unsupported value… | |||||
OptimusShepardAuthorUnsubmitted Done Inline ActionsHm. As the user uses a drop down menu to select the filter, the only possibility to get an incorrect value is to edit the config file. But this wont lead to an crash. So is a error message really necessary? If we think so, we have to add error warnings to all parameter of the config file. OptimusShepard: Hm. As the user uses a drop down menu to select the filter, the only possibility to get an… | |||||
StanUnsubmitted Done Inline ActionsI guess keep it consistent with what is done currently then:) Stan: I guess keep it consistent with what is done currently then:) | |||||
} | |||||
} | |||||
void CPostprocManager::UpdateSharpnessFactor() | |||||
{ | |||||
CFG_GET_VAL("sharpness", m_Sharpness); | |||||
} | |||||
void CPostprocManager::SetDepthBufferClipPlanes(float nearPlane, float farPlane) | void CPostprocManager::SetDepthBufferClipPlanes(float nearPlane, float farPlane) | ||||
{ | { | ||||
m_NearPlane = nearPlane; | m_NearPlane = nearPlane; | ||||
Context not available. | |||||
{ | { | ||||
} | } | ||||
void CPostprocManager::UpdateSharpeningTechnique() | |||||
{ | |||||
} | |||||
void CPostprocManager::UpdateSharpnessFactor() | |||||
{ | |||||
} | |||||
void CPostprocManager::CaptureRenderOutput() | void CPostprocManager::CaptureRenderOutput() | ||||
{ | { | ||||
} | } | ||||
Context not available. |
Wildfire Games · Phabricator
Nuke.