Ultimaker / Uranium

A Python framework for building Desktop applications.
GNU Lesser General Public License v3.0
323 stars 185 forks source link

CURA-11984 Fix some models not supporting "align to buildplate" #956

Closed wawanbreton closed 1 month ago

wawanbreton commented 2 months ago

Instead of using a dynamic number of bits for the face index, store the object ID in the alpha channel, which was previously unused. This way we have the full 24 bits of the RGB channels to store the face index.

OpenGL blending is disabled for this pass, so the alpha channel is just stored as an extra channel but no calculation is performed based on it.

CURA-11984

wawanbreton commented 1 month ago

Looks good! I don't fully remember why I initially did the alpha that way ... it might've been part of another shader first.

Maybe because the alpha can be modified during the OpenGL pipeline processing, so it is a bit more sensitive.

The only thing I do notice is that if current_model_id >= 128: can probably be replaced with if current_model_id >= 255: now.

Good catch, that is true :) I'll make a commit