Replies: 1 comment
-
another supporting argument for local variable registration: instead of being able to register the different directions based off a global shader value "OUTLINE_WIDTH" and reuse them throughout the shader, i have to recreate the vectors each time i want to offset uvs in the different textures. Technically i dont have to...but it will end up looking like this: POSSIBLE SOLUTION: maybe theres a solution that could come from a modified expression node, where it doesnt have inputs and outputs, but only 1 type depending on if its a Register or Get. the variables in the Register end up "locally registered", meaning they arent encapsulated like the current expression is. this node type would be the first one to write in the compiled shader logic so that its registered right at the top of the function and all the other shader code would have access to created variables. basically its a node that just writes whatever you put in it at the top of the function, similar to how the global expression writes (except inside the function locally), if any of what i said makes sense. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Just a suggestion for some additional parameters to be displayed in a materials parameter options when viewed from the inspector, specifically the Filter and Repeat options inside the Texture2DParameter.
Example use case would be if you wanted to have multiple materials with different texture inputs and also wanted to control the filter and repeat style per material. You could have 1 shader written, applied to all materials, and customize the individual material rather than having to create multiple shaders.
I realize that the shader ends up being generated with tags
uniform sampler2D Atlas : filter_nearest, repeat_enable;
so it may be more difficult than "just adding it" but it would be nice to have that control somehow
//////////////////////////////////////////////
Registering and Getting local variable nodes (not to be confused with set/get varying.) these nodes are purely for organization of nodes when working inside the visual shader editor.
1.) Register Local Var :
2.) Get Local Var:
having these 2 nodes would drastically improve workflow and organization when using the visual shader editor window. without the nodes you sometimes end up with a rat nest of connections spanning across the window. sometimes you generate a value from some nodes and it needs to be reused in multiple different areas/stages of your shader. definitely a quality of life improvement.
i still have to add more to this shader, these nodes would help a lot:

Beta Was this translation helpful? Give feedback.
All reactions