My Procedural Road, *Final* pg. 8

Started by FrankB, March 08, 2011, 06:26:38 AM

Previous topic - Next topic

FrankB

Look at this... how is this possible? I'm just warping into one direction soooo... no clue where this circle is coming from. Crazy stuff...


Hetzen

#31
These are looking very convincing Frank. There's a lot of power in them blues. I'm glad you're getting your feet wet. 8)

Those circles I'd imagine are coming from your warp PF. If you push it too far within a set scale, you get those sorts of artifacts. The answer would be to use 2 scales of PF each with a set max displacement. ie One large scale for large displacements, one for minor variation.

I wonder if we could push the guys to give us a way of blurring/smoothing displacements/colours with nodes outside of heightfields? ;) So that you could level off your road a bit more.

Jon

FrankB

Quote from: Hetzen on March 09, 2011, 11:40:32 AM
These are looking very convincing Frank. There's a lot of power in them blues. I'm glad you're getting your feet wet. 8)

Those circles I'd imagine are coming from your warp PF. If you push it too far within a set scale, you get those sorts of artifacts. The answer would be to use 2 scales of PF each with a set max displacement. ie One large scale for large displacements, one for minor variation.

I wonder if we could push the guys to give us a way of blurring/smoothing displacements/colours with nodes outside of heightfields? ;) So that you could level off your road a bit more.

Jon

Hey Jon,

I'm using the blue nodes since years, I agree they can be very powerful additions to the normal shaders. I wish I could define a user interface for a network of blue nodes, so that I could effectively write new shaders.
I'm actually not using a PF for warping in the last render, but a blue perlin function fed into a displacement shader. I didn't have these artifacts with the previously used PFs... Anyway, I believe your explanation must be right.

Lastly, what do you mean by smoothing displacement ouside of a heightfield? I usually use a smooth step scalar to do this. Or did you mean something else?

Cheers,
Frank

Hetzen

Sorry Frank, you've previously given the impression that you didn't like getting into math, hence my comment. My bad. I've got to say I really like the modulo function, it gives you all sorts of possibilities.

Those circular artifacts tend to occur when you displace/warp something outside it's scale range. eg a perlin set at say 100m scale and you multiply that output by something a lot larger than it's scale, like 200m.

As for 'smoothing'. What I meant by that, was some way of looking at a defined area (say x +/- 10m by z +/- 10m) and finding out an average value of y, then smooth step between these values of y to give you a flat road surface. You could use this for rivers down slopes, etc. The only way I've seen this done, and it's not a perfect solution by any means, is by smoothing a heightfield masked by the limits of your road/river.

Cheers

Jon

FrankB

Ah, I see now what you mean with the smoothing. Yes, that would be ideal. It could probably be approximated with functions already, by probing the y value at say 9 defined points in the neighborhood of the current position and calculate an avg from that.... haven't tried this, though, but it sounds possible.

As for the math-denyer - you must be confusing me with someone else :)
I like getting into math, it's just that I'm not particularly good at it anymore. I did a lot of higher math during my studies, but never used it ever after, so I had to re-learn e.g. vectors :D

Cheers,
Frank

FrankB

For anyone still following this thread: If you have no idea where to start making your own roads, see the attached tgd.

It's a simple winding procedural road, but no frills. Based on the network in there, you can start making your own, infinite, procedural, good looking road. It's really easy to also generate masks for the paint based on the mask for the road.
This one isn't pretty, but it gives you the basic setup to extend to your liking.

Regards,
Frank

choronr

I've been following this thread with great enthusiasm. Thank you for all your input as well as the others contributing here. Between you, Dune and dandelO, you guys have opened some new doors to creativity ...thanks again, all of you. 

dandelO

I've been mucking around with this thing myself. I'd rather not download your file just yet, Frank, until I feel I've exhausted all my own brain-power(such as it is).

But the thing I write here for is a very simple basic problem I'm facing, be it through functions or fractals. Simply, is there a way to 'tame' the scale of a noise to exactly the scale you input? By this I mean, the warping of a line function does not let me keep the scale of the 'road' width consistent. It will widen/thin the basic road line-mask according to how the fractal or Perlin lies at any particular point along its length.

Maybe I'm not being clear enough, it doesn't sound right reading it back. Is there another method to generate a noise that I can use as a warper, generally, other than an inconsistent perlin/fractal, so it bends the road consistently but still maintains the correct width?
See this deviation in width in the screen-shot below...

Cheers. :)

FrankB

#38
I know what you mean, Martin. AFAIK there is nothing you can do about it if your technique is based on warping a stripe of white color.
It's really only bad when your displacements are very strong, otherwise, on real roads, often they are wider in the curves than on the straight parts. The effect must not get too strong though.

Maybe your road won't get distorted when you apply the defomation on the scalar or vector level. For example, if you run your function that generates scalars through a sine, then your line will be deformed like a snake but not become wider or narrower in some parts. I guess. Haven't tried. I can live with the effect if it's not too strong :)

Frank

dandelO

I'm guessing that the only way round it at the moment is to not have too severe a displacement in the warping.
Large scales, creating sweeping curves are much better handled than tight ones and because they generally are much wider than the road, there's minimal distortion.
I like the 'roundabout' effect you showed above when you apply more warp than the scale describes but, unfortunately, that's when the distortion of the road width becomes really apparent.
And, I haven't even started on altitude deviation yet... :D

Hetzen

#40
If your road is traveling along the x axis, you can tame that width variation Martin by, adding a 'multiply vector' after the 'get position' by a 'constant vector' of (1,0,0) before you plug it into the perlin function. This will effectively give you the same variation all the way along y and z for every x.

Volker Harun

#41
Hello Martin,

look at the attached previews.
I'd expect the two warpers to show a parallel result but it is not possible - at least not with this setup :(

Hi Jon:
your multiply vector does not work here ... as there is no noise at all after multiplying it with 1,0,0

PorcupineFloyd

Ducking great!

Frank, have you thought about releasing a series of tutorial videos on NWDA? I'm thinking about e-learning like lynda.com or totaltraining.com. I'd be happy to pay for quality tutorials about functions and procedurals in depth.

Hetzen

The problem Volker, is that the Perlin has a different value at your offset point to its standard point. You need to flatten your 'get' input into one dimension to give the same output along a given axis. Easiest way is to nullify all other axis by the method I posted above.

Jon

Hetzen

Quote from: Volker Harun on March 09, 2011, 02:03:05 PM
Hi Jon:
your multiply vector does not work here ... as there is no noise at all after multiplying it with 1,0,0

In this case, your road follows the z axis so multiply your perlin by (0,0,1). Try that. Should work.