Forum

Instancing colours seem off

image
These colours should be the same. Is it a log/linear problem?

ColorMatchProblem.vl (39.9 KB)

One is a PBR Material, hence part of the material pipeline and affected by the AmbientLight’s color and intensity, the other is a lowlevel quad with plain color

1 Like

also, when you do instancing, you need to convert sRGB color space (IOBox) to linear color space (shader pipeline). I’ll add this as an option to the ColorPerInstance. however, you should take care of that as the user, since you know better how to do it efficiently, i.e. one ToDeviceColorSpace node after the IOBox before the loop. the ColorPerInstance can only convert all color slices individually which might cost a lot of your frame time.

1 Like

If you know how to do it at all … I’m still confused (but admittedly didn’t deal with it much yet), I just never seem to be able to memorize the different use cases. I thought it was ToDeviceColorspace …

youn are right, that node is even better, because it will also check what’s the pipeline settings. however, it is also more expensive. if you put that node in a loop with 5k instances, it will get 5k references to the graphics device and will add a lot of high level code into your color math, that you probably don’t really need.

but i’ll add a flag to the ColorPerInstance node, which will make it easier to use.

1 Like

I’m pipeting video, so I guess I should put the colours in a buffer and instance them in a shader instead of a material, but good to know about the colourspace nodes, I had noticed some colour things before, now I know why!

yes, just copy them into a buffer with a compute shader and then use this buffer as the color input for a material. you can use the same nodes as the ColorPerInstance node uses internally.

EDIT:
@catweasel Why not just sample the video texture directly in the material? We did that in the NODE20 stride deep dive workshop.

I’m pipetting them for LED’s and also visualising them for pre-programming. (hence needing the colours to be right!)

1 Like

This will be in the upcoming 2021.4 previews >= 85. the conversion will be done on the GPU.

1 Like