My Procedural Road, *Final* pg. 8

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

Previous topic - Next topic

Hetzen

Here you go Volker...

Hetzen

And here's the road mask combined...

Volker Harun

Quote from: Hetzen on March 09, 2011, 02:13:37 pm
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.


You are absolutely right ... I was following your 1,0,0 without thinking about it ,-)

FrankB

Quote from: PorcupineFloyd on March 09, 2011, 02:07:08 pm
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.


Yes I thought about that. I'm not sure yet whether to get into that or not.

- Frank

dandelO

That's great, thanks Hetzen, Volker.

I hadn't thought of warping twice and mixing them. That would keep the width consistency across the entire length. Cool. :)

Hetzen

No problem Martin.

Sorry for hijacking Frank.

FrankB

Good ideas, Jon! No problem with hi-jacking. We're still on topic :)

dandelO

March 09, 2011, 07:47:09 pm #52 Last Edit: March 09, 2011, 07:49:06 pm by dandelO
Or, I could have added a single node(Z to scalar) to the setup I already had and not bothered posting the question at all! I'm bloody dim sometimes! ::) :D
That makes the Perlin-warper uniform along the length of the road so, no need for two different warp shaders, since the Z to scalar is infinite from East to West it'll always cross the road at the same points on each side when the road runs North to South. Still, this means it can't possibly double-back on itself(which is good in a way too because it avoids the circular warping), some larger scaled warp over this one, in the other direction should overcome that, though, and the road will then be able to double-back.

So the road should stay reasonably consistent in width, as long as the warp amount doesn't exceed the warper's scale(then it'd thin out). It certainly avoids the problem of a patch of Perlin warp catching one side of the road and not the other, which was what I was after.

* Sorry, Frank. Just clearing up my mess.

Dune

March 10, 2011, 02:52:05 am #53 Last Edit: March 10, 2011, 03:12:48 am by Dune
QuoteOr, I could have added a single node(Z to scalar)
Or X to scaler, indeed, that's what I did. If you attach a rotate Y, you can rotate the road. I don't know if Frank uses that as well, haven't checked his tgd yet... he probably does.

As for flattening the road; I tried to stretch the fractals in the Z direction (with an X-based road) where the road is (with a little softness on the sides), but where the stretched fractals meet the unstretched, you get weird displacements, so that doesn't work. Smoothing (by surface layer) doesn't work either, as the whole road dips underground. Perhaps the tilt of the road could be 'counterbalanced' by the ground displacement on the other side of the road, somehow... but that's math I don't understand.

Edit again with an afterthought: there was once someone who produced ripples by setting a number of positions in a line of blue nodes. Perhaps it would be possible to construct roads like this; so you could point (copy coordinate, several times) where you want it, then some math would smoothly connect the positions.... etc.

Hetzen

Quote from: dandelO on March 09, 2011, 07:47:09 pm
Or, I could have added a single node(Z to scalar) to the setup I already had and not bothered posting the question at all! I'm bloody dim sometimes! ::) :D
That makes the Perlin-warper uniform along the length of the road so, no need for two different warp shaders, since the Z to scalar is infinite from East to West it'll always cross the road at the same points on each side when the road runs North to South. Still, this means it can't possibly double-back on itself(which is good in a way too because it avoids the circular warping), some larger scaled warp over this one, in the other direction should overcome that, though, and the road will then be able to double-back.


Can I ask your reasoning behind the Length to Scaler node DandelO? The output value will look like...

sqaure root of (x^2+x^2+x^2)

I'm not sure I understand why it's there?

Also, the Exponential Colour node looks quite interesting too. Is that used to flatten out the peaks of the Perlin (or does it actually sharpen them)?


Good work on dropping the second Warp shader.

Volker Harun

Quote from: Hetzen on March 10, 2011, 03:41:40 am
Good work on dropping the second Warp shader.

Hmmm ... I introduced the sceond warp shader just to verify that the warp shaders look the same or different.
;D

dandelO

Hi, Hetzen. I used the length to scalar node as it's the simplest way to make a single straight line of the X to scalar below it.

[attachimg=#]

Then from the invert that line, into an add node, using a constant for width. The exp colour node was just to fill-in the gaps of the Perlin noise.
My maths is crap so these are all probably used quite wrongly but they work to this end.

* Volker, it was a good idea, regardless.

freelancah

Interesting project! Nice progress so far!

FrankB

so here is another slightly advanced version of the road. This time I'm using a merge shader to join the road with the landscape, which works quite well.

These horizontal dark, specular stripes on the tarmac are supposed to be cracks that have been fixed with a stripe of darker tarmac. This helps make the road look a little less perfect.
I wish I had better car models. I had to use these two not so good models you see here. Does anybody know a link to a great quality, free car model in obj format?

I have blended out the road in the distance to avoid it climbing up the hills in an unrealistic way, but I forgot to also blend away the road paint , hehehe. Stupid.

Anyway, what I really like is that the tarmac itself is looking better and better on close-up with each iteration.

Cheers,
Frank

Dune

http://dmi.chez-alice.fr/models3.html

And why not add some potholes and dirt, that's the easy bit. I had a go at straightening your road (you have quite a different setup than I had, interesting), and managed at some angled areas, but you'd have to select a good area to render, as at other areas the road dips into the hill or runs on a dike. Which is not too bad if you have low hills. Negative displace by the terrain, but set the offset about half the displacement. I blended this by a wider 'verge area'.