InstancedMesh + implement billboard

Of course needs.

@11170 @Chaser_Code
Guys, any thoughts on what has to be changed to make it work as expected?

I dont know about istancedmesh. I am using only istancedBufferGeometry for sprites with fixing face to camera all xyz, fixed xz like sprite, fixed xz like distance, rotated by quaternion. And all is 1 draw call with different textures while without atlas.

Using InstancedMesh, you’ll get the same 1 drawcall, but I didn’t get how the amount of drawcalls relates to the issue with rotation.
I solved it with one additional line of code:

        _z1.setY(0).negate().normalize();
        planes.worldToLocal(_z1); // add this
        q.setFromUnitVectors(_z0, _z1);

Creating an atlas is a lot more work than you think.
The work efficiency is definitely reduced.
Of course, it is very good to have one atlas in the web environment. It is also efficient in downloading.
The reason I chose instancedMesh is because I think it has an advantage in terms of management.
I am currently making effects, but only Points have their limitations.
Points uses only one vertex. However, sometimes effects can take many forms.
To overcome that limitation, I used instancedMesh.
lightning

thank you. The problem has been resolved.

sorry.
I noticed that the billboard didn’t work well when the instancedMesh was moved.

https://jsfiddle.net/avatar_studio/nb4qwp3g/22/

is this solved? i use obj.quaternion.copy(camera.quaternion) and it’s worked out great. though i have yet to try positioning on the shader, this is on the cpu.

@drcmda
It would be that simple, if the author wouldn’t need rotation on y-axis only :slight_smile:

Thank you for answer. For the effect, we need a billboard that rotates only on the y-axis.
I don’t know how to use shaders, so this part is very difficult.

I applied what you said to terrain grass.
There were good results.
However, it does not move back and forth like the wind blows, which is unnatural.
How can I make this possible?

Seems a good start: Simple instanced grass example

thank you.
this is applied