You've already forked godot
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user