Giter Site home page Giter Site logo

Comments (1)

clayjohn avatar clayjohn commented on June 16, 2024

This will need a bit of investigation to track down. But I think there is one of three things to look for:

  1. We may need to notify the dependency system that the variable changed like we do for skeletons:
    skeleton->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_SKELETON_BONES);
  2. We may need to set the instance to dirty some other way when updating blend shapes. Maybe here:
    void MeshStorage::mesh_instance_set_blend_shape_weight(RID p_mesh_instance, int p_shape, float p_weight) {
    MeshInstance *mi = mesh_instance_owner.get_or_null(p_mesh_instance);
    ERR_FAIL_NULL(mi);
    ERR_FAIL_INDEX(p_shape, (int)mi->blend_weights.size());
    mi->blend_weights[p_shape] = p_weight;
    mi->weights_dirty = true;
    //will be eventually updated
    }

For context instance_set_blend_shape_weight() will try to update the instance if it is already dirty.

void RendererSceneCull::instance_set_blend_shape_weight(RID p_instance, int p_shape, float p_weight) {
Instance *instance = instance_owner.get_or_null(p_instance);
ERR_FAIL_NULL(instance);
if (instance->update_item.in_list()) {
_update_dirty_instance(instance);
}
if (instance->mesh_instance.is_valid()) {
RSG::mesh_storage->mesh_instance_set_blend_shape_weight(instance->mesh_instance, p_shape, p_weight);
}
}

If the instance is flagged as dirty, then we will mark the shadows as dirty. But we could also do it manually when blend shapes are modified:

if (geom->can_cast_shadows) {
for (HashSet<RendererSceneCull::Instance *>::Iterator I = geom->lights.begin(); I != geom->lights.end(); ++I) {
InstanceLightData *light = static_cast<InstanceLightData *>((*I)->base_data);
light->make_shadow_dirty();
}
}

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.