Possible Add Scalar Bug

Started by HenrikM, June 24, 2020, 01:00:17 PM

Previous topic - Next topic

HenrikM

Hi,

I am a Terragen newbie, so I may very well do something wrong. It looks to me like the Add Scalar node is broken in Terragen 4.4.64.

I am working on Paul Carpenter's waterfall tutorial from 2008. In the tutorial, Carpenter creates a node network that generates an elliptic mask. The mask is then used to constrain a cloud to a waterfall shape.

I found that when I built the node network from scratch, it did not work. I then copied Carpenter's network from his sample file, and it did work.

The networks were identical. I could not find any difference, so I started replacing nodes in Carpenters version, one by one, to see if the network would stop working at any point.

When I replaced the original Add Scalar node with one I had created myself, the network stopped working.

I switched back to the node I had copied from Carpenters file, and the network generated the mask.

I have included screenshots. The mask is inverted, because I have excluded a couple of downstream nodes that are not relevant to the problem.

Am I screwing up somehow, or have I found a bug?
Is this the right place to report the bug, or is it better to send an email to support?

/Henrik

WAS

Can you paste the both nodes into a [*code] tag? We should be able to see any settings differences carried over from versions.

HenrikM

<!-- This is the node that works. Copied from a file from 2008. -->
  <add_scalar
  name = "Add scalar 01_1_1"
  gui_use_node_pos = "1"
  gui_node_pos = "-1480 360 0"
  gui_group = "Waterfall Test 3"
  enable = "1"
  input_node = "Multiply scalar 03"
  gui_use_preview_patch_size = "1"
  gui_preview_patch_size = "3.90625 3.90625"
  input_2 = "Multiply scalar 01_1_1_1_1"
  >
  </add_scalar>

<!-- This is the node created in Terragen 4.4.64s. It does not work -->
  <add_scalar
name = "Add scalar 04"
gui_use_node_pos = "1"
gui_node_pos = "-1780 320 0"
gui_group = "Waterfall Test 3"
enable = "1"
input_node = "Multiply scalar 03"
gui_use_preview_patch_size = "0"
gui_preview_patch_size = "1000 1000"
input_2 = "Multiply scalar 01_1_1_1_1"
>
</add_scalar>
The only difference I can see is in the gui_use_preview_patch_size and gui_preview_patch_size attributes.

WAS

Quote from: HenrikM on June 24, 2020, 02:57:00 PM<!-- This is the node that works. Copied from a file from 2008. -->
  <add_scalar
  name = "Add scalar 01_1_1"
  gui_use_node_pos = "1"
  gui_node_pos = "-1480 360 0"
  gui_group = "Waterfall Test 3"
  enable = "1"
  input_node = "Multiply scalar 03"
  gui_use_preview_patch_size = "1"
  gui_preview_patch_size = "3.90625 3.90625"
  input_2 = "Multiply scalar 01_1_1_1_1"
  >
  </add_scalar>

<!-- This is the node created in Terragen 4.4.64s. It does not work -->
  <add_scalar
 name = "Add scalar 04"
 gui_use_node_pos = "1"
 gui_node_pos = "-1780 320 0"
 gui_group = "Waterfall Test 3"
 enable = "1"
 input_node = "Multiply scalar 03"
 gui_use_preview_patch_size = "0"
 gui_preview_patch_size = "1000 1000"
 input_2 = "Multiply scalar 01_1_1_1_1"
 >
 </add_scalar>
The only difference I can see is in the gui_use_preview_patch_size and gui_preview_patch_size attributes.

I wonder if that effects the 2D preview? :P Perhaps it's zoomed out too far? Does it render correctly (the bugged one) in full render?

Your working shader is zoomed down to about 3m where your "bugged" one is zoomed out to 1000m. So you may not be able to see the circle effect.

HenrikM

It is likely you are right. However, I haven't found a way to change those parameters from inside Terragen yet. I can just use the copied nodes, but that way, I don't learn how do det a waterfall up properly.

There seems to be other problems too. The demo file works, and it is possible to render a waterfall. However, when I applied the working version of the mask to a cloud I had created, the mask did not work.

Copying and pasting the original cloud did not help either.

I'll look at the problem again after a good night's sleep.

WAS

The + and - button on the upper right side of a shader preview.

I'm sure there is location parameters to the function that mean it may not be in the cameras view.

If you're comfortable sharing the file we can usually figure out the issues a lot faster than guessing.

Dune

What cloud did you use? v2 usually has move textures with cloud off (and that's the one from the tutorial), while the newer v3 cloud has textures move with cloud on by default. There may be your problem.

HenrikM

Thank you for the help!

First of all: The scalar worked! All I needed to do was changing the viewing scale.

I used the v2 cloud, because that was what the tutorial used.

And, yes, at least part of my problems may be because the textures don't move with the cloud. Thank you for the information!

I tried an alternative route, by using an image as a mask instead of the node network. That did not work either. No matter what I tried, the mask did not actually mask anything. That may well have to do with the mask being in the wrong place. I did set it to use the same coordinates as the cloud itself though.

The only thing I managed to do that affected the size of the cloud, was directly changing the size parameters, but then I ended up with a not-the-leat-bit waterfally floating ball of fog.

Right now, I am torn between either using the entire setup from the tutorial file, and build the environment around the waterfall, or, to rebuild everything from scratch using the v3 cloud instead. 

I think I'll try the v3 variant first. Might be a little bit easier.

It is worth the effort to experiment a bit. A nice looking, parameterized, reusable waterfall, would be a useful thing to have.

HenrikM

I finally got the waterfall to work using a Cloud layer v3.

My next step will be to see if I can control height, position, and size. If I get that to work, I'll test the waterfall by building a scene around it, and if that works, I'll upload the files, so others can use it.

Dune

Good that want to experiment, but I made it a bit easier for you and did a quick, basic setup just now to dissect and study. Check it out here: basic waterfall

HenrikM

Quote from: Dune on June 26, 2020, 04:17:58 AMGood that want to experiment, but I made it a bit easier for you and did a quick, basic setup just now to dissect and study. Check it out here: basic waterfall

Thanks!

I do need the help. I managed to set up a waterfall as per the tutorial I was following, but then found I could not control the height of the waterfall. Changing cloud height and moving just made the waterfall thinner.

Masking it did not work either. I tried to do it algorithmically, and with a bitmap mask, but I wasn't able to combine the XZ plane mask I had, with an XY plane mask.

I'll study your example, and see if I can get my head around it.