Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mipmap Biasing #7323

Closed
JMS55 opened this issue Jan 22, 2023 · 0 comments · Fixed by #7614
Closed

Mipmap Biasing #7323

JMS55 opened this issue Jan 22, 2023 · 0 comments · Fixed by #7614
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible

Comments

@JMS55
Copy link
Contributor

JMS55 commented Jan 22, 2023

What problem does this solve or what need does it fill?

Temporal filtering techniques like TAA and FSR2 do best with a small negative mipmap bias, e.g. biased slightly towards higher resolution (lower number) mips. This helps counteract some of the blurriness typical of these techniques.

Apparently this can also increase sharpness even without temporal techniques.

What solution would you like?

Add some kind of component, resource, field, etc that would let you give the rendering system a specified mip bias, so that TAA/FSR2 can add a bias appropriate to their technique.

We can copy the value to one of the existing uniforms, and use wgsl's textureSampleBias() function to sample the StandardMaterial texture maps with the bias.

Open questions

  • How is this configured? Globally via a resource, per-view via a Camera3d field, per StandardMaterial?
  • Does textureSampleBias() with a 0 bias cost performance vs textureSample()?

Additional context

@JMS55 JMS55 added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Jan 22, 2023
superdump added a commit that referenced this issue Mar 27, 2023
![image](https://user-images.githubusercontent.com/47158642/214374911-412f0986-3927-4f7a-9a6c-413bdee6b389.png)

# Objective

- Implement an alternative antialias technique
- TAA scales based off of view resolution, not geometry complexity
- TAA filters textures, firefly pixels, and other aliasing not covered
by MSAA
- TAA additionally will reduce noise / increase quality in future
stochastic rendering techniques
- Closes #3663

## Solution

- Add a temporal jitter component
- Add a motion vector prepass
- Add a TemporalAntialias component and plugin
- Combine existing MSAA and FXAA examples and add TAA

## Followup Work
- Prepass motion vector support for skinned meshes
- Move uniforms needed for motion vectors into a separate bind group,
instead of using different bind group layouts
- Reuse previous frame's GPU view buffer for motion vectors, instead of
recomputing
- Mip biasing for sharper textures, and or unjitter texture UVs
#7323
- Compute shader for better performance
- Investigate FSR techniques
  - Historical depth based disocclusion tests, for geometry disocclusion
  - Historical luminance/hue based tests, for shading disocclusion
- Pixel "locks" to reduce blending rate / revamp history confidence
mechanism
- Orthographic camera support for TemporalJitter
- Figure out COD's 1-tap bicubic filter

---

## Changelog

- Added MotionVectorPrepass and TemporalJitter
- Added TemporalAntialiasPlugin, TemporalAntialiasBundle, and
TemporalAntialiasSettings

---------

Co-authored-by: IceSentry <c.giguere42@gmail.com>
Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Daniel Chia <danstryder@gmail.com>
Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
Co-authored-by: Brandon Dyer <brandondyer64@gmail.com>
Co-authored-by: Edgar Geier <geieredgar@gmail.com>
github-merge-queue bot pushed a commit that referenced this issue Jun 22, 2023
# Objective

- Closes #7323 
- Reduce texture blurriness for TAA

## Solution

- Add a `MipBias` component and view uniform.
- Switch material `textureSample()` calls to `textureSampleBias()`.
- Add a `-1.0` bias to TAA.

---

## Changelog

- Added `MipBias` camera component, mostly for internal use.

---------

Co-authored-by: François <mockersf@gmail.com>
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant