+2 votes

I'm using Godot v3.1

I'm trying to follow the "Animating thousands of fish" tutorial but run into trouble right away.

The tutorial states: "Load your fish model into a MeshInstance and add a new ShaderMaterial."

The site the tutorial links to where the model is located has an .obj version, but it has no coloring when imported into Godot, so instead I downloaded the .blend file and used the better collada exporter to get a .dae instead. I imported it, saved the Mesh as a resource and discarded the rest of the scene.
Then I load this mesh into a MeshInstance.

This mesh has 3 surface material slots to color the fish, but no matter where I put the ShaderMaterial, for example in the GeometryInstance's "material override", the color is partially or completely lost.

The only workaround I can find is by converting each surface slot's SpatialMaterial into a ShaderMaterial, then putting the tutorial's shader code inside, but this requires copying the shader into all 3 surfaces!

The tutorial doesn't mention anything like this and seems to have no problems keeping the full color while also animating the fish.

How can I add this ShaderMaterial to animate the whole model without losing the surface materials' colors?

in Engine by (14 points)
retagged by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.