How to write a description of public variables in a shader?

Godot Version

v4.2.2.stable.official [15073afe3]

Question

In a component, I can write a nice description for the variables (or properties).
So when I hover over these variables I see a description (or a hint).

This is a very convenient feature. Thanks to it, you don’t have to open every script and remember what certain variables mean. Especially if there is more than one programmer in the team.

And so, the question.
Can this be done in shaders?

So far, no matter what I try, I see “no description available”.

And this inscription sounds like - there should be a description here, but it is not available:)

“##” - does not work. And it’s logical, because it’s a different language.

I found this question on reddit, but there is no solution:
https://www.reddit.com/r/godot/comments/1bqaqrd/c_documentation_comments/

So if you have any thoughts on this, I’d be reeeally happy to hear it!

1 Like

If you are wondering this question like me…

You can use this format:

/**
 * This is a documentation comment.
 * These lines will appear in the inspector when hovering the shader parameter
 * named "Something".
 * You can use [b]BBCode[/b] [i]formatting[/i] in the comment.
 */
uniform int something = 1;

But for this you need the godot version 4.3
This feature is not available in version 4.2

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.