Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TRACKER] Visual Shader nodes wishlist #5106

Open
QbieShay opened this issue Aug 8, 2022 · 5 comments · May be fixed by godotengine/godot#87173
Open

[TRACKER] Visual Shader nodes wishlist #5106

QbieShay opened this issue Aug 8, 2022 · 5 comments · May be fixed by godotengine/godot#87173

Comments

@QbieShay
Copy link

QbieShay commented Aug 8, 2022

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:

  • RotationMatrix node (supply axis and angle, return transform and/or transformed vertex)
  • Proximity fade
  • Distance fade
  • Rand from seed (copy-pasted from particles)
  • Rand between two values (can substitute above)
  • Polar coordinates (with two modes, from polar and to polar)
  • Remap (see comment)

Particles:

  • Turbulence

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
Copy link
Member

Calinou commented Aug 8, 2022

Camera fade

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

@QbieShay
Copy link
Author

QbieShay commented Aug 8, 2022

@Calinou fixed 👍

@paddy-exe
Copy link

paddy-exe commented Aug 8, 2022

I would also propose these VS nodes:

  • Random value between two given given values

  • Ramap node (like the Map Range in Blender)
    image

  • PolarCoord node which transforms the given UV coordinates into polar coordinates (like GradientTexture in Blender)

  • CardinalCoord node which transforms the given polar coordinates into cardinal coordinates

@fire-forge
Copy link

fire-forge commented Aug 8, 2022

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: #5112

@paddy-exe
Copy link

paddy-exe commented Aug 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants