Author Topic: Stepped Terrain  (Read 16879 times)

Offline efflux

  • Member
  • *
  • Posts: 2171
Stepped Terrain
« on: March 13, 2012, 02:00:00 PM »
This is a way I've used to create stepped terrains. Not sure if it's the best way but it's relatively easy. There are ways to control displacement by blue nodes only but totally arranging the steps requires control of both the fractal output values and the displacement results used from this. Each displacement node here is the amount of extra displacement that the step creates. The constant scalars on the right are the ranges of the fractal output used for each step. The output being used from the fractal is colour. The displacement settings in the fractal node do nothing. Fractals do not output -1 to 1, generally. Often they actually output beyond these values. That all depends on various tweakings in the fractal node. Each terrain will be different. The file at present will chop off anything that goes beyond 1 (not anymore - that is fixed) creating flat topped hills. Not a major issue is many circumstances but I will look into fixing that. The colour is however unclamped.

The terrain is very smooth. You can increase the roughness or the contrast in the colour tab of the fractal but other functions can be applied to create detail. The more you create steep sided hills, the less the original fractal can create nice details on those slopes. Beyond a certain roughess and you will get masses of spikes.

The last red node is called Test colour. I put this there so I could hook the ouput from each smooth step node into that as a blend to create bright colour. It won't match the steps correctly but gives a rough idea about the whereabouts of the step you are tweaking.

EDIT:


I won't remove the above text because that's part of this thread but I've removed the file first put here. A better solution has been added below so the blurb above does not totally relate to the new file. The older file was too inefficient. Some info to do with this new version is on reply 44 in the thread.
« Last Edit: March 16, 2012, 09:11:01 PM by efflux »

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #1 on: March 13, 2012, 02:26:58 PM »
I just re-uploaded the tgd. I realised that there was a subtle difference between the file and the render. The file wasn't as ideal a starting place. It's still not. It has a fault. Another file will be coming.
« Last Edit: March 13, 2012, 03:22:18 PM by efflux »

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #2 on: March 13, 2012, 03:54:06 PM »
OK guys. This has become a bit convoluted now. I've uploaded another file again to replace the first one. The clamp pulls the flatness out from the last smooth step to displace the top platform by using values above 1 but that has to have the subtract so as to not effect the rest of the terrain.

Now there is displacement node that is different at the start. That really needs to be there. You can use that to push the entire terrain up if you want. It also provides a way to hook another fractal in for more detail.

Maybe I'll find another fault but I think this file works OK.

Offline Hetzen

  • Member
  • *
  • Posts: 1653
Re: Stepped Terrain
« Reply #3 on: March 13, 2012, 04:45:38 PM »
Just thinking out loud here, but would it not be easier to use a PF outputting scaler values, which you can use a modulo to split into levels of grey, that you then plug into a displacement shader? With a little enginuity, I'm sure you can smooth out the tail end of each verticle step, to kill hard edges.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #4 on: March 13, 2012, 05:00:46 PM »
Yeah, the smooth steps are in there because I wanted it smooth. This is really crucial because TG2 does't like sharp edges and anyway they rarely exist in nature. Your method may work. It all depends on exactly the results you want and how far you need to take it. You don't want flat steps and you need to control the displacement level of each step.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #5 on: March 13, 2012, 05:15:05 PM »
Here's a render from that file. I just roughened the fractal up a little and added some colour texture.
« Last Edit: March 13, 2012, 05:17:04 PM by efflux »

Offline elipsis1

  • Member
  • *
  • Posts: 238
Re: Stepped Terrain
« Reply #6 on: March 13, 2012, 07:49:36 PM »
Awesome! Loving it!  ;D

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #7 on: March 13, 2012, 08:21:30 PM »
Hetzen.

I had a play with the modulo node. The problem is that we can't have any straight transition. I'm not sure how any nodes that do that kind of thing can be incorporated.

Ideally this is what we want. We want to control the input to the function which is the fractal's output so that we can choose ranges from that. Ideally these ranges need maths functions to smooth them. A smooth step style shape is ultimately the most useful whether created by smooth step node or by another maths function. The reason this shape is best is because it doesn't just create a smooth step within it's range but a smooth step to the next range. We could use another maths function which allows you to change this curve. That would be cool. Bear in mind though that functions which move away from smooth step create a visible join between regions but sometimes this is desirable i.e a sudden angled outcropping from a flatter step. Then we need to control the output of the function in terms of something that makes sense i.e. metres. My file doesn't make total sense in that the displacement is cumulative and then the last clamp confuses it further because that doesn't accumulate like the others but at least it kind of makes sense.

I'm not starting anything new with this at the moment but if anyone else wants to try different methods then that would be cool. Mine works if not totally elegantly. It's a case of getting things out there that simply work. I'll be taking a break and I'm just petering out from using TG2 now until I get more enthusiasm in the future.

Offline Hetzen

  • Member
  • *
  • Posts: 1653
Re: Stepped Terrain
« Reply #8 on: March 13, 2012, 10:02:04 PM »
Hi Efflux.

I've been reading your posts with great interest and learnt a few techniques along the way. So it's a shame that you're losing interest.

I had a play with the modulo node. The problem is that we can't have any straight transition. I'm not sure how any nodes that do that kind of thing can be incorporated.

I'm not sure what you mean by transition. There are issues with the modulo approach, mainly that you have to build your world in scaler, rather than displacement (although that's being looked at). What would be good, would be to step modulate the layer spacing to get variation between step hights. I'm not sure how to do that atm.

EDIT - Forgot to mention

The below is looking at a scaler PF, which is plugged into a modulo, using fractions of 1 (which you could convert to meters). You subtract that from the PF to get your step. You then take that modulo value and convert that to a 0 to 1 ramp that is smooth stepped, and this output is used to mix between the PF and the step value, this then gives you your smooth edges. You can also look at the tail end of your ramp, to create distance between the steps.
« Last Edit: March 13, 2012, 10:24:21 PM by Hetzen »

Offline mhaze

  • Member
  • *
  • Posts: 3786
Re: Stepped Terrain
« Reply #9 on: March 14, 2012, 08:38:01 AM »
How do you "convert it to a ramp"?

Offline Hetzen

  • Member
  • *
  • Posts: 1653
Re: Stepped Terrain
« Reply #10 on: March 14, 2012, 11:11:18 AM »
Hi Mhaze. Simple answer, divide the modulo output by its step value (input 2). So for example, I'm using a step value of 0.1, 0.1 divded by 0.1 = 1, the top end of your ramp. I was getting some nice effects last night with mixing between two sets of this function, with a PF modulating the modulo step value.

I don't have a release version of TG to be able to upload a clip. And besides, this is Efflux's technique, which I don't want to hijack. I just wanted to engage in a discussion on how to achieve this effect outside of using the strata shader, which Efflux has demonstrated with the added bonus of being able to have different spacings between steps. I may start another thread with a function set that has more options at a later time.

Cheers

Jon

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #11 on: March 14, 2012, 12:45:25 PM »
Thanks for the tip about the Modulo Hetzen.

Yeah, I was wondering about the ramp thing but I sussed it out last night after a bit of time.

I don't think this is good for natural type landscapes unless we can modulate it but reading you last reply I guess you're already trying this. I also notice there is now documentation at Planetside for the modulo. I knew what modulo was but didn't realise how you could use to create repeats. Just goes to show how poor documentation doesn't help. It's way cool if you use it for stuff like this as long as you smooth step it because lots of sharp steps isn't too good in TG2:

Offline Hetzen

  • Member
  • *
  • Posts: 1653
Re: Stepped Terrain
« Reply #12 on: March 14, 2012, 01:27:52 PM »
Hey that looks great! Almost like lego bricks.

Yeah I made a point of looking at each blue nodes description a while back, just to see how I could use each one. Some of the vector stuff I've had to learn via google searches. That ontop of seeing how others like yourself apply these sorts of functions. There are a few I can see no use for, but that's more down to my ignorance than anything else. Dot product is something beyond me, as I don't know why I would use it.

As sad as it sounds, I like playing with blue networks. I guess it's my version of Suduko.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #13 on: March 14, 2012, 01:35:54 PM »
The modulo works well when you apply it to geometric stuff. That last image is just two fractals stretched out in different directions. I love the way the modulo creates nice rounded type blocks where it crosses over. If that was sharp it would look nasty. I've noticed a lot of stuff in the forums where people have used functions that ended up with lots of jagged edges. This never works well.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #14 on: March 14, 2012, 01:42:09 PM »
Actually I correct myself. That last image is one fractal stretched on two separate transformers. I'm on Linux so not looking at the TG2 file.

 

anything