-
Hey, is it possible to store computations done in the vertex shader persistently, so that they don't have to be redone every frame? Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes, you can store any computation you want inside vertex attributes. We provide 8 attributes for your own use: custom0-7. Then, in the material you can mark them as "required" and access them via Note that these attributes must be computed on the CPU. |
Beta Was this translation helpful? Give feedback.
Yes, you can store any computation you want inside vertex attributes. We provide 8 attributes for your own use: custom0-7. Then, in the material you can mark them as "required" and access them via
getCustom0()
. https://google.github.io/filament/Materials.html#materialdefinitions/materialblock/vertexandattributes:requiresNote that these attributes must be computed on the CPU.