Showing the changes to libraries/render-utils/src/DebugDeferredBuffer.cpp (1 of 13 files). Show all
Unified · Split
| @@ -157,10 +157,26 @@ static const std::string DEFAULT_NORMAL_CURVATURE_SHADER{ · 156 unmodified lines | ||
| 157 | 157 | " }" |
| 158 | 158 | }; |
| 159 | 159 | |
| 160 | +static const std::string DEFAULT_DIFFUSED_CURVATURE_SHADER{ | |
| 161 | + "vec4 getFragmentColor() {" | |
| 162 | + " return vec4(pow(vec3(texture(diffusedCurvatureMap, uv).a), vec3(1.0 / 2.2)), 1.0);" | |
| 163 | + // " return vec4(pow(vec3(texture(curvatureMap, uv).xyz), vec3(1.0 / 2.2)), 1.0);" | |
| 164 | + //" return vec4(vec3(1.0 - textureLod(pyramidMap, uv, 3).x * 0.01), 1.0);" | |
| 165 | + " }" | |
| 166 | +}; | |
| 167 | + | |
| 168 | +static const std::string DEFAULT_DIFFUSED_NORMAL_CURVATURE_SHADER{ | |
| 169 | + "vec4 getFragmentColor() {" | |
| 170 | + //" return vec4(pow(vec3(texture(curvatureMap, uv).a), vec3(1.0 / 2.2)), 1.0);" | |
| 171 | + " return vec4(pow(vec3(texture(diffusedCurvatureMap, uv).xyz), vec3(1.0 / 2.2)), 1.0);" | |
| 172 | + //" return vec4(vec3(1.0 - textureLod(pyramidMap, uv, 3).x * 0.01), 1.0);" | |
| 173 | + " }" | |
| 174 | +}; | |
| 175 | + | |
| 160 | 176 | static const std::string DEFAULT_SCATTERING_SHADER{ |
| 161 | 177 | "vec4 getFragmentColor() {" |
| 162 | − // " return vec4(pow(vec3(texture(scatteringMap, uv).xyz), vec3(1.0 / 2.2)), 1.0);" | |
| 163 | − " return vec4(vec3(texture(scatteringMap, uv).xyz), 1.0);" | |
| 178 | + " return vec4(pow(vec3(texture(scatteringMap, uv).xyz), vec3(1.0 / 2.2)), 1.0);" | |
| 179 | + // " return vec4(vec3(texture(scatteringMap, uv).xyz), 1.0);" | |
| 164 | 180 | " }" |
| 165 | 181 | }; |
| 166 | 182 | |
| @@ -233,6 +249,10 @@ std::string DebugDeferredBuffer::getShaderSourceCode(Mode mode, std::string cust · 66 unmodified lines | ||
| 233 | 249 | return DEFAULT_CURVATURE_SHADER; |
| 234 | 250 | case NormalCurvatureMode: |
| 235 | 251 | return DEFAULT_NORMAL_CURVATURE_SHADER; |
| 252 | + case DiffusedCurvatureMode: | |
| 253 | + return DEFAULT_DIFFUSED_CURVATURE_SHADER; | |
| 254 | + case DiffusedNormalCurvatureMode: | |
| 255 | + return DEFAULT_DIFFUSED_NORMAL_CURVATURE_SHADER; | |
| 236 | 256 | case ScatteringMode: |
| 237 | 257 | return DEFAULT_SCATTERING_SHADER; |
| 238 | 258 | case AmbientOcclusionMode: |
| @@ -317,12 +337,13 @@ void DebugDeferredBuffer::configure(const Config& config) { · 78 unmodified lines | ||
| 317 | 337 | _size = config.size; |
| 318 | 338 | } |
| 319 | 339 | |
| 320 | −void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const gpu::FramebufferPointer& inputBuffer) { | |
| 340 | +void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) { | |
| 321 | 341 | assert(renderContext->args); |
| 322 | 342 | assert(renderContext->args->hasViewFrustum()); |
| 323 | 343 | RenderArgs* args = renderContext->args; |
| 324 | 344 | |
| 325 | − auto& scatteringFramebuffer = inputBuffer; | |
| 345 | + auto& diffusedCurvatureFramebuffer = inputs.getFirst(); | |
| 346 | + auto& scatteringFramebuffer = inputs.getSecond(); | |
| 326 | 347 | |
| 327 | 348 | gpu::doInBatch(args->_context, [&](gpu::Batch& batch) { |
| 328 | 349 | batch.enableStereo(false); |
| @@ -354,7 +375,7 @@ void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const Ren · 25 unmodified lines | ||
| 354 | 375 | batch.setResourceTexture(Shadow, lightStage.lights[0]->shadow.framebuffer->getDepthStencilBuffer()); |
| 355 | 376 | batch.setResourceTexture(Pyramid, framebufferCache->getDepthPyramidTexture()); |
| 356 | 377 | batch.setResourceTexture(Curvature, framebufferCache->getCurvatureTexture()); |
| 357 | − //batch.setResourceTexture(DiffusedCurvature, diffusedCurvatureBuffer); | |
| 378 | + batch.setResourceTexture(DiffusedCurvature, diffusedCurvatureFramebuffer->getRenderBuffer(0)); | |
| 358 | 379 | batch.setResourceTexture(Scattering, scatteringFramebuffer->getRenderBuffer(0)); |
| 359 | 380 | if (DependencyManager::get<DeferredLightingEffect>()->isAmbientOcclusionEnabled()) { |
| 360 | 381 | batch.setResourceTexture(AmbientOcclusion, framebufferCache->getOcclusionTexture()); |