• Welcome to World Machine Community. Please login or sign up.
 
June 25, 2019, 03:01:39 pm

News:

Read the Development Diary for an inside look at World Machine's progress!


Trouble With PNG Masks

Started by kris392001, August 29, 2018, 07:13:10 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kris392001

Hi All,

New user of World Machine here. I have a raw file height map and I want to apply terracing to a specific part for which I have a bitmap mask (saved as PNG - one with Alpha, one without). I bring in the mask through a file input node, set the size, tick interpret as RGB. On the node I set the display hint to Mask. All I have is 2 File inputs, an erosion generator, and a file output. I can see the mask (white for the area I want to terrace), it is in the right position. I plug the file input heightmap node into the erosion mask node, and generate. but the erosion is applied to the whole image.

I feel the steps I have taken are pretty logical, I followed the tutorial although that didn't deal with bitmap masks.


Can anyone tell me what I'm doing wrong?

Cheers

Chris

WFab

Uncheck "interpret as rgb", and use the height information as-is. Also, try inverting the mask if uncheck alone doesn't work as expected.

kris392001

September 01, 2018, 02:42:30 am #2 Last Edit: September 01, 2018, 04:36:28 am by kris392001
Thank you Pratyaksh, that worked. I'm very happy - had to uncheck AND invert. The area in the forground of the image has terraces, the background not, though this is not the final configuration of the terraces, it proves the principle. It means I can now detail various parts of the height map  per their biome.

The only issue is some guttering at the edge of the mask. It has a hard edge and I'm going to assume I can solve this with a feathered gradient.

Edit: Actually, a gradient didn't help. It obviously takes the edge to be 0, is there any way to only allow modification only to the height range within the mask? A clamp or some such?

Cheers

Chris




kris392001

Just another note - PNG masks cannot be black and white, this applies a mask to the whole image. They need to black through to transparent then they work but they seem to 0 out producing gutters around the mask, certainly when creating terraces (see image).

I'm going to try other formats. Any recommendations for the best mask format would be welcome.

WFab

In world machine, all height data, including masks, need to be black and white. RGB is for color data.

Now if I understand correctly, you are using a png alpha channel as mask. That may work with a channel splitter, but better way would be to use a simple grayscale image, preferably with floating point precision (16bits per pixel float values, tiff or png).

You need to input this mask using simple file input, and just set the scale, leaving everything as-is. The gray parts at the edges may cause some problem with terrace or erosion device, but I'm not sure about that one. I'll test on my end and report later.

kris392001

September 02, 2018, 04:47:50 am #5 Last Edit: September 02, 2018, 04:58:48 am by kris392001
Hi Pratyakash, thanks for having a look for me.

You make it sound so easy, and it should be, but the only mask format I can get to work so far is a greyscale (8 or 16 bit) PNG  with a transparent background (see image 1) But it produces the gutter. With RGB Alpha, World Machine crashes, with white in place of transparent, it just masks the whole area.

I have tried with greyscale 8 and 16bit raw (see image 2) and that just has no effect. Moving on to other formats to try.

Edit: TIFF and Targa don't work.

This is getting somewhat frustrating.

Chris

WFab

Okay, so the terrain drop and guttering both may be unrelated to the mask. What terrace device does, is apply a filter shaped like steps to the terrain. Sometimes a peak may be cut off, sometimes terrain may be lowered in places. Since the area is being masked, the area outside the mask isn't being lowered, causing a sharp drop and raise. I think that's what you mean by "guttering".

Also, the best practice is to have a mask with all opaque alpha. Or no alpha channel altogether. Wm works off brightness values of the image, transparency may interfere with that. I still haven't yet checked on my end what transparency does in a mask, just speculating at this point. I always delete alpha channel if I don't need one, so I haven't yet encountered any problem with that.

kris392001

Thank you again for your reply Pratyaksh.

With the terrain drop and guttering I am assuming it's not correct because the demo video www.youtube.com/watch?v=xG1gVlbLK8Q performs as I would expect. I understand this is a shape mask but still, I don't see why a bitmap mask should perform differently.

And with the masks, I don't use alpha channels. Raw, tiff, tga and PNG greyscale 16 and 8bit do not work. And I've had no response to a support ticket I left 4 days ago.

Chris

WFab

@kris392001: Could you send me the files? The main tmd file, and all input files (heightmap, masks).  I can test it all on my end to see what's wrong, maybe figure out a workaround if necessary.

kris392001

Thanks for the offer, Pratyaksh, I appreciate it. Stephen got back to me and the answer turned out to be embarrassingly simple. I had assumed the the Mask Extents output should be used but it turned out I needed to use the Heightfield output on the File Input node.

WFab

Alright then! Have fun with your world, and do share a screen or two when it's done!

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S save/post or ALT+P preview