Get RAW Pixel color in COP?
4294 10 2- chendryx
- Member
- 86 posts
- Joined: 1月 2015
- Offline
- mestela
- Member
- 1788 posts
- Joined: 5月 2006
- Offline
- chendryx
- Member
- 86 posts
- Joined: 1月 2015
- Offline
- chendryx
- Member
- 86 posts
- Joined: 1月 2015
- Offline
mestela
You can see in the attached hip I make an image with arbitrary crazy rgb values, then in a point vop I can read that back in as rgb, and the full precision of the number is maintained.
I need to be able to get the color value inside of a COP VOP Generator (sorry should have been more specific). In the example scene you offered (thanks btw), the color depth is 16bit float, and the colors are accessible via the R -G - B outputs in the generator VOP's global node. There doesn't seem to be a global output for the integer color values.
- chendryx
- Member
- 86 posts
- Joined: 1月 2015
- Offline
- jsmack
- Member
- 8035 posts
- Joined: 9月 2011
- Offline
- mestela
- Member
- 1788 posts
- Joined: 5月 2006
- Offline
Ah right, now I get you.
Hmm, nothing leaps out I'm afraid. I saw that there's unpack_intfromsafefloat, but I suspect the int values it's expecting aren't the same as what cops is generating. Maybe you could read the black and white points that are exposed as parameters when you define a 32bit integer, and use those to multiply the floating point version?
Hmm, nothing leaps out I'm afraid. I saw that there's unpack_intfromsafefloat, but I suspect the int values it's expecting aren't the same as what cops is generating. Maybe you could read the black and white points that are exposed as parameters when you define a 32bit integer, and use those to multiply the floating point version?
- chendryx
- Member
- 86 posts
- Joined: 1月 2015
- Offline
After playing around a bit more I was able to figure out how to get the integer values. I can take the incoming rgb value and do:
…and write that out to a new 32f plane. For context (2 ^ 31) - 1 is the limit of a 32b integer, and I have no idea why I have to divide by two but it works so I'm not gonna knock it.
$RGB * ((2 ^ 31) - 1) / 2
…and write that out to a new 32f plane. For context (2 ^ 31) - 1 is the limit of a 32b integer, and I have no idea why I have to divide by two but it works so I'm not gonna knock it.
- papsphilip
- Member
- 385 posts
- Joined: 7月 2018
- Offline
The color picker in COPS shows only 4 digits of precision, 0.6028 and is the rounded version of the Cd attribute i am importing from SOPs 0.60275.
I can see the final exr in photoshop also has the rounded value so its not the color picker.
My default depth is 32bit FP
So i guess its not the exporter either
Is there a fix?
I can see the final exr in photoshop also has the rounded value so its not the color picker.
My default depth is 32bit FP
So i guess its not the exporter either
Is there a fix?
Edited by papsphilip - 2022年3月15日 14:15:25
- tamte
- Member
- 8769 posts
- Joined: 7月 2007
- Offline
- chendryx
- Member
- 86 posts
- Joined: 1月 2015
- Offline
-
- Quick Links