1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add Particle Shader Userdata

* Adds optional vec4 USERDATA1 .. USERDATA6 to particles, allowing to store custom data.
* This data is allocated on demand, so shaders that do not use it do not cost more.
This commit is contained in:
reduz
2022-02-14 13:27:10 +01:00
parent 171021145d
commit 4f73d3beb4
10 changed files with 148 additions and 35 deletions

View File

@@ -3683,6 +3683,15 @@ void RendererSceneCull::_update_dirty_instance(Instance *p_instance) {
_instance_update_mesh_instance(p_instance);
}
if (p_instance->base_type == RS::INSTANCE_PARTICLES) {
// update the process material dependency
RID particle_material = RSG::storage->particles_get_process_material(p_instance->base);
if (particle_material.is_valid()) {
RSG::storage->material_update_dependency(particle_material, &p_instance->dependency_tracker);
}
}
if ((1 << p_instance->base_type) & RS::INSTANCE_GEOMETRY_MASK) {
InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(p_instance->base_data);