IndexOB not working as expected

Project:YafaRay
Component:YafaRay Core
Category:feature request
Priority:normal
Assigned:David Bluecame
Status:closed
Description

Hi all

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 attach the sample file.

Maybe the same occurs with IndexMat Auto pass.

Edit: Use IndexOB Auto pass with a color pass.

Change the issue to request an auto Object id and auto Material id passes on integer image file.

Greetings

AttachmentSize
idpass.png71.67 KB
id_pass.zip102.4 KB

Comments

#1

Category:bug report» feature request
Assigned to:Anonymous» David Bluecame

Please try to use the IndexOBAuto and IndexMAAuto in "color" passes. They are intended to be used in colored passes.

In any case, as the amount of colors distinguishable by human eye is limited, there is still a possibility for the colors to repeat.

If you need a IndexAuto pass that allows more colors, even if they are not distinguishable by human eye, I can implement it for the next version.

#2

What I suggest is to have the two options:

A)get a pass of sequential values from 0 to number of objects, 0 for background (suitable for compositing softwares), should be an image that can store big integrer values.

B)get the same pass but normalized to be easily selected in image edition softwares visually.

Thanks.

#3

Thanks for the reply, I've tested objectId with color and works as expected, suitable for visual selection on image editing software.

This leaves only the compositing software image. Is there any way that I'm not aware of? For example Fusion gets id as integers starting from 0.

Edit: Blender ID Mask node seems also work with integers.

Edit2: Automatically, I mean, not going object after object and assigning an ID.

#4

Hello,

I will implement this in the next version.

#5

Status:active» needs review

Hello,

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.

#6

Status:needs review» ready to commit

Hello,

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

There will be two types of "auto" passes:

Auto, color: as they are now

Auto, absolute: the new absolute number passes

This will be implemented in the next YafaRay version.

#7

Sorry David, didn't notice.

Yes. It should be exr, but I don't know if it must be half float or full float.

Thanks!!

#8

Status:ready to commit» fixed

Hello,

This feature has been implemented in the new YafaRay v3.1.0-beta. See: http://www.yafaray.org/community/forum/viewtopic.php?f=15&t=5184

#9

Status:fixed» closed

Fixed for more than 2 weeks without further feedback, closing.