+1 vote

I have a question regarding performances (in 3d)

If I have several small objects like a pencil, a bottle, a radio each one of them using a 256 * 256 texture. Would it be better to create a texture atlas and shared material. For instance a 512 * 512 texture containing all 4 objects?

In the end there would be 4 objects but only one material

in Engine by (34 points)

1 Answer

+3 votes

Document says YES.


Reuse shaders and materials

Godot renderer is a little different to what is out there. It’s designed to minimize GPU state changes as much as possible. FixedMaterial does a good job at reusing materials that need similar shaders but, if custom shaders are used, make sure to reuse them as much as possible. Godot’s priorities will be like this:

  • Reusing Materials: The less amount of different materials in the scene, the faster the rendering will be. If a scene has a huge amount of objects (in the hundreds or thousands) try reusing the materials or in the worst case use atlases.

  • Reusing Shaders: If materials can’t be reused, at least try to re-use shaders (or FixedMaterials with different parameters but same configuration).

If a scene has, for example, 20.000 objects with 20.000 different materials each, rendering will be really slow. If the same scene has 20.000 objects, but only uses 100 materials, rendering will be blazing fast.

by (9,768 points)
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.