#Update morphAttributes on geometry

21 messages · Page 1 of 1 (latest)

burnt lotus
#

I know as of now morphAttributes cannot be updated on BufferGeometry without creating new instance. But after going through the discussion here: https://github.com/mrdoob/three.js/issues/24243, I got to know something can be done about this.

I looked into source and found this is responsible for uploading morphs to GPU: https://github.com/mrdoob/three.js/blob/6a101b4bffdf5b00d24931c2e50817d3a179fa25/src/renderers/WebGLRenderer.js#L1868-L1872

could someone help me how to properly update morphAttributes whenever I wish to?

bronze merlin
#

well, mugen pretty much told you what to do

b) the count of morph targets has been changed

#

add/remove a dummy target every time

#

and I assume this applies to webgl2

burnt lotus
bronze merlin
#

super-hacky but might work 🤣

#

or maybe that should be done for morphTargetCount origin

#

just a general idea. I used to successfully fight against double-draw of transparent objects when it was introduced using this method

burnt lotus
bronze merlin
#

but still goes to show how far this kind of trick can take you

burnt lotus
#

after seeing this, i think dummy targets idea is better. because the moment there is one more read call, this breaks right?

bronze merlin
#

of course. but there is new Error().stack if you want to keep digging the hole

burnt lotus
#

woah, super unconventional to get the caller

bronze merlin
#

to get all the callers

#

and run regexp on them 🥲

burnt lotus
#

Can break any moment

bronze merlin
#

I mean, three.js semver starts with 0

#

it is expected to break