Alchemist0823 / three.quarks

Three.quarks is a general purpose particle system / VFX engine for three.js
https://quarks.art
480 stars 22 forks source link

Horizontal- & Vertical billboards #69

Closed marwie closed 11 months ago

marwie commented 11 months ago

Hello,

prior to 0.10.6 (in version 0.7.3) we could create horizontal and vertical billboarding by modifying the mesh geometry. This doesn't work anymore. Is there a way to add this behaviour again?

Old code:

if (renderMode === ParticleSystemRenderMode.HorizontalBillboard) {
            geo = new THREE.BoxGeometry(1, 1, 0);
        }
        else if (renderMode === ParticleSystemRenderMode.VerticalBillboard) {
            geo = new THREE.BoxGeometry(1, 0, 1);
        }
Alchemist0823 commented 11 months ago

Hi @marwie, I will look into this.

marwie commented 11 months ago

Thank you

Alchemist0823 commented 11 months ago

@marwie , I think it's probably on your own private branch. I went back to 0.7.3. and didn't find Vertical and Horizontal Billboard. right now you can do:

            instancingGeometry: new PlaneGeometry(1, 1).rotateX((-90 / 180) * Math.PI),
            renderMode: RenderMode.Mesh,

to support horizontal billboard. I don't think we support vertical billboard that always face camera. we will it to our future feature list.

Alchemist0823 commented 11 months ago

BoxGeometry has 6 faces 12 triangles, it's not efficient to do billboard rendering.

marwie commented 11 months ago

We dont have a private branch or fork. The code above is in needle engine and worked in quarks 0.7.3 as mentioned above to make particles behave correctly.

I will try what you suggest soon, thank you. And adding this feature would be great :)

Alchemist0823 commented 11 months ago

@marwie added support for vertical & horizon billboard

marwie commented 11 months ago

Works like a charm, thank you