Godot-proposals: Uniform sampler ports in Visual Shader

Created on 16 Sep 2019  路  3Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
Visual shader plugin with many premade effects (something like Unity plugin Shadero Sprite)
Describe how this feature / enhancement will help your project:
Currently it's impossible to get access to uniform sampler2D. It's necessary for multisample effects. For example, I can't create blur, chromatic aberration, outline nodes. With access to uniform textures (not only TEXTURE) it'll be possible to create more complex materials.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
There are Sampler Uniform node, and Texture Uniform node.
img_5c4408609b50c~01

Describe implementation detail for your proposal (in code), if possible:
[1] should be moved to new uniform sampler node. Add new PORT_SAMPLER to PortType enum in VisualShaderNode. Add sampler input node [2] to TextureUniform.
Or maybe just add PORT_SAMPLER and UniformSampler node without changing texture uniform node.
visual_frag_shader~01

If this enhancement will not be used often, can it be worked around with a few lines of script?:
It can't be worked around, as i know (only with expression node, but as iFire said, it's a bug)
Is there a reason why this should be core and not an add-on in the asset library?:
Because sampler2D is core data type.

shaders

Most helpful comment

All 3 comments

@Chaosus , can you take a look, please?

TextureUniform is actually declaring the uniform. It makes sense to add the sampler port to the output of this node, not an input. Its a little confuse that this node using _uv_ and _lod_ input parameters, so I guess they may be removed if we are not preserve backward compatibility for 4.0. The sampler input port should be added to Texture node which can be renamed to SampleTexture2D. That's my thoughts.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PLyczkowski picture PLyczkowski  路  3Comments

SleepProgger picture SleepProgger  路  3Comments

aaronfranke picture aaronfranke  路  3Comments

SpyrexDE picture SpyrexDE  路  3Comments

davthedev picture davthedev  路  3Comments