-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raytracer: Use premultiplied alpha to describe surface color.
Part of fixing <#504>. With this change, the raytracer now correctly renders blocks that have light emission only (at least, in volumetric mode; the surface-only mode is multiplying the emission by the number of voxels, which is not really the right outcome). It is incoherent or at least undesirable to multiply light emissions by the reflectance color’s alpha. To avoid doing that, the cleanest solution is to switch to premultiplied alpha, where the accumulator only uses the alpha to determine the effect on future (more distant) surfaces. Conveniently, we already have a type that implements exactly this representation: `ColorBuf`! Or, not exactly — the alpha is actually complemented (1 − α), making it transmittance instead, but that’s what we actually need. This commit breaks the `icons` rendering test, but we need to fix the same bug in `wgpu` rendering and also update the icon to match the new paradigm, so it's going to be broken sometime unless I were to squash all three changes into one commit, which I don't want to do.
- Loading branch information
Showing
10 changed files
with
109 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.