godot icon indicating copy to clipboard operation
godot copied to clipboard

Visual shader plugin complains about missing version and category

Open eobet opened this issue 1 year ago • 4 comments

Tested versions

4.3 rc3

System information

Godot v4.3.rc3 - Nobara Linux 40 (GNOME Edition) - Wayland - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3050 Ti Laptop GPU - 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz (8 Threads)

Issue description

Unless I've misread, this page seems to indicate that these are optional:

https://docs.godotengine.org/en/stable/classes/class_visualshadernodecustom.html#class-visualshadernodecustom

But still I get this:

image

And not sure why the other errors don't correspond to a line in my .gd file but rather some other files I don't know how to debug, because I'm just slightly modifying this example, and haven't changed much.

But still I've seen at least the category warning in another plugin and seems it shouldn't be there.

Steps to reproduce

Try to use the attached shader.

Minimal reproduction project (MRP)

VSSimplexNoise3D.zip

eobet avatar Aug 12 '24 20:08 eobet

The Parameter "version" is null. error is not about shader metadata. It means that shader compilation failed (you can see the corresponding shader code being printed just above).

Regarding the missing category warning, I think it could be removed indeed since the documentation already hints at the fallback behavior that happens otherwise.

Calinou avatar Aug 12 '24 20:08 Calinou

Thanks, I guess what makes this even more cryptic is that if I take the quoted parts and paste it into a .gdshader there is no error at all...

eobet avatar Aug 12 '24 22:08 eobet

On the topic of cryptic/shader errors, trying to figure out what is wrong (using this modification) I now get the following also not very helpful error:

image

Plus, not sure if it's because I removed a previously used shader add-on (but I think I've been careful removing all nodes in my visual shaders), but I've also seen this:

image

I don't recognize any names of anything in the above, so it's pointing to some core Godot thing and not anything that I created and named?

Since I'm using visual shaders... which hopefully are meant to be geared towards (tech) artists and not developers.... I was hoping that the errors would be more "artist friendly"...

...for example, ideally I'd be able to click on one of those error messages and the visual shader would zoom to the relevant node with perhaps a relevant highlight (but I realize this is because reusable custom visual shader nodes currently require .gd text file and unfortunately can't be crafted from within visual shaders themselves).

EDIT: Oh, does the example I based my custom visual node on need to be updated in the official documentation perhaps? image

eobet avatar Aug 17 '24 19:08 eobet

Ok, since the fixed syntax actually provides a result I am able to press play to test run my game and then I get an error message that I can actually understand where it's coming from:

image

So that's this line, but I don't understand what's wrong with it because the input port function looks exactly the same and I get no complaints there (and it seems to work):

func _get_output_port_type(_port):
	return VisualShaderNode.PORT_TYPE_VECTOR_3D

eobet avatar Aug 17 '24 22:08 eobet

I am seeing the same warning about the category, which is what brought me here.

Screenshot 2024-10-28 092156

Both of these custom nodes are in a shader that I had applied multiple times, so I'm getting the warnings for each use. I made these custom shaders in another project and imported them into this one. Both have a category defined - in fact using the same one from the Perlin Noise generation example.

Screenshot 2024-10-28 092218

Screenshot 2024-10-28 092227

It seems that the warning is incorrect, as well as superfluous.

dragonforge-dev avatar Oct 28 '24 15:10 dragonforge-dev