Hey all,
I've been thinking of a way to pack multiple splat maps into a single RGB channel. My thought is that given the full range of 256 values, we can pack multiple masks into a certain value range. For example, for a 3 mask set up in 1 channel: Mask A would exist between 0 and 85, B would exist between 86 and 170, and C would exist between 171 and 255. This would allow for an RGB texture to contain more than 3 masks (1 for each channel), the only limiter being the granularity/transition between masks (ie: range allocated for each mask).
Has anyone attempted something similar? Or even better, got something hooked up in Shader Forge or another node based shader editor?
Replies
http://ericchadwick.com/img/robot_rising.html#utility_shader
The shader graph is hard to read. Would you mind posting a higher res of the screenshot or just briefly running down the setup so I can get a conceptual outline?
Regardless, thanks a ton
I subtract .5 to pull the 127 to 255 range (really .5 to 1) down to 0-127 (0-.5). Then I multiply that by two to stretch it to 0-255 (0-1), then clamp it in case any values were greater than 1.
For the other mask in 0-127, I simply multiply by 2 to expand it 0-255, then clamp.
Going off memory here. Looks like some extra stuff in there maybe. Good luck!
You might need to account for DDS compression precision errors depending on what you're doing.
Consider if this is a gamma or linear space texture. If this is purely a mask then linear is given.
Also, is anyone else going to be working with this? Will they understand how to work with this? Potential for them to get it wrong?
No tutorials AFAIK.