godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

[TRACKER] Visual Shader nodes wishlist #5106

Open QbieShay opened 2 years ago

QbieShay commented 2 years ago

Describe the project you are working on

Various VFX

Describe the problem or limitation you are having in your project

Some nontrivial VS nodes are missing.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Adding a couple of nodes to reach feature parity with what spatial shaders and canvas shaders can offer out-of-the-box.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Spatial:

Particles:

If this enhancement will not be used often, can it be worked around with a few lines of script?

It can, but it's about improving VS UX.

Is there a reason why this should be core and not an add-on in the asset library?

It can, but it's about improving VS UX.

Calinou commented 2 years ago

Camera fade

This one should probably be named Distance Fade for consistency with the BaseMaterial3D parameter of the same name.

QbieShay commented 2 years ago

@Calinou fixed :+1:

paddy-exe commented 2 years ago

I would also propose these VS nodes:

fire-forge commented 2 years ago

Remap (see comment)

This could be called "Range Lerp" to match the range_lerp() GDScript function.

It would also be nice to add the range_lerp() function to the shading language as well. I've been copy pasting this function into shaders as I need it (adapted from the C++ function in Godot's source code):

float range_lerp(float value, float istart, float istop, float ostart, float ostop) { 
         return ostart + (ostop - ostart) * ((value - istart) / (istop - istart)); 
 }

EDIT: I opened a proposal for this: https://github.com/godotengine/godot-proposals/issues/5112

paddy-exe commented 2 years ago

I actually forgot about the linearized depth from the depth_texture. Correct me if I am wrong, but I haven't seen a usecase where the logarithmic scale (default) was used instead of the linearized one🤔

https://docs.godotengine.org/en/stable/tutorials/shaders/screen-reading_shaders.html#depth-texture