@@ -3,7 +3,7 @@ tags: particlefx, sprite, material, 3d
33title : Billboarding
44brief : This example shows how to make sprites and particle sprites face the camera using a custom vertex shader.
55author : Defold Foundation
6- scripts : main /billboard.vp
6+ scripts : example /billboard.vp
77thumbnail : thumbnail.png
88---
99
@@ -16,9 +16,9 @@ The effect is used in two places:
1616
1717## Material setup
1818
19- Create a custom material for billboarding (for example ` main/material /billboard.material` ) and set it up like this:
19+ Create a custom material for billboarding (for example ` example /billboard.material` ) and set it up like this:
2020
21- - ** Vertex program:** ` main/material /billboard.vp`
21+ - ** Vertex program:** ` example /billboard.vp`
2222- ** Fragment program:** ` /builtins/materials/particlefx.fp `
2323 - This keeps standard particle/sprite sampling, tinting and alpha handling.
2424
@@ -57,19 +57,19 @@ The material must provide these shader inputs:
5757The foliage and rock game objects (for example ` assets/foliage/tree1.go ` and ` assets/foliage/rock1.go ` ) each contain:
5858
59591 . A ** Sprite** component using the atlas ` assets/foliage/foliage.atlas `
60- 2 . The material ` main/material /billboard.material`
60+ 2 . The material ` example /billboard.material`
61613 . A per-sprite vertex attribute:
6262 - ` billboard_mode = 1.0 ` (axis-locked billboard; see below)
6363
6464This is enough to make each sprite face the camera without changing the sprite's transform in the game logic.
6565
6666![ Sprite setup] ( doc/setup_sprite.png )
6767
68- ## ParticleFX setup (smoke)w
68+ ## ParticleFX setup (smoke)
6969
70- The smoke effect is defined in ` main /smoke.particlefx` . The relevant settings are:
70+ The smoke effect is defined in ` assets/smoke /smoke.particlefx` . The relevant settings are:
7171
72- 1 . ** Emitter material:** ` main/material /billboard.material`
72+ 1 . ** Emitter material:** ` example /billboard.material`
73732 . ** Emitter attribute:** ` billboard_mode = 0.0 ` (screen-aligned billboard; see below)
74743 . ** Emission space:** ` World `
7575 - This ensures particles exist in world space, while still being oriented towards the camera by the vertex shader.
0 commit comments