mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
WTF...
This commit is contained in:
parent
b133556c14
commit
e6c74b29c7
5 changed files with 61 additions and 33 deletions
|
@ -403,7 +403,7 @@ void AmbientOcclusionEffect::run(const render::SceneContextPointer& sceneContext
|
|||
|
||||
|
||||
// We need this with the mips levels
|
||||
batch.generateTextureMips(_framebuffer->getLinearDepthTexture());
|
||||
// batch.generateTextureMips(_framebuffer->getLinearDepthTexture());
|
||||
|
||||
// Occlusion pass
|
||||
batch.setFramebuffer(occlusionFBO);
|
||||
|
@ -480,6 +480,10 @@ void DebugAmbientOcclusion::run(const render::SceneContextPointer& sceneContext,
|
|||
assert(renderContext->args);
|
||||
assert(renderContext->args->hasViewFrustum());
|
||||
|
||||
if (!_showCursorPixel) {
|
||||
return;
|
||||
}
|
||||
|
||||
RenderArgs* args = renderContext->args;
|
||||
|
||||
// FIXME: Different render modes should have different tasks
|
||||
|
|
|
@ -403,22 +403,30 @@ void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const Ren
|
|||
|
||||
batch.setPipeline(getPipeline(_mode, first));
|
||||
|
||||
batch.setResourceTexture(Albedo, deferredFramebuffer->getDeferredColorTexture());
|
||||
batch.setResourceTexture(Normal, deferredFramebuffer->getDeferredNormalTexture());
|
||||
batch.setResourceTexture(Specular, deferredFramebuffer->getDeferredSpecularTexture());
|
||||
batch.setResourceTexture(Depth, deferredFramebuffer->getPrimaryDepthTexture());
|
||||
batch.setResourceTexture(Lighting, deferredFramebuffer->getLightingTexture());
|
||||
batch.setResourceTexture(Shadow, lightStage.lights[0]->shadow.framebuffer->getDepthStencilBuffer());
|
||||
batch.setResourceTexture(LinearDepth, linearDepthTarget->getLinearDepthTexture());
|
||||
batch.setResourceTexture(HalfLinearDepth, linearDepthTarget->getHalfLinearDepthTexture());
|
||||
batch.setResourceTexture(HalfNormal, linearDepthTarget->getHalfNormalTexture());
|
||||
|
||||
batch.setResourceTexture(Curvature, surfaceGeometryFramebuffer->getCurvatureTexture());
|
||||
batch.setResourceTexture(DiffusedCurvature, surfaceGeometryFramebuffer->getLowCurvatureTexture());
|
||||
|
||||
batch.setResourceTexture(AmbientOcclusion, ambientOcclusionFramebuffer->getOcclusionTexture());
|
||||
batch.setResourceTexture(AmbientOcclusionBlurred, ambientOcclusionFramebuffer->getOcclusionBlurredTexture());
|
||||
if (deferredFramebuffer) {
|
||||
batch.setResourceTexture(Albedo, deferredFramebuffer->getDeferredColorTexture());
|
||||
batch.setResourceTexture(Normal, deferredFramebuffer->getDeferredNormalTexture());
|
||||
batch.setResourceTexture(Specular, deferredFramebuffer->getDeferredSpecularTexture());
|
||||
batch.setResourceTexture(Depth, deferredFramebuffer->getPrimaryDepthTexture());
|
||||
batch.setResourceTexture(Lighting, deferredFramebuffer->getLightingTexture());
|
||||
}
|
||||
if (!lightStage.lights.empty()) {
|
||||
batch.setResourceTexture(Shadow, lightStage.lights[0]->shadow.framebuffer->getDepthStencilBuffer());
|
||||
}
|
||||
|
||||
if (linearDepthTarget) {
|
||||
batch.setResourceTexture(LinearDepth, linearDepthTarget->getLinearDepthTexture());
|
||||
batch.setResourceTexture(HalfLinearDepth, linearDepthTarget->getHalfLinearDepthTexture());
|
||||
batch.setResourceTexture(HalfNormal, linearDepthTarget->getHalfNormalTexture());
|
||||
}
|
||||
if (surfaceGeometryFramebuffer) {
|
||||
batch.setResourceTexture(Curvature, surfaceGeometryFramebuffer->getCurvatureTexture());
|
||||
batch.setResourceTexture(DiffusedCurvature, surfaceGeometryFramebuffer->getLowCurvatureTexture());
|
||||
}
|
||||
if (ambientOcclusionFramebuffer) {
|
||||
batch.setResourceTexture(AmbientOcclusion, ambientOcclusionFramebuffer->getOcclusionTexture());
|
||||
batch.setResourceTexture(AmbientOcclusionBlurred, ambientOcclusionFramebuffer->getOcclusionBlurredTexture());
|
||||
}
|
||||
const glm::vec4 color(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
const glm::vec2 bottomLeft(_size.x, _size.y);
|
||||
const glm::vec2 topRight(_size.z, _size.w);
|
||||
|
|
|
@ -124,9 +124,9 @@ RenderDeferredTask::RenderDeferredTask(CullFunctor cullFunctor) {
|
|||
const auto linearDepthPassInputs = LinearDepthPass::Inputs(deferredFrameTransform, deferredFramebuffer).hasVarying();
|
||||
const auto linearDepthPassOutputs = addJob<LinearDepthPass>("LinearDepth", linearDepthPassInputs);
|
||||
const auto linearDepthTarget = linearDepthPassOutputs.getN<LinearDepthPass::Outputs>(0);
|
||||
const auto linearDepthTexture = linearDepthPassOutputs.getN<LinearDepthPass::Outputs>(2);
|
||||
const auto halfLinearDepthTexture = linearDepthPassOutputs.getN<LinearDepthPass::Outputs>(3);
|
||||
const auto halfNormalTexture = linearDepthPassOutputs.getN<LinearDepthPass::Outputs>(4);
|
||||
// const auto linearDepthTexture = linearDepthPassOutputs.getN<LinearDepthPass::Outputs>(2);
|
||||
// const auto halfLinearDepthTexture = linearDepthPassOutputs.getN<LinearDepthPass::Outputs>(3);
|
||||
// const auto halfNormalTexture = linearDepthPassOutputs.getN<LinearDepthPass::Outputs>(4);
|
||||
|
||||
|
||||
// Curvature pass
|
||||
|
|
|
@ -61,6 +61,9 @@ void LinearDepthFramebuffer::updatePrimaryDepth(const gpu::TexturePointer& depth
|
|||
void LinearDepthFramebuffer::clear() {
|
||||
_linearDepthFramebuffer.reset();
|
||||
_linearDepthTexture.reset();
|
||||
_downsampleFramebuffer.reset();
|
||||
_halfLinearDepthTexture.reset();
|
||||
_halfNormalTexture.reset();
|
||||
}
|
||||
|
||||
void LinearDepthFramebuffer::allocate() {
|
||||
|
@ -79,7 +82,7 @@ void LinearDepthFramebuffer::allocate() {
|
|||
// For Downsampling:
|
||||
_halfLinearDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::RGB), _halfFrameSize.x, _halfFrameSize.y,
|
||||
gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT)));
|
||||
_halfLinearDepthTexture->autoGenerateMips(-1);
|
||||
_halfLinearDepthTexture->autoGenerateMips(5);
|
||||
|
||||
_halfNormalTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB), _halfFrameSize.x, _halfFrameSize.y,
|
||||
gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_LINEAR_MIP_POINT)));
|
||||
|
|
|
@ -38,21 +38,34 @@ Column {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
Repeater {
|
||||
model: [
|
||||
"resolutionLevel:resolutionLevel",
|
||||
"ditheringEnabled:ditheringEnabled",
|
||||
"borderingEnabled:borderingEnabled",
|
||||
"fetchMipsEnabled:fetchMipsEnabled",
|
||||
]
|
||||
CheckBox {
|
||||
text: qsTr(modelData.split(":")[0])
|
||||
checked: Render.getConfig("AmbientOcclusion")[modelData.split(":")[1]]
|
||||
onCheckedChanged: { Render.getConfig("AmbientOcclusion")[modelData.split(":")[1]] = checked }
|
||||
Row{
|
||||
Column {
|
||||
Repeater {
|
||||
model: [
|
||||
"resolutionLevel:resolutionLevel",
|
||||
"ditheringEnabled:ditheringEnabled",
|
||||
"borderingEnabled:borderingEnabled",
|
||||
"fetchMipsEnabled:fetchMipsEnabled"
|
||||
]
|
||||
CheckBox {
|
||||
text: qsTr(modelData.split(":")[0])
|
||||
checked: Render.getConfig("AmbientOcclusion")[modelData.split(":")[1]]
|
||||
onCheckedChanged: { Render.getConfig("AmbientOcclusion")[modelData.split(":")[1]] = checked }
|
||||
}
|
||||
}
|
||||
}
|
||||
Column {
|
||||
Repeater {
|
||||
model: [
|
||||
"debugEnabled:showCursorPixel"
|
||||
]
|
||||
CheckBox {
|
||||
text: qsTr(modelData.split(":")[0])
|
||||
checked: Render.getConfig("DebugAmbientOcclusion")[modelData.split(":")[1]]
|
||||
onCheckedChanged: { Render.getConfig("DebugAmbientOcclusion")[modelData.split(":")[1]] = checked }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlotPerf {
|
||||
|
|
Loading…
Reference in a new issue