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
I don't know if the second code create a array per fragment execution or not. Is there a way to debug this type of things?
If this enhancement will not be used often, can it be worked around with a few lines of script?
No, there isn't a performance workaround. You could simple put the array inside the fragment or vertex, but the array will be create once per iteration (I belive). This is why global const are usefull, they are only created once.
Is there a reason why this should be core and not an add-on in the asset library?
I don't think you can have shaders addons
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
Trying to make shader effects on sprites.
Describe the problem or limitation you are having in your project
I'm trying to create a const array to loop troght in the fragment function.
I don't know if this proposal is related to #931. It is basically the same thing but for consts.
When I read the documentation I thinked that would work for both closure and global. But nope they only work inside a function.
https://docs.godotengine.org/en/3.3/tutorials/shading/shading_reference/shading_language.html#constants
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add the option to use const with array
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
As a example:
This dont compile "error(4): - Expected initialization of constant":
This compile:
I don't know if the second code create a array per fragment execution or not. Is there a way to debug this type of things?
If this enhancement will not be used often, can it be worked around with a few lines of script?
No, there isn't a performance workaround. You could simple put the array inside the fragment or vertex, but the array will be create once per iteration (I belive). This is why global const are usefull, they are only created once.
Is there a reason why this should be core and not an add-on in the asset library?
I don't think you can have shaders addons
The text was updated successfully, but these errors were encountered: