Sun, Dec 29, 4:18 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Dec 28 9:33 pm)



Subject: Multiple Masks


nruddock ( ) posted Fri, 22 April 2005 at 9:03 PM · edited Sun, 29 December 2024 at 4:14 AM

The recent interest in procedural skin effects and the need for maps to control where effects get applied got me thinking how it might be possible to reduce the number of maps needed to include several effects at the same time.

The posts that follow show the basics of what I came up with.


nruddock ( ) posted Fri, 22 April 2005 at 9:09 PM

file_225814.jpg

This is the basic setup, note that instead of a grey scale image, the mask is coloured. By changing the colour for Value_2 in the Color_Math node, you can recover each individual mask area, as required. This gives a theoretical potential for up to 2^24 - 1 masks in a single image.


nruddock ( ) posted Fri, 22 April 2005 at 9:13 PM

file_225816.jpg

By altering Value_2 in the Math_Functions(Step) node, we can bring in colors that are similar to the target color. This image show the mask for a value of 0.1


nruddock ( ) posted Fri, 22 April 2005 at 9:13 PM

file_225819.jpg

Mask for value of 0.2


nruddock ( ) posted Fri, 22 April 2005 at 9:15 PM

file_225820.jpg

The maximum value is 0.333333 due to the way the colour values are converted to scalars.


nruddock ( ) posted Fri, 22 April 2005 at 9:20 PM

file_225823.jpg

An alternative way to use the coloured image, is to use the Red, Green, and Blue channels to define mask areas. Using Math_Functions nodes you can create any combination of the masks as required.


nruddock ( ) posted Fri, 22 April 2005 at 9:32 PM

The final output can be used in the same way an ordinary mask image would be such as driving a Blender nodes Blending input.

Combining to colour subtraction technique and the colour seperation technique will give more variations of what can be done with a single image.

These techniques will work in P5 and P6, though for P5 it's going to be all manual work, for P6 the new Material Room API for Python will allow scripts to do a most of the "heavy lifting" in terms of adding the nodes required to seperate out a particular mask.


JohnRickardJR ( ) posted Sat, 23 April 2005 at 2:22 AM

Nice technique. How about using the colour ramp node to get three masks out of a greyscale image? Draw one mask in white, another in 66% grey and the third in 33% grey. Set up your colour ramp with three blacks and one white colour - white at the top would mask the white, white in slot two would do the 66% grey and white in slot three would do 33% grey. Not as powerful as your colour technique, nor would it allow as many masks, but it might be handy


JohnRickardJR ( ) posted Sat, 23 April 2005 at 2:24 AM

Attached Link: http://www.renderosity.com/tut.ez?Form.ViewPages=910

Incidently, I've just had my first tutorial approved, and by a coincidence it's about using colour maths, in the this case to adjust texture colours


nruddock ( ) posted Sat, 23 April 2005 at 6:03 AM

If you mix and match techniques in the right way I think you could get several grey scale maps out of one image.
Any masks generated are meant to be used as inputs to other Shader networks to control effects.

These techniques work best on figures that have a single continuous material (i.e. no material zones)
Using color separation would allow two masks to fade into one another, given a careful choice of colours.

Anyone who is familiar with Terragen will understand how multiple layers of masks can be used to produce amazing effects.


JohnRickardJR ( ) posted Sat, 23 April 2005 at 6:46 AM

I've had some success making height based terrain textures in Poser using these techniques - using the same greyscale map that controls the colour ramp to control the displacement - with a bit of tweaking materials blend nicely into each other.


JohnRickardJR ( ) posted Sat, 23 April 2005 at 6:48 AM

One potentially interesting area with the colour masks would be to use colour maths to produce the mask from the texture being masked - could be a good way to alter materials on cloth for example


nruddock ( ) posted Sat, 23 April 2005 at 7:48 AM

"a good way to alter materials on cloth"
Particularly if used to add selective Specular or Ambient effects.

One more thing I need to add is that lossless formats like PNG and TIFF (also GIF if you don't need many colours), are going to be best if the boundaries between colours are sharp.


JohnRickardJR ( ) posted Sat, 23 April 2005 at 8:10 AM

Just how long would a material take to set up if it needed more than 256 masks?


nruddock ( ) posted Sat, 23 April 2005 at 8:45 AM

I suspect that something that complicated would be difficult to work with in the Material Room, it would have to be setup using a script 8-)


JohnRickardJR ( ) posted Sat, 23 April 2005 at 9:09 AM

Wonder how long it would take to render..


danamongden ( ) posted Sun, 24 April 2005 at 9:45 PM

I used a similar technique in an image using the Andromeda IV android texture. I wanted to make certain colored bits light up with ambient light, so I created the mask procedurally much like you do here, by selective color, and then I used that mask to bring the color back in and applied it to the ambient channel. As for rendering time, I've generally found that complex node arrangments make a much smaller difference than adding extra geometry, and in tight memory conditions, they are much better than a real texture.


JohnRickardJR ( ) posted Mon, 25 April 2005 at 1:39 AM

I did some timing tests with nodes versus textures, and nodes were significantly slower than textures - on a simple cube each extra node added pushed the time up by 2 to 3 seconds; textures of any side made little or no difference. Memory wise, textures at 1000x1000 seemed to take the same amount of memory as the nodes, but at any other size the textures took much much more - 2 meg per 1000x1000 texture, 30 meg per 4000x4000 texture; I must experiment with geometry instead - I've got a displacement maped column that would make the perfect text


danamongden ( ) posted Mon, 25 April 2005 at 7:04 AM

I hadn't really done any scientific timing tests, just general impressions formed while rending one scene over and over. Part of the image was a background with a complex procedural material (a starfield made over several fractal patterns used together) while other parts of the image included a V3 and a Maddie. While passing over the procedural background, the render just flew (multiple buckets per second), but it crawled on the characters (multiple seconds per bucket). That's why I said nodes were faster than geometry. Also, in this scene I was trying to render at very high resolution (4500x4500), and a texture of the right size for the background pushed me beyond the memory limits that Firefly could handle. Considering that the render took hours, I was more than happy to sacrifice a few extra seconds or minutes on the procedural texture in order to have the memory to complete the render.


JohnRickardJR ( ) posted Mon, 25 April 2005 at 12:38 PM

I might do a quick geometry timing test later - the same shape but subdivided in diffrent ways


byAnton ( ) posted Sun, 01 May 2005 at 1:54 PM

AKmaterialroombookmark

-Anton, creator of Apollo Maximus
"Conviction without truth is denial; Denial in the face of truth is concealment."


Over 100,000 Downloads....


KBOC ( ) posted Fri, 20 May 2005 at 8:35 PM

file_225829.jpg

nruddock, I've tried both colour math and math functions to put these back together to mask off areas... I'm not sure what I'm doing wrong... can you tell me what function to use?


danamongden ( ) posted Fri, 20 May 2005 at 8:41 PM

You need to use a Blender node (Math->Blender) to mix them together. The inputs for it should be: 1.0, link to Color_Math 1.0, link to Color_Math2 1.0, link to Image_Map2


KBOC ( ) posted Fri, 20 May 2005 at 9:04 PM

file_225830.jpg

didn't work... this is what I get.. I've tried all options for blender... :(


KBOC ( ) posted Fri, 20 May 2005 at 9:12 PM

file_225832.jpg

This shows pretty well what I'm trying to do... unfortunately it just doesn't work right...


danamongden ( ) posted Fri, 20 May 2005 at 11:09 PM

file_225833.jpg

You were close, but you didn't use the 1.0 as the final numerical value in the blender node.

Here you see an even simpler setup to give you the effect. Note that doing a Math Function->Subtract node lets you get the inverse mask at runtime. From there you can drive the blender node directly to mix the two inputs.

Is that the effect you were looking for?


JohnRickardJR ( ) posted Sat, 21 May 2005 at 1:50 AM

Or you could plug the image map straight into the Blending node, and swap the two others - clouds into Input 2 and noise into input 1


danamongden ( ) posted Sat, 21 May 2005 at 9:38 AM

Yeah, I was going to do that as soon as I hooked it up w/ the original mask, but I figured I'd take the opportunity to show that you didn't need to load two bitmap textures just to get a negative.


KBOC ( ) posted Sat, 21 May 2005 at 10:38 AM

YOU GUYS RAWK!!! Thank you!


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.