Forum: Poser - OFFICIAL


Subject: Bagginsbill or other guru - shader question

JoEtzold opened this issue on Dec 08, 2008 · 35 posts


bagginsbill posted Thu, 18 December 2008 at 8:36 AM

In order to produce two such curves on the same material, we have to do this over again for another curve. Then we cut and paste the two gradients as appropriate for each section of the UV map. For one leg, we use data from one of the gradients. For the other leg, we use data from the other gradient.

We can produce any number of stripes on the same shader network in a single gradient image, so long as they don't have to touch.

If the 256 steps from .23 to .29 are still too rough, we can do other tricks to encode more precision. I did some extensive work in the past on an encoding in RGB (using 24 bits) that can survive Poser's interpolation between pixels. The resulting data is effectively 13 bits.

If you're not familiar with the issue, here it is. If you encode a 16-bit number across two channels (for example, red * 256 + green = the number) you can store much more precise information. However, as Poser interpolates independently in each channel, you find areas where the red goes up at the same time that the green goes down. For example, from 255 to 256, the red goes from 0 to 1, and the green goes from 255 to 0. When Poser interpolates between these pixels, you can get a Red=1 Green=127 pixel. This is the problem - the low order channel (green) makes these big drops to go into the next range.

I got around this by spreading the low order information between green and blue, redundantly. In areas where the green makes this sudden retrograde transition, I encode the same information in blue but shifted by 128, putting it right in the middle of its smooth range. And vice versa, if the blue is in retrograde, the green is at 128. Using this technique, I can get an effective bit density of 13 bits per pixel. And no matter how drastically Poser tries to interpolate (and mess up) the data, it always survives.

The decoder for this is not too hard.

However, I have no more time today to work on this. I will come back to it as soon as I can. Then I will also share with you the Python script. I assume you are technical enough to be able to go get real Python and PIL and install these on your computer.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)