Author Topic: Stepped Terrain  (Read 16887 times)

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #15 on: March 14, 2012, 01:50:17 PM »
Dot product can be used to get values between vector angles to effect certain surface directions differently but I'm no maths expert by any stretch of the imagination. I just know how it could be used if you knew how. I used to use it in Mojoworld to make the sun direction effect colours differently. Other than getting slope values, dot product effects would be quite weird. Strange colour shaders that move from one colour to another depending on whatever vector values you are using.

Offline Hetzen

  • Member
  • *
  • Posts: 1655
Re: Stepped Terrain
« Reply #16 on: March 14, 2012, 01:53:16 PM »
Yeah, that's the part I don't get yet.

I know what you mean about hard edges, my squared rock experiments look worse than they really are. Infact, there are all sorts of curves on the extrusions to avoid nasty edges, as well as trying to avoid verticle sides (stretched textures). The problem arises when you apply it to 'natural' terrain. Still ongoing that one. But I don't mind hard edges at the base of features.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #17 on: March 14, 2012, 02:00:06 PM »
Yeah, hard edges are actually OK in places. If they are all over on rough surfaces then it tends to get nasty. I think since hard edges rarely occur in nature they tend to look nasty anyway. Then there is the problem of applying displacements over hard corners. It just accumulates into a terrible mess and TG2 has an excellent feature as well in it's smoothing to stop hard angles causing displacement breakages. This is in fact one of TG2s unique and great features. In other apps you end up with displacement artifact hell. Actually, that leads me to think about dot product again. There are probably a host of uses for that in displacements by manipulating the angles. I was thinking purely in terms of colour before. Thinking back, I'm sure I have files where I've used dot product to actually smooth angles.

Offline Hetzen

  • Member
  • *
  • Posts: 1655
Re: Stepped Terrain
« Reply #18 on: March 14, 2012, 02:08:12 PM »
Could it be usefull in making a step edge more verticle? By say using the ramp between each step to lateral displace oppposite to it's x,z normal?

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #19 on: March 14, 2012, 03:09:11 PM »
I don't know but I'm going to take a look at using the modulo again today to see what else it could do.

We have a way to create large smoothed steps. Even if my file isn't the best graph (there could be a better solution) what it does is what I was after. You can manually move large steps around to create cliffs, mesas or whatever. What we are lacking is a function to create steps similar to strata and outcrops but without the hard edges. Even strata and outcrops has a repeat so in some circumstances you can see that. Ideally we could create strata if the fractal allowed us to change it's position to altitude like we can with the noise functions. However, this doesn't really create clear steps anyway since it uses the fractals profile if you displace it.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #20 on: March 14, 2012, 03:25:44 PM »
Actually, it's not even so much that we have edges with the strata and outcrops but it's the facteted nature of it. This creates a certain kind of hard rock look which is cool but I'd like to have more smoothness especially to create slightly larger steps.

Offline Hetzen

  • Member
  • *
  • Posts: 1655
Re: Stepped Terrain
« Reply #21 on: March 14, 2012, 03:30:08 PM »
You can already shift a PF with the Warp shader. I've used this to shift a PF around a point, to get an average value, which can be used to smooth out the slope of a road along it's length and it's width.

I'm still not sure on how to get random spacing between steps, I'm thinking an altitude into a voronoi cell/difference, but I've run into problems with that approach before. Goms mentioned sampling an offset sine curve in an old thread, which might be the way to go. I shall have a play with some ideas tonight.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #22 on: March 14, 2012, 04:50:32 PM »
It's easy enough to distort the modulo. I've tried that and it's quite cool. You just mix two values for it with a Perlin. I've tried various altitude methods but that seems to be no go.

I'm not sure what you mean about shifting the powerfractal with a warp shader. I know you can do stuff in this direction as far as moving the powerfractal around but the biggest fundamental flaw of TG2 is not being able to simply change the position coordinates that the powerfractal uses. It makes proper masking impossible, for example. This limitation has to actually be changed. Matt has suggested that he will do this. It would certainly make TG2 unviable if it isn't changed.

Offline Hetzen

  • Member
  • *
  • Posts: 1655
Re: Stepped Terrain
« Reply #23 on: March 14, 2012, 05:08:30 PM »
You can easily move the texture space within a chain, thus repositioning the origin. Plug a PF into a warp shader's shader input, then use a redirect conected to the warper input. Then plug a displacement shader into each direction input you want to use on the redirect, then your values into the displacement shaders. This will shift the PF around what values you drive the displacement shaders, wether that's a static scaler, or a modulated value. I've used this technique to twist PFs into cone shapes for a hurricane, and sample another PF by offsetting the origin to determine if I create a sphere in a 3d grid location in one of my cloud experiments.

It's a bit convoluted, but there are plans, like you mentioned, to make this easier. But it can be done right now.

Offline Hetzen

  • Member
  • *
  • Posts: 1655
Re: Stepped Terrain
« Reply #24 on: March 14, 2012, 05:15:18 PM »
You just mix two values for it with a Perlin.

This is something I should use more often. That sounds like a good idea.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #25 on: March 14, 2012, 05:24:22 PM »
Yeah, it's crazy sometimes the way you just hook something up that is simple and works. Of course there are lots of ways you could essentially distort the modula steps, after they were actually created for example so this is not really a unique thing. What we want is for it to change step size vertically.

As for the positions thing. I can see how you can move that around. Matt even says that there is a way to change surface position to another position but that would need to be say, geometry position. Not really sure how you'd do that but it's really not viable anyway. You're node setups would be ludicrously complicated.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #26 on: March 14, 2012, 05:39:24 PM »
This is what you get when you use a perlin to mix the modulo input. You can radically distort it up way beyond this.

Offline Hetzen

  • Member
  • *
  • Posts: 1655
Re: Stepped Terrain
« Reply #27 on: March 14, 2012, 05:42:09 PM »
Nice.

I went a little harder with my displacements.

Offline efflux

  • Member
  • *
  • Posts: 2171
Re: Stepped Terrain
« Reply #28 on: March 14, 2012, 05:53:20 PM »
That's looking very cool. I think this modulo angle is going to yield some great results. Even just shifting it around a bit makes it more natural. I was thinking that subtracting a voronoi 3D A on steep slopes like I was doing in the terrain altitude blend thread would create vertical rock like features which blended with the horizontal modulo steps would create very nice chopped up rocks.

Offline Hetzen

  • Member
  • *
  • Posts: 1655
Re: Stepped Terrain
« Reply #29 on: March 14, 2012, 06:53:27 PM »
Yes, I think it would.

The displacements I used were a bit extreme, and I didn't have final normal switched on for my rock population, so there's some exploding stones in the below pics. Shame, as there were some interesting structures.
« Last Edit: March 14, 2012, 06:55:13 PM by Hetzen »

 

anything