-
-
Notifications
You must be signed in to change notification settings - Fork 691
Open
Description
Godot version
4.5.1.stable
godot-cpp version
4.5.stable
System information
All supported systems
Issue description
I'm currently developing a custom material type that inherits directly from the material class. My problem is that the get_rid and get_material methods are always returns a null RID. Even if I override _get_rid, it remains unchanged.
I investigated a bit more closely and it seems that the set_material method of the Material class is missing within the engine in the C++ bindings.
This seems to be a problem in GDScript as well.
I thought it was possible, since the documentary claims this:
Importantly, you can inherit from Material to create your own custom material type in script or in GDExtension.
Steps to reproduce
- Create a new C++ Class and inherit from Material
- Create a new material using
godot::RenderingServer::get_singleton()->material_create();and set a shader usinggodot::RenderingServer::get_singleton()->material_set_shader(m_MaterialRid, Shader); - Overwrite
godot::RID _get_rid() constand return the RID, which was created usingmaterial_create. - Try to set a uniform variable
godot::RenderingServer::get_singleton()->material_set_param(get_rid(), "metallic", 2.0);orgodot::RenderingServer::get_singleton()->material_set_param(get_rid(), "metallic", 2.0); - You will get an error message, that the RID is null.
Minimal reproduction project
N/A
Metadata
Metadata
Assignees
Labels
No labels