How to sample altitude at a particular position in texture

Started by FrankB, December 15, 2012, 02:15:36 PM

Previous topic - Next topic

Dune


Tangled-Universe

My guess is that you make a very soft SSS and then extract multiple masks from it using a colour adjust shader.
Increase black color would tighten/narrow the mask, for instance.

This way, using multiple colour adjust shaders, you can relatively easy create a mask for the road (hard), roadside (medium soft) and surrounding terrain (very soft).

Something like that, I guess.

FrankB


Tangled-Universe

Quote from: FrankB on December 17, 2012, 07:17:12 AM
Quote from: Dune on December 17, 2012, 07:03:28 AM
My solution is basically very simple, once you know  ;)

These are the best ones! :-)

Therefore I think my idea of how's he doing it qualifies for being (part of) the actual way he's doing it :)

Dune

The road SSS is not even that soft, set at 8m wide and a soft edge of 1m, or a certain percentage. The road part, lines and verges is the easy part, actually. It's the way I can get the road flat against a steep hillside that is the crucial part. I had another setup a while ago, but the road tilt had to be adjusted a little depending on the side of the mountain (east or west). This setup doesn't need that, it's always straight.

FrankB

exactly that's the hard part in case of the road. Looking forward to your solution!


bla bla 2

Comment on fait pour que la route soit seul mais fermer qu'on puisse faire un " random seed" pour varier la route ?
Sinon, on peut m'envoyer un mp, pour la réponse.

How do you that the road is only closed but you can do a "random seed" to vary the road ?
Otherwise, you can send me an mp, for the answer.

(google translate)

Dune

If you want to vary the road, you need to hit the power fractal seed that warps the road. What I did in my new file (which will be available soon) was hitting the terrain seed, but the road stayed at its position (only the Y changed with the Y of the terrain).

Hetzen

Hi Frank

If you use the colour output of a PF to drive a Displacement Shader, rather than it's own displacement tab, you can warp that texture by set amounts in each direction around the sample point, then divide the sum of the grey values by the number of the samples taken, to give you an average grey value. Which in essence flattens an area defined.

It's easier to define the road as a straight line along x with a set width in +/- y along the origin, which you can then warp. This allows you to take weighted samples infront and behind to create gentle slopes for the road over your grey terrain, and can create in-cuts and rises. With a little more math you can create drainage ditches as well.

I had a go at this a while back with another forum member, but I've forgotton who I was working with now. Sorry.

I'll see if I can dig out the TGC.

bobbystahr

Quote from: Dune on December 17, 2012, 07:03:28 AM
My solution is basically very simple, once you know  ;)
simple but elegant appearing,  it works very well...congrats on your solve
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Matt

Quote from: FrankB on December 17, 2012, 07:00:24 AM
Hey Ulco, there is no race I'm on - even beyond this project, there's got to be a blue node way to sample the displacement of any given point on the planet, and use that for further calculations. I have a hard time imagining that your solution does that, but I'll let myself be surprised! :-)

There is :) I hinted at one solution here: http://www.planetside.co.uk/forums/index.php?topic=15377.msg149644#msg149644

The Transform Shader calls the shader at a modified point. But maybe that's not enough if you need function-based control over the exact offset. If so, use a Warp Shader instead. This basically does what the Transform Shader does, but using a displacement shader to control the offset.

Matt
Just because milk is white doesn't mean that clouds are made of milk.