+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?

asked Apr 30, 2019 in Engine by GlaceGwyneth (14 points)
retagged Apr 30, 2019 by GlaceGwyneth

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 How to use this Q&A? before posting your first questions.