Combining SimpleShapeShaders

Started by j meyer, May 07, 2012, 10:47:38 AM

Previous topic - Next topic

j meyer

This originally started over here http://www.planetside.co.uk/forums/index.php?topic=14494.0 ,
but I thought it would be easier to find later on in its own thread.

I have set up some examples to show the differences of some possible ways to combine
SimpleShapeShaders (from here on refered to as SSS).
In all examples the nodes are connected to a surface layer that is between the base colour and
the planet node,so all of this is happening after the compute terrain.
First time I decided to use an Add colour instead of a merge shader was when I noticed that:
[attachimg=1]
I hope you can see the difference.
The SSSs are connected to a surface layer,because I wanted to try several things like color
matching displacement and luminosity and so on.
While I was playing with symmetrical patterns i've tested lots of combinations and found some
other interesting variations,which can be seen in the next post.



j meyer

Here they are :
[attachimg=1]

[attachimg=2]

So depending on what you want to achieve some ways might be better than others
sometimes.
Feel free to ask questions or contribute stuff.

FlynnAD

Hi J Meyer,

I was about to post a question on this topic today myself, though I was using bitmaps for color purposes, not SSS or displacement. Perhaps someone can answer the combined topic question:

If you add color (from powerfractals, grayscale bitmaps, etc.) it appears that the final color can be above white. This would make sense if TG2 allows greater than 1 values for grayscale, and hence there is a clamp function.
However, is it the default processing of TG2 to allow over 1 (pure white) if you add color together? For example, Photoshop does not do this, but automatically clamps at 1 (pure white) unless you're using 32-bit images.
In the situation when the "over-1 white" appeared, I was adding two 8-bit grayscale bitmaps together, not 32-bit.

When I added two grayscale bitmaps together, the overlapping white areas turned "whiter" than white. Was this over-1 white value considered to be luminous then?
It was necessary to add a "Clamp 0 1 Color" node after the Add Color node. Then the white bitmap added to the white bitmap stayed at white. I'm just wondering if adding a "Clamp 01 color" node should be the standard workflow or if this was a unique case.

Similarly, if I subtract color (black minus black) or multiply color from grayscale bitmaps, should I also be using a Clamp 01 Color node? I noticed the above-white issue because it looked luminous, but I'm not sure if a "darker-than-black" color would be blatantly visible yet may still mess up certain functions.
I'm primarily asking this when using grayscale bitmaps as Blender shaders.

Thanks,
-Matt

Dune

Good idea to make a new thread, Jochen. Here's a conditional addition. Don't know if it's any use... perhaps to make star-like debris patterns radiating from an impact?

mhaze


jo

Hi,

I must say I could improve the way the Shape Shader handles being stacked and such. For the next version I'll add the option of applying high and low colours as several other shaders have.

Matt might be better answering Matt's questions, if you see what I mean, but I will venture an opinion. I don't think you could call colour values greater than 1 luminous. However it is true that TG2 generally doesn't put bounds on the colour values. In a general sense it gives greater flexibility and precision if you allow values outside the 0..1 range. My own inclination would be to not worry about the colour values when I'm doing things like combining masks until I got to stage where it actually mattered. That stage will depend on what you're doing. For example if I was doing something with function nodes where I wanted the colour to be within the 0..1 range I would do all the mask combining and then clamp the colour before the next part of the function.

My assumption is that any node which requires colours to be in the 0..1 range would clamp the values. Other nodes may not clamp values because they can work with colour values outside that range although perhaps it might not give the results you were expecting. In that case, if I knew that the results I wanted were dependent or easier to understand/work with in the 0..1 range then I would clamp the colour. Typically masks are easier to understand if they're clamped to 0..1.

I'm not sure if that clears anything up but there you go!

Regards,

Jo

j meyer

FlynnAD - like Jo I think Matt would probably be best to answer your questions.
              Haven't tried to combine image maps like that before,so can't be of
              much help here,I'm afraid.Maybe the examples in this thread can give
              you a basis for your own experiments,though.

Dune - I've gotta try that one.Thanks for contributing.

Jo - " I must say I could improve the way the Shape Shader handles being stacked and such.
        For the next version I'll add the option of applying high and low colours as several other
        shaders have. "
        I'm agog.

Hetzen

Dune's conditional will work if the input is greater than or equal to the check value. This should maintain the greyscale ramp at intersections, rather than say adding two values of 0.5 which equals 1.

j meyer

Meanwhile I've tested Dune's suggestion with the same settings I've used for the
other ones and it seems to give the same result as the add colour + clamp0 1 method.


Hetzen

If you put a wider gradient on your simple shape, you should see the difference in the greys.

Add  to Clamp 0 1 is on the left, Conditional Greater/Equal is on the right. Notice how the gradient mitres into the inset corners on the right hand image.

j meyer

Cool,thanks Jon!
Never tried it that big,but should have obviously.

bobbystahr

my query re: SSS is how do you keep the textures from invading. I do a street for example and at the cross street I need the texture at 90 degrees to the first but one, but one always takes precedence and one street is textured wrong....any ideas....I had this working before my old computers got stolen but all the files went out the window with the computers...sadly...I back up more now....
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Hetzen

Depends what your textures are Bobby. If you want textures to curve around an object, you need to understand uvw mapping, and how to break up flat planes to fit your shape. If you have an overall concrete texture, then you just need to mask where you want it.

bobbystahr

so the SSS is in effect a terrain and needs a mask of some sort (i use paint shaders)...remembered havin' success with them and SSSs....thanks.....
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Dune

No, the SSS isn't a terrain. It's primarily a mask. If you take a stretched SSS and transform (rotate by 90 degrees), use a add color, and perhaps clamp 0-1, you have a cross. Which you can texture as you wish. If you want to use a texture that is unilateral, you'd have to texture first and then transform, or warp for that matter.
The only problem is still that a texture can't be warped in such a way that the Z direction follows the X direction. We would need a transform shader that doesn't transform the shader by itself in a set manner (50 degrees, or something) but by something else (a formula or another shader).