Stepped Terrain

Started by efflux, March 13, 2012, 10:00:00 AM

Previous topic - Next topic

efflux

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.

efflux

#1
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.

efflux

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.

Hetzen

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.

efflux

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.

efflux

#5
Here's a render from that file. I just roughened the fractal up a little and added some colour texture.

elipsis1


efflux

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.

Hetzen

#8
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.

Quote from: efflux on March 13, 2012, 04:21:30 PM
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.

mhaze

How do you "convert it to a ramp"?

Hetzen

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

efflux

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:

Hetzen

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.

efflux

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.

efflux

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.