Skip to content

Commit d1f046f

Browse files
ChristopherBiscardialice-i-cecileIceSentryJMS55
authored
Adopted Decals Release Notes 0.16 (#2106)
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: IceSentry <IceSentry@users.noreply.github.com> Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
1 parent 2dd9e60 commit d1f046f

File tree

6 files changed

+36
-20
lines changed

6 files changed

+36
-20
lines changed
94.1 KB
Loading
1.59 MB
Loading

release-content/0.16/release-notes/16600_Forward_decals_port_of_bevy_contact_projective_decals.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

release-content/0.16/release-notes/17315_Implement_basic_clustered_decal_projectors.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

release-content/0.16/release-notes/_release-notes.toml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ prs = [17096]
9393
file_name = "17096_Anamorphic_Bloom.md"
9494

9595
[[release_notes]]
96-
title = "Forward decals (port of bevy_contact_projective_decals)"
97-
authors = ["@JMS55"]
98-
contributors = ["@IceSentry"]
99-
prs = [16600]
100-
file_name = "16600_Forward_decals_port_of_bevy_contact_projective_decals.md"
96+
title = "Decals"
97+
authors = ["@naasblod", "@JMS55", "@pcwalton"]
98+
contributors = ["@IceSentry", "@NiseVoid", "@DGriffin91"]
99+
prs = [16600, 17315]
100+
file_name = "decals.md"
101101

102102
[[release_notes]]
103103
title = "Procedural atmospheric scattering"
@@ -106,13 +106,6 @@ contributors = ["@mate-h", "@atlv24", "@JMS55"]
106106
prs = [16314]
107107
file_name = "16314_Procedural_atmospheric_scattering.md"
108108

109-
[[release_notes]]
110-
title = "Implement basic clustered decal projectors."
111-
authors = ["@pcwalton"]
112-
contributors = []
113-
prs = [17315]
114-
file_name = "17315_Implement_basic_clustered_decal_projectors.md"
115-
116109
[[release_notes]]
117110
title = "Specular tints and maps"
118111
authors = ["@pcwalton"]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
**Decals** are textures which can be dynamically layered on top of existing meshes, conforming to their geometry.
2+
This has two benefits over simply changing a mesh's texture:
3+
4+
1. You can add them dynamically in response to player actions. Most famously, bullet holes in FPS games use decals for this.
5+
2. You don't need to create an entirely new texture for every combination, which makes them more efficient and flexible when creating levels with details like graffiti or cracks in building facades.
6+
7+
Like many things in rendering, there are a huge number of ways to implement this feature, each with their own tradeoffs.
8+
In Bevy 0.16, we've selected two complementary approaches: **forward decals** and **clustered decals**.
9+
10+
![decals](decals.png)
11+
12+
Our implementation of forward decals (or to be more precise, contact projective decals) was inspired by [Alexander Sannikovs talk on the rendering techniques of Path of Exile 2], and was upstreamed from the [`bevy_contact_projective_decals`] ecosystem crate.
13+
Due to nature of this technique, looking at the decal from very steep angles will cause distortion.
14+
This can be mitigated by creating textures that are bigger than the effect, giving the decal more space to stretch.
15+
To create a forward decal, spawn a [`ForwardDecal`] entity, which uses a [`ForwardDecalMaterial`] using the [`ForwardDecalMaterialExt`] material extension.
16+
17+
![clustered decals](clustered-decals.png)
18+
19+
Clustered decals (or decal projectors) work by projecting images from a 1x1x1 cube onto surfaces found in the +Z direction.
20+
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.
21+
To create a clustered decal, spawn a [`ClusteredDecal`] entity.
22+
23+
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.
24+
Currently clustered decals require bindless textures and thus don't support WebGL2, WebGPU, iOS and Mac targets. Forward decals _are_ available on these targets.
25+
26+
[Alexander Sannikovs talk on the rendering techniques of Path of Exile 2]: https://www.youtube.com/watch?v=TrHHTQqmAaM
27+
[`bevy_contact_projective_decals`]: https://github.com/naasblod/bevy_contact_projective_decals
28+
[`ForwardDecal`]: https://dev-docs.bevyengine.org/bevy/pbr/decal/struct.ForwardDecal.html
29+
[`ForwardDecalMaterial`]: https://dev-docs.bevyengine.org/bevy/pbr/decal/type.ForwardDecalMaterial.html
30+
[`ForwardDecalMaterialExt`]: https://dev-docs.bevyengine.org/bevy/pbr/decal/struct.ForwardDecalMaterialExt.html
31+
[`ClusteredDecal`]: https://dev-docs.bevyengine.org/bevy/pbr/decal/clustered/struct.ClusteredDecal.html

0 commit comments

Comments
 (0)