playcanvas / playcanvas/engine

DOF improvements

Open
#7,211 1 comment 4 reactions 1 assignee View on GitHub

@mvaligursky is already working on this.

Since Dec 18, 2024.

area: graphics enhancement performance
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

Possible improvements for DOF implementation here

Features:

  • WebGPU support. There is compilation issue with one shader currently due to glslang adding no longer supported keyword to the WGSL shader. The solution is to write a version of the shader directly in WGSL. https://github.com/playcanvas/engine/pull/7218
  • update CameraFrame script to expose this functionality to the Editor
  • physically based bloom, where instead of distance and range parameters, the bloom is controlled by camera parameters: aperture, fov)
  • blur green channel of CoC texture to allow near blur objects to have soft edges

Performance / quality:

  • make the near blur optional, for experiences where only the background needs to be blurred https://github.com/playcanvas/engine/pull/7220
  • when only a small amount of blur is used (less than about 3), it's more obvious the half res scene texture is used as a blur source. We could use high res at that point at a higher cost.
  • use compute shaders as described in links from the original PR to generate tile min/max CoC textures and dispatch more appropriate (cheaper) blur shaders for individual tiles.
  • when TAA is used at the same time, the blurred background flickers due to TAA jitter. We could try to influence TAA's strength based on CoC texture - limit TAA in the more blurry regions. Can be slight perf win as well.
  • consider generation of few (2-3) mip levels of the scene texture (currently have half res only), and optimize the sampling algorithm to use lower mips for wider blurs, with less samples.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.