Search - User list
Full Version: Bringing Image Planes Into SHOPs
Root » Technical Discussion » Bringing Image Planes Into SHOPs
AndrewJBeard
How do I use an image with additional image planes in a shader? The Texture SHOP only returns RGB or RGBA values: how do I access other planes in the image?
mark
AndrewJBeard
How do I use an image with additional image planes in a shader? The Texture SHOP only returns RGB or RGBA values: how do I access other planes in the image?

If you are using a .rat texture file, I believe that “channel” keyword can be used to specify different channels. For example

clr = texture(“deep.rat”, “channel”, “C”);
nml = texture(“deep.rat”, “channel”, “N”);
Alanw
That would be a nice addition to the docs.

Unless it's buried deep somewhere I couldn't find a trace of info on this besides a reference in the dev journal.
symek
Alanw
That would be a nice addition to the docs.

Unless it's buried deep somewhere I couldn't find a trace of info on this besides a reference in the dev journal.

Indeed “channel” keyword is mentioned only in case of DSM and shadowmap() function which I've recently used for that very purpose :roll:
AndrewJBeard
Thanks, Mark.

A couple of points of clarification:

1. Am I right in guessing that the Texture VOP doesn't support this method: I'll have to resort to writing VEX code directly?

2. Is this method likely to work for OpenEXR image formats, which also support arbitrary image planes? If not, could this be implemented in a future software revision? (In the meantime I'll happily use RATs, I just prefer to use as many open formats as possible).

Many thanks,

Andrew
mark
AndrewJBeard
Thanks, Mark.

A couple of points of clarification:

1. Am I right in guessing that the Texture VOP doesn't support this method: I'll have to resort to writing VEX code directly?
Yes, you'll have to use the inline VOP.

2. Is this method likely to work for OpenEXR image formats, which also support arbitrary image planes? If not, could this be implemented in a future software revision? (In the meantime I'll happily use RATs, I just prefer to use as many open formats as possible).

Internally mantra converts .exr files to .rat files for rendering. I haven't tested, but in theory all the image planes should be converted to the .rat file.

However, by using a .rat file natively:
a) You don't pay the image conversion cost on every render
b) You get much better memory performance since mantra doesn't have to load the entire image.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB