challenge

Started by Dune, March 18, 2014, 12:47:04 PM

Previous topic - Next topic

bigben

Quote from: bobbystahr on May 14, 2014, 06:21:06 PM
Can't wait to see the outcome of this. The technique with the terrains could be also used for roads.

It could indeed. Strip out the rails and replace the sleepers with white lines. The masking requirements are very similar. The only drawback I can think of is that  I can only build circular curves, but the approach of smoothing the terrain could be adaptable to other models. I have a couple of other ideas for generating the second terrain but that'll be something to try a the end.

mogn

I think I have found a pure blue nodes solution. I don't like nodes where the outcome depends on an artistic evaluation.
The solution requires 3 perlin noises.
The creation of a sleeper attached. 



bigben

A little more masking. There are a few problems when you try and work with sharp displacements and I may need to at least put a small gap in the sleepers to place the tracks rather than merging the sleeper and rail displacements.  There are some problems that come when you work with very sharp displacements, so this may be a theoretical exercise.

In this version:

  • 100m gradient either side of the track (yes, it's very wide but 100 simplifies the maths to calculate black and white levels of the masks) This could also be useful for controlling vegetation near the track
  • Embankment displacement for demo purposes
  • Additional raised area for the gravel
  • Sleepers and rails (to be filled with gravel (fake stones)

The mask model is symmetrical. I decided against doing individual inner/outer (or left/right) masks

Dune

Yes, you need a little softness to the edges, that's why I always worked with image maps (with the problem of not being able to rotate the sleepers with the track). Or a smooth step or color adjust will do in this case. Procedural rails can't be lifted off the ground and have to be inversely masked by the sleepers for a level top. I used some bent elongated displacable cubes lately. But you have to bend them (redirect/vector displace) the same way as the track.

bigben

That looks pretty good.

The beveled edges aren't too much of a problem in mine. They're just in there for visual representation at the moment. The linear mask can be used to control the merging of a displaced terrain rather than doing the actual displacement.  Have to learn more about vector displacement

Dune

Vector displacement is very interesting!

bobbystahr

Quote from: Dune on May 17, 2014, 06:03:01 AM
Yes, you need a little softness to the edges, that's why I always worked with image maps (with the problem of not being able to rotate the sleepers with the track). Or a smooth step or color adjust will do in this case. Procedural rails can't be lifted off the ground and have to be inversely masked by the sleepers for a level top. I used some bent elongated displacable cubes lately. But you have to bend them (redirect/vector displace) the same way as the track.

Edging on photo real on these tracks...great work.....
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

bigben

One of the problems with my procedural approach is you have the roughness of the fractal terrain.  I experimented with a quick idea I had for creating embankments and cuttings.  Produced an orthographic render of the terrain with a shader to give me a greyscale displacement map from a specified minimum altitude.   Opened that in Photoshop and performed a Gaussian blur and used the resulting image as a displacement map for a second terrain. Connect both terrains to a merge node and use the embankment displacement mask from the first test as the mix controller.

The blurred terrain should be higher at dips and lower at ridges than the original terrain. The mix controller will then automatically create both embankments and cuttings. The resulting smoother terrain under the tracks fixes a lot of the problems with sharp displacements for the sleepers and tracks resulting from small scale displacements in the fractal terrain.

bobbystahr

Quote from: bigben on May 17, 2014, 10:17:55 AM
One of the problems with my procedural approach is you have the roughness of the fractal terrain.  I experimented with a quick idea I had for creating embankments and cuttings.  Produced an orthographic render of the terrain with a shader to give me a greyscale displacement map from a specified minimum altitude.   Opened that in Photoshop and performed a Gaussian blur and used the resulting image as a displacement map for a second terrain. Connect both terrains to a merge node and use the embankment displacement mask from the first test as the mix controller.

The blurred terrain should be higher at dips and lower at ridges than the original terrain. The mix controller will then automatically create both embankments and cuttings. The resulting smoother terrain under the tracks fixes a lot of the problems with sharp displacements for the sleepers and tracks resulting from small scale displacements in the fractal terrain.

Well beyond my ability to do/understand really, but I'm totally impressed...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

j meyer

Cool development.
I'm still trying to understand the first file and look forward
to inspect the next one.

bigben

I wouldn't be too impressed Bobby, I screwed up the placement of the image map (forgot to centre it) and when I fixed that, the noise in the image destroyed the model  ::). So a vector displacement of a plane it will have to be.  At the end of this, most of the nodes doing the math can be hidden, leaving just the nodes required for placing the track and connecting the pieces left visible.

I'm happy to explain specific bits in detail if it helps Joel. This approach to building masks is very useful eg my old tiled terrain method (those masks can now be simplified with using SSS), or my river/lake model where a single base mask can be turned into several different masks with a few simple adjustments. I'll make a version which previews a few of the "landmark" nodes in the progress of constructing the final mask.

One thing I've got out of this is that while trying to figure out how to smooth the transitions between masks, particularly changing the altitude of the track I finally spotted the obvious... use a sine function on the linear gradients.

Dune

I'm curious about your last sentence, Ben.
Regarding the fractal noise hindering the track, that's why I use a very smooth terrain to begin with, and mask out the track area for the finer/rougher displacements.

bigben

I wanted to keep the track level even on slopes. I've moved the embankment/cutting and gravel base (without fake stones) into the terrain where it really belongs.  I was aiming for the tracks to be able to go through any terrain, and to this end I'll be adding a start and end altitude for each section. I'll have two terrains that will be merged using one of the masks as a mix controller.  That will ensure both a level track and a smooth surface for the subsequent displacements.

There is still the problem of colours "streaking" up the vertical faces of the sleepers and rails. Not sure of the best way to deal with that, maybe make the sides not-quite vertical.  I also get the colour from the sleepers going up the side of the rails... You can see these best on the vertical sides of the rails.

bigben

A quick check on combining with a random terrain to test cuttings and embankments.

Dune

If you make the rail mask slightly soft, you can color adjust the mask for the rail color mask, and loose the bleeding. That's what I did.