godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.81k stars 20.14k forks source link

Visual shader plugin complains about missing version and category #95443

Open eobet opened 1 month ago

eobet commented 1 month ago

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

Calinou commented 1 month ago

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.

eobet commented 1 month ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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