Mutliples in Terragen?

Started by WAS, October 25, 2018, 08:38:26 pm

Previous topic - Next topic

WAS

October 25, 2018, 08:38:26 pm Last Edit: October 25, 2018, 08:43:58 pm by WASasquatch
Is it possible to do a conditional to check multiples? Ex ( altitude / scalar ) != 0

Additionally have it recursive for height? From like 0 - alt or alt - 0

What I was thinking of doesn't provide me anything
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

WAS

Also thought about the logic this way but still not able to get any result. I think the issue is I'm not sure how to loop through the available altitude (if any).

Actually, my else input just defaulted accidently to the displacement multiplier, which should be the displacement to scalar, so it is proving a else result.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Oshyan

There are no loops and, as far as I'm aware. The Conditional nodes would be an example of conditionals.

- Oshyan

WAS

Well it is a conditional. Multiples in programing.

For example, the second image shows a working method (minus defaulted else result that should be a disp scalar), just no ability to actually loop through the alt.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Matt

What do you mean by multiples? Are you looking for 'modulo' ? If so, there's a node for that, as well as rounding to the nearest integer.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

October 26, 2018, 08:03:10 pm #5 Last Edit: October 26, 2018, 08:13:03 pm by WASasquatch
Quote from: Matt on October 26, 2018, 06:33:31 pm
What do you mean by multiples? Are you looking for 'modulo' ? If so, there's a node for that, as well as rounding to the nearest integer.


I was looking to occur a result on altitude at certain multiples applying a effect if so, if not, piping original scalar.  For example 100, would be happening every 100 meters.

Think of basic programming like printing columns or rows where you want to establish a new column/row... or even more basic in old HTML/CSS styling columns with different cololours

https://ideone.com/yGYjwY

Was hoping to be able to go by altitude and thus effect terrain wherever by altitude without actually doing it by masks.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Matt

I think this is what you need:

https://planetside.co.uk/wiki/index.php?title=Modulo_Scalar

<terragen_clip>
   <modulo_scalar
      name = "Modulo scalar 01"
      gui_use_node_pos = "1"
      gui_node_pos = "-300 820 0"
      gui_group = ""
      enable = "1"
      input_node = "Get altitude 01"
      gui_use_preview_patch_size = "0"
      gui_preview_patch_size = "1000 1000"
      input_2 = "Constant scalar 01"
      >
   </modulo_scalar>
   <get_altitude
      name = "Get altitude 01"
      gui_use_node_pos = "1"
      gui_node_pos = "-300 960 0"
      gui_group = ""
      enable = "1"
      input_node = ""
      gui_use_preview_patch_size = "0"
      gui_preview_patch_size = "1000 1000"
      >
   </get_altitude>
   <constant_scalar
      name = "Constant scalar 01"
      gui_use_node_pos = "1"
      gui_node_pos = "-100 900 0"
      gui_group = ""
      enable = "1"
      input_node = ""
      gui_use_preview_patch_size = "0"
      gui_preview_patch_size = "1000 1000"
      scalar = "100"
      >
   </constant_scalar>
</terragen_clip>
Just because milk is white doesn't mean that clouds are made of milk.

WAS

October 26, 2018, 10:57:31 pm #7 Last Edit: October 26, 2018, 10:59:05 pm by WASasquatch
Quote from: Matt on October 26, 2018, 10:21:28 pm
I think this is what you need:

https://planetside.co.uk/wiki/index.php?title=Modulo_Scalar

<terragen_clip>
   <modulo_scalar
      name = "Modulo scalar 01"
      gui_use_node_pos = "1"
      gui_node_pos = "-300 820 0"
      gui_group = ""
      enable = "1"
      input_node = "Get altitude 01"
      gui_use_preview_patch_size = "0"
      gui_preview_patch_size = "1000 1000"
      input_2 = "Constant scalar 01"
      >
   </modulo_scalar>
   <get_altitude
      name = "Get altitude 01"
      gui_use_node_pos = "1"
      gui_node_pos = "-300 960 0"
      gui_group = ""
      enable = "1"
      input_node = ""
      gui_use_preview_patch_size = "0"
      gui_preview_patch_size = "1000 1000"
      >
   </get_altitude>
   <constant_scalar
      name = "Constant scalar 01"
      gui_use_node_pos = "1"
      gui_node_pos = "-100 900 0"
      gui_group = ""
      enable = "1"
      input_node = ""
      gui_use_preview_patch_size = "0"
      gui_preview_patch_size = "1000 1000"
      scalar = "100"
      >
   </constant_scalar>
</terragen_clip>


I think that is pretty much what I tried to do with my first attempt at terrain stepping with modulo but wasn't sure how to use it to use it to apply to the terrain.

https://planetside.co.uk/forums/index.php/topic,25829.msg256234.html#msg256234

Let's see what else i can come up with with it.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

WAS

Well, I thought about it differently and came across this lol still not what I'm after.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Hetzen

WAS, Duncan right? Sorry I'm crap with names.

Modulo is a really cool function for what you're trying to get to. I like to divide the modulo output by the modulo scaler input, that will give me a range of 0-1 for each step, rather than an output which depends on the modulo input2 amount. Then you can throw that at what you're trying to form. eg multiply by pi into a sine function which will give you half a phase of a sine wave each step, ie the positive bump every step you've set input2 to.

Conditionals are an unforgiving beast as you've found with that network. They often give harsh results, if not used properly.

I'll use them for two things; one to cut off any complicated calculation. If a simpler calculation of a mask says zero, then I don't want the extra processing in my render. ie don't bother looking at those hundreds of nodes if the mask made by a couple of nodes says zero. Can cut out a shit load of rendering time. Especially with cloud stuff.

The other is when you want to combine two scaler patterns and want the larger value through over the test. So for example, you have two PFs outputting 0-1 colour space. You plug one PF into the input. The second into the comparison. The logic then goes if Input is 'greater' than Comparison, then pass Input else show Comparison. This can give great patterns that cut over the other, a bit like the Merge function works with displacements, but you're working in colour space.

WAS

Jordan, actually. Duncan is one of my favorite characters from the Dune saga, however.

Wow, this is a lot to think about, some cool ideas you've given. I'm still not sure i understand the process of utilizing the modulo to apply exactly what I want, especially adding pi through a sine.

Mathematics and me are not friend, as much as I dabble in fields which require it I do have really bad dyscalculia which really effects my understanding and ability to perform in it.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Hetzen

Sorry Jordan. I've etched that into my brain now. I'm a big fan of Lynch's Dune.

Yeah modulo counts up to the input you give it. So, if you use Get Altitude as your main input, and you want things to happen every 100 meters, input2 on your modulo scaler is 100. But your output will be 1-100 every 100 meters. If you want that to drive things, ie a mask, a mask should only work with values 0-1, so divide your modulo output by your input (100) will give you that scale.

Trig functions work in radians, so a range of 0-1 needs to be multiplied by 2 x pi to give a full sine wave (ie positive bump to negative dip). The example I gave above only looked at the positive bump, so you only need half of it's phase, so just pi, no need for the x2.

WAS

I feel very accomplished Hetzen... Thank you a lot! It's hard to express how excited I am right now via text but I'm ecstatic.  :D :D

Now to see about testing some thing with it's use.

I won't tell you how many times I read your posts and wrote on paper...
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Hetzen

Well, pleased to meet you Jordan. I'm a Jon in this fractal landscape.

If you want to recreate a simple strata function try this....

Displacement to Scaler - Modulo every 100

Displacement to Scaler subtract above result

That will give you hard steps every 100 meters when you plug that result into a Displacement node.

WAS

Oh interesting, I think that's more along the lines of what I was initially going for. I wonder if there is a way to blend the resulting scalar by original disp to scalar with some sort of constant scalar to controll the slop from hard to soft or nothing (original).
Check out my Terragen Discord: https://discord.gg/Vy5FRTE