Author Topic: Random gradient over custom pattern without Flood  (Read 2193 times)

Is there any way to make a gradient variation for each of the shapes from custom pattern or something similar without the use of Flood Fill nodes? I need a way to make the sbsar which is able to to that so I can use it in Unity 3D

Pawel Pluta uploaded a node to substance share a year ago - it's called 'filter_random_greyscale_generator'

As I understand it, this filter was optimized by someone else, and eventually turned into the new 'flood fill' nodes.

Not sure if this one will run in Unity (not sure if it's GPU based or not), but this is the slightly more bare bones original.

Pawel Pluta uploaded a node to substance share a year ago - it's called 'filter_random_greyscale_generator'

As I understand it, this filter was optimized by someone else, and eventually turned into the new 'flood fill' nodes.

Not sure if this one will run in Unity (not sure if it's GPU based or not), but this is the slightly more bare bones original.
I followed that line too. But as far as I can tell that node gives just random color to the shapes. It does not give any type of gradient

That's true - but that's all you need to do a crude version.

Use two 'greyscale random' nodes with different seeds.  Feed the output of one into the R channel of a 'merge RGB' node, and the other into the G.  Feed a constant into the B channel (I think you need 0.5).

This will give you a fake normal map with a different slope for each shape.

A normal -> height node will turn it into a random B+W gradient.

Some tweaking may be required, but that's worked for me in the past.

That's a clever method Alex. Although the normal to height nodes aren't particularly great, this'll certainly come in handy.

Guys thank you very much. One more question though: Do you know any random grayscale generator that does not use GPU because this thing I make needs to work in Unity 3D. I tried that Filter Random Tiles Grayscale Generator by squad3d I know that it sounds silly but the thing is when I try to play with some of the settings like Dilation steps I think I can hear my graphic card screeching. I am pretty sure it is the GPU because it only does that with some of the parameters nothing else
Last Edit: February 19, 2018, 11:53:34 pm

I don't know of any alternatives - but are you 100% sure it won't work using the CPU engine? 

Some scripts run faster under the GPU, but there aren't many nodes that HAVE to run on the GPU engine.

I don't know of any alternatives - but are you 100% sure it won't work using the CPU engine? 

Some scripts run faster under the GPU, but there aren't many nodes that HAVE to run on the GPU engine.

I tested it now with some quickly built sbsar  and while unity3d recognizes the archive it simply shows a gray value for base color where I connected my random gradient. I also tried to convert it to color since it was grayscale but the result is the same.

You can test for cpu within designer. By default designr will be using the gpu engine (Direct3d), but you can switch to cpu by going to Tools>Switch Engine>SSE2. The filter_random_greyscale_generator seems to work on cpu, but it's *very* slow. (12000 ms on my laptop.. )

I'm doubtful you will find a performance friendly alternative.

You can test for cpu within designer. By default designr will be using the gpu engine (Direct3d), but you can switch to cpu by going to Tools>Switch Engine>SSE2. The filter_random_greyscale_generator seems to work on cpu, but it's *very* slow. (12000 ms on my laptop.. )

I'm doubtful you will find a performance friendly alternative.
You are right, it works with cpu in SD although very slow. But for some reason I can't make it to work in Unity3D at all. I tried it with some warps instead just to make sure and it works like a charm. There is definitely something in that node that prevents it from reading inside unity.
In any case I really need to thank you for nudging me in the right direction
cheers :D
Last Edit: February 20, 2018, 09:50:13 pm