Planetside Software Forums

Support => Terragen Support => Topic started by: Mohawk20 on March 13, 2007, 01:44:49 PM

Title: Inverted Voronoi Trouble
Post by: Mohawk20 on March 13, 2007, 01:44:49 PM
While working on my vulcanic scene, I thought it'd be nice to have a layer of red in a voronoi pattern.

I had a voronoi clipfile, from another scene someone helped we with here.
So I plugged the output from that into the colour input from the surface node. Problem was that the inside of the cells was white and the borders black. I wanted it inverted, so I put an 'inverse scalar' function in.
The colour in the surface layer was dark red. And thus the max colour should be dark red, the min colour black. The min colour is black allright, but with the invers scalar in place the max colour is white, no matter how dark you set the colour.

Here is a screenshot: http://www.ashundar.com/CPG/displayimage.php?pos=-3924
And I have attached the tgd...

Hope someone can help me, this should become a new age for UrU Live perhaps an official one in the futur, who knows...
Title: Re: Inverted Voronoi Trouble
Post by: Oshyan on March 13, 2007, 03:59:17 PM
I'm a little unclear on exactly what result you're looking for - your example image looks good (and "right") to me. But if you just want to "invert" colors, try Complement Color function, or a Color Adjust shader with the Black and White points reversed. The Color Adjust shader approach is probably best as a straight invert probably won't get you what you want.

- Oshyan
Title: Re: Inverted Voronoi Trouble
Post by: Mohawk20 on March 13, 2007, 05:00:20 PM
Hmmm, as I read back, I think indeed I was not very clear on the problem.

The problem is most visible when plugging the resil after the inverse scalar into a displacement. All these very thin but high spikes are shooting up from the sky.

The problem is visible in the example as the white and bright red spots. The colour I set in the surface layer was allmost black, and still the white spots stay. I wonder why...

Allthough the render is in HDRI and so white has a value way over 1 in most cases, in these nodes outputs white should be at a value of 1, and so the max brightness for these lines should be very dark red, but they aren't.

I will try those sugestions and you'll hear from me after that.
Title: Re: Inverted Voronoi Trouble
Post by: Mohawk20 on March 13, 2007, 05:58:31 PM
Yep that colour adjust did the trick. Actually, I had tried that before, but not fully rendered it. I only used the small texture preview, and that didn't get to a high enough detail that time, so it seemed as though the voronoi pattern had disappeared. That is why I hadn't used that solution before.

Now that it's fixed, I still have one question..: What does the inverse scalar do that causes the over bright effect? Is it supposed to do that, or is it a bug?
Title: Re: Inverted Voronoi Trouble
Post by: Oshyan on March 13, 2007, 06:18:23 PM
Scalar is a number rather than a color - you're looking for the inverted color result of the node's output rather than the inverted numerical output. Most nodes in TG2 will convert between data types so the color data is first converted to scalar, then inverted, then converted back to color by the Surface Layer. I presume that's where the problem comes in.

- Oshyan
Title: Re: Inverted Voronoi Trouble
Post by: mrwho on March 13, 2007, 07:09:57 PM
very nice image (don't understand all the extra nodes or the voronoi node, but whatever) I download the tgd, and I'm wondering where the color adjust gets plugged into
Title: Re: Inverted Voronoi Trouble
Post by: Mohawk20 on March 14, 2007, 03:48:03 AM
It links between the Voronoi Diff Scalar and the Surface layer Colour input.
Like the screenshot I attached.

And then you get the result I attached as well.

Have fun with it, I'm eager to see what use for it you come up with....
Title: Re: Inverted Voronoi Trouble
Post by: Ogre on March 14, 2007, 01:40:35 PM
Great topic.  Thanks for helping me work out an issue I have been struggling with.  ???  I was working on a similar picture but also wanted displacement.  I used your tgd as a working file.  Here is what I came up with.  Have to go back and start using this in my shelfed project.  Thanks again!
Title: Re: Inverted Voronoi Trouble
Post by: mrwho on March 14, 2007, 01:58:50 PM
wow! great image, the displacement adds a lot. I think you should limit to the foreground, though. It jsut doesn't look right for the background (the volcano and stuff)