playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.67k stars 1.35k forks source link

Additional morph target functionality #2126

Open mvaligursky opened 4 years ago

mvaligursky commented 4 years ago

There is a need currently to call user callbacks during glb loading, to allow users to access custom glb data.

When this is implemented, implement these addition features for morph targets:

mvaligursky commented 4 years ago

suggestion by @slimbuck regarding storing morph targets in smaller space:

Actually, having recently worked with RGBE format for images, I wonder whether you couldn't do exactly the same with position/normal data? You can see pack/unpack implemented at https://github.com/slimbuck/engine/blob/hdr-parser/src/graphics/program-lib/chunks/reproject.frag#L55

mvaligursky commented 4 years ago

Note: Half float precision has been implemented now.

mvaligursky commented 4 years ago

on iOS with OS version prior to about November 2019, half textures can be used as render targets / textures, but data cannot be uploaded to those textures. At the moment this makes morphing to not using texture based morphing on those devices. We could considering initializing those textures by rendering to them instead (encode uv as position, value to be written as 3 x float data, and render to it.

mvaligursky commented 3 years ago

related to https://github.com/playcanvas/engine/issues/2560

mvaligursky commented 3 years ago

on iOS with OS version prior to about November 2019, half textures can be used as render targets / textures, but data cannot be uploaded to those textures. At the moment this makes morphing to not using texture based morphing on those devices. We could considering initializing those textures by rendering to them instead (encode uv as position, value to be written as 3 x float data, and render to it.

This is no longer the case: https://github.com/playcanvas/engine/pull/2988