question

Lupa Lupa avatar image
Lupa Lupa asked ·

AiTextureHandleAccess RGB and alpha

Hi

I'm reading a rgba texture with AiTextureHandleAccess.

It seems like .rgb() values are affected by the alpha channel (rgb * a). Is this expected?

Mtoa 2.0.2

Thanks

AtTextureHandle* textureHandle = AiTextureHandleCreate(texture_path);<br>AtRGBA textureSample = AiTextureHandleAccess(sg, textureHandle, &textureParams, &textureSampleSuccess);<br>sg->out.RGB = textureSample.rgb();
mtoatexture
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

1 Answer

· Write an Answer
Mike Farnsworth avatar image
Mike Farnsworth answered ·

I would only expect this to happen for textures that are sourced from data that expects premultiplied alpha (such as PNG, I believe). If sampling directly from PNG, or converting to TX from PNG, you might end up with that situation. Have you tried a TIFF source, and then turn that into TX to see if the alpha stays indepdendent?

2 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

render-box-textures.zip

Hi

Source is tiff, tx command looks like this:

maketx in.tiff --nchannels 4 -d float -v --unpremult -o out.tx

I've attached tiff and tx

Thank you

0 Likes 0 · ·

I was using maketx from mtoa 1.4.2.2, when using the one from 2.0.1.1 and the tx comes out right.

Feel free to rename the title of this post... false alarm

Thanks

1 Like 1 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.