-
Notifications
You must be signed in to change notification settings - Fork 408
Release notes for decals #2085
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
Release notes for decals #2085
Conversation
|
@naasblod, here are the promised release notes to review! |
Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
| This can be mitigated by creating textures that are bigger than the effect, giving the decal more space to stretch. | ||
| To create a forward decal, spawn a [`ForwardDecal`] entity, which uses a [`ForwardDecalMaterial`] using the [`ForwardDecalMaterialExt`] material extension. | ||
|
|
||
| Clustered decals (or decal projectors) work by projecting images from a 1x1x1 cube onto surfaces found in the +Z direction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the +z direction part correct?
I’m not certain how this feature works so don’t rely on my feedback without verifying. I was thinking that this is like a 2D image on the right-handed x-right, y-up, z-back cube’s z faces being projected through the cube along its z-axis and covering any surfaces along the path. I have a feeling that I also saw it project onto both front and back faces from the cube’s perspective. Here a picture would surely be a thousand words. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was taken from the existing docs :)
|
I'll check at this in a little while when I arrive at the office. Got some time before I start. Great job! |
| This can be mitigated by creating textures that are bigger than the effect, giving the decal more space to stretch. | ||
| To create a forward decal, spawn a [`ForwardDecal`] entity, which uses a [`ForwardDecalMaterial`] using the [`ForwardDecalMaterialExt`] material extension. | ||
|
|
||
| Clustered decals (or decal projectors) work by projecting images from a 1x1x1 cube onto surfaces found in the +Z direction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like too much pointless technical info. Even I don't really care about cubes or +z direction.
| To create a forward decal, spawn a [`ForwardDecal`] entity, which uses a [`ForwardDecalMaterial`] using the [`ForwardDecalMaterialExt`] material extension. | ||
|
|
||
| Clustered decals (or decal projectors) work by projecting images from a 1x1x1 cube onto surfaces found in the +Z direction. | ||
| They are clusterable objects, just like point lights and light probes, which means that decals are only evaluated for objects within the bounds of the projector, and they don't require a second rendering pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and they don't require a second rendering pass.
Kind of implies that forward decals do require a second rendering pass, which sorta isn't true.
Small summary of how they work:
- Forward decals basically map to mesh + material under the hood, I just did some fancy API stuff to make it ergonomic for users to spawn. It's literately just an extra alpha-blended mesh that gets rendered in the transparent phase.
- Clustered decals get binned into froxels(iirc?), and then during the opaque pass each fragments lookup what froxel they're in, and then iterate over the decals in the froxel and apply them. Same as how points/spot lights work, and I guess light probes although I forgot about that bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So forward decals results in the same fragment being shaded twice? In which case:
| They are clusterable objects, just like point lights and light probes, which means that decals are only evaluated for objects within the bounds of the projector, and they don't require a second rendering pass. | |
| They are clusterable objects, just like point lights and light probes, which means that decals are only evaluated for objects within the bounds of the projector, and they don't require shading the same fragment an additional time to blend the decal on top. |
| They are clusterable objects, just like point lights and light probes, which means that decals are only evaluated for objects within the bounds of the projector, and they don't require a second rendering pass. | ||
| To create a clustered decal, spawn a [`ClusteredDecal`] entity. | ||
|
|
||
| Ultimately, forward decals offer broader hardware and driver support, while clustered decals are higher quality and don't require the creation of bounding geometry, improving performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think forward decals are also a little easier to customize, since it's 99% just using the material API. Clustered decals can be customized, but are a little harder.
There might also be other quality differences and situations where one or the other is better, but idk enough about decals to say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah forward decals are basically transparent objects, so they won't work as well with TAA and such.
|
Here's some decals, as requested @alice-i-cecile graffiti, arrow, "footprint", and wall dirt are all forward decals. Here's the blender setup, for kicks if anyone is interested. |
|
Closing in favor of #2106 |



Fixes #1980. No image yet: none of the existing ones properly show off this feature.