You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could we have an example of how to write your custom Transform system?
The current Transform exactly packs a 3d translation, rotation and scale ; but there are plenty of cases where you could want more (other affine transformations like shearing (#14622, #4822), projective transformations (#4207), nonlinear stuff, etc), less (2D, no rotations, uniform scaling, etc), or just some custom behaviour (asteroid, portal).
My understanding is that it would either imply writing a PostUpdate system that handle the custom behaviour and output into a GlobalTransform, or a vertex shader to apply a custom mat4x4 plus the camera transform (while loosing on the hierarchical composition), or both for simpler cases if you also want to limit the cpu->gpu data sent.
There are no example for using a custom vertex shader while reusing the standard pixel shader, so that would be great too! Although this question is primarly about a cpu-side example for writing to GlobalTransform.
I also just found in #4822 (reply in thread)@HackerFoo made a fork that did something similar, but I think now that GlobalTransform is an Affine3A, it should be significantly simpler?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Could we have an example of how to write your custom
Transform
system?The current
Transform
exactly packs a 3d translation, rotation and scale ; but there are plenty of cases where you could want more (other affine transformations like shearing (#14622, #4822), projective transformations (#4207), nonlinear stuff, etc), less (2D, no rotations, uniform scaling, etc), or just some custom behaviour (asteroid, portal).My understanding is that it would either imply writing a
PostUpdate
system that handle the custom behaviour and output into a GlobalTransform, or a vertex shader to apply a custom mat4x4 plus the camera transform (while loosing on the hierarchical composition), or both for simpler cases if you also want to limit the cpu->gpu data sent.There are no example for using a custom vertex shader while reusing the standard pixel shader, so that would be great too! Although this question is primarly about a cpu-side example for writing to
GlobalTransform
.I also just found in #4822 (reply in thread) @HackerFoo made a fork that did something similar, but I think now that
GlobalTransform
is anAffine3A
, it should be significantly simpler?Beta Was this translation helpful? Give feedback.
All reactions