IndexOB not working as expected

Jump to:

I've seen that IndexOB Auto pass is not working as I think is correct, maybe i'm wrong, but every object should get an unique ID, but I've seen that sometimes 2 different objects get the same Id and makes difficult to became a viable mask solution. (Sometimes when they one in front of the other, which is worse).

I have a question about this request: you mention that the Auto ID passes should generate automatically an integer number.

My question is: what image format is this going to be exported to? The internal values are in floating point format. If I assign, let's say, color = 1.0, 2.0, 3.0, etc to the different objects and you have, for example 100,000 objects, it will reach the number 100,000.0

If you export this into floating point formats such as EXR it might be ok (unless it uses the Half 16bit format, when it will not have enough precision), but if you export to PNG, etc it will be pretty much useless (as 1.0 will become already 255 in the file, so values higher than 1.0 will not even appear). Even if I try to get it to generate integer values in the PNG file, they will only go from 1 to 255 and that's it, unless I use the RGB(A) color channels to store integers in each one, but then the image will appear colored and you will have to "decode" them.

Or do you plan to use Blender composition nodes directly?

From a coding perspective, it's not difficult to create these "numeric auto ID" passes, but I want to know what's the best way of implementing it.

Finaly I've made the decision of implementing these new Material/Object Automatic Index passes as "absolute", therefore generating values such as 1.0, 2.0, 3.0, etc. This pass will be useless when exported to JPG, PNG, etc, but it will be useful if used internally in Blender or hopefully when exported to HDR floating point formats such as HDR/EXR