Add to_Vector_array() method into the PackedByteArray class. #6500
Egor-Stasenko
started this conversation in
Engine Core
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the project you are working on
A kind of colony simulation.
Describe the problem or limitation you are having in your project
In compute shaders in order to pass data it is required to convert PackedArray of data into PackedByteArray and back to its original type after the shader was executed. This can be done only with PackedFloat- and PackedInt- Arrays now.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add to_Vector_array() method into the PackedByteArray class.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I'm sorry but I don't know how other similar methods are implemented.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This can be done by creating three(or two, depending on which kind of vector is needed) separate arrays of floats and making different buffer to each one. Another way is to create one array of floats but 3 times bigger and use offset for each coordinate. It is much slower in the first case and not so comfortable in the second.
Is there a reason why this should be core and not an add-on in the asset library?
It is strange that there is a way to convert PackedVectorArray into PackedByteArray but not vice versa.
PS: I'm sorry for my English and if I have used wrong repository again.
Beta Was this translation helpful? Give feedback.
All reactions