Scalar alpha?

Use this forum for discussions specifically related to the Krakatoa SR C++ API.
For discussion of topics applicable to both the C++ and Py APIs, please use the parent forum.
User avatar
Chad
Posts: 2092
Joined: Tue Nov 22, 2005 9:35 am
Contact:

Scalar alpha?

Postby Chad » Tue May 21, 2013 8:38 am

What's the recommended conversion to get scalar alpha from Krakatoa? Currently we get RGB, which makes sense if we're going to actually use it, but when we want a scalar, we're just doing a REC 709 luma conversion, but that feels wrong.

User avatar
Darcy
Posts: 695
Joined: Fri Sep 08, 2006 11:07 am
Location: Vancouver, BC
Contact:

Re: Scalar alpha?

Postby Darcy » Tue May 21, 2013 11:14 am

I can't think of anywhere we do that, but I suspect we would average the alpha values. Classy.
Krakatoa/Genome/Ember/Stoke Lead Developer
Thinkbox Software

User avatar
Chad
Posts: 2092
Joined: Tue Nov 22, 2005 9:35 am
Contact:

Re: Scalar alpha?

Postby Chad » Tue May 21, 2013 1:45 pm

For the 3ds max VFB you have to convert to scalar. I guess I can work backwards from there... It's clear that an absorption color of (0,0,1) produces a different alpha than (1,0,0), so there's something more than averaging going on.

User avatar
Darcy
Posts: 695
Joined: Fri Sep 08, 2006 11:07 am
Location: Vancouver, BC
Contact:

Re: Scalar alpha?

Postby Darcy » Tue May 21, 2013 4:22 pm

The Absorption channel (for better or for worse) is used in conjunction with the Color channel to determine the alpha value. When no absorption is present, the extinction coefficient (which is related to alpha by an integral along the camera ray) is: [density, density, density]. When an absorption value is present the extinction coefficient is: [density * (color.r + absorption.r), density * (color.g + absorption.g), density * (color.b + absorption.b)].

In retrospect, this connection with Color is somewhat irritating, but alas this is how it works.

Chad wrote:It's clear that an absorption color of (0,0,1) produces a different alpha than (1,0,0), so there's something more than averaging going on.


For your tests you would need to have particles with Color: (0,0,0), and Absorption: (0,0,1) which would make the alpha render as (0,0,1); assuming sufficient Density.

PS. I just took a look at the code that converts to a 3ds Max bitmap and it is definitely averaging.
Krakatoa/Genome/Ember/Stoke Lead Developer
Thinkbox Software

User avatar
Chad
Posts: 2092
Joined: Tue Nov 22, 2005 9:35 am
Contact:

Re: Scalar alpha?

Postby Chad » Wed May 22, 2013 8:50 am

Ah, forgot about the Color, I just did a teapot+PRT Volume and it pulled the wirecolor.


Return to “Krakatoa SR C++ API”

Who is online

Users browsing this forum: No registered users and 1 guest