Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I update skinnedMesh.mesh.props_color32 in runtime? #22

Open
kaisunc opened this issue Nov 14, 2024 · 1 comment
Open

Can I update skinnedMesh.mesh.props_color32 in runtime? #22

kaisunc opened this issue Nov 14, 2024 · 1 comment

Comments

@kaisunc
Copy link

kaisunc commented Nov 14, 2024

            skinnedMesh.mesh.props_color32 = new Color32((byte)255, (byte)0, (byte)0, (byte)255);
            skinnedMesh.mesh.DirtyFlags = DirtyFlag.props_Color;
            skinnedMesh.UpdateAll();
            m.Update(Time.deltaTime);

doesn't do anything. Is there another way?

@mkrebser
Copy link
Owner

mkrebser commented Nov 14, 2024

Make sure that your shader is actually using the instance color. You will need to write the shader yourself.

Example shader: https://github.com/mkrebser/GPUInstance/blob/master/Assets/Resources/GPUInstance/instancemeshdefault.shader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants