Paint on top of slope painted landscape.

Hey all.

I’m still new to UE and game design in general, so still figuring out all the ins and outs.

Anyway, I have a texture that is auto painted based on slope but I would still like to be able to either paint by map height (snow and river bed) or by manual painting but I cannot figure it out.

Heres how I have my material setup so far:

So if anyone has any suggestions that’d be great :slight_smile:

Thanks in advance.

Illarvan

You are on the right track, you just need to figure out how you want your slope code to interact with the painted and height code. I would write out and think through exactly what you want to accomplish then it’s easier to give you more direct help, 2 examples of how it could go:

  1. Slope blending is overridden by height so that i no longer get slope blending on white mountain tops or river beds. Slope and Height blending will be overridden by painting so i can apply exactly what i want!

  2. Slope blending will be painted using a specific channel. The exact slope textures will be determined automatically by the height data. This will allow me to have auto slope where ever i want specifically but always be appropriate based on the height.

Both of those example use all three methods to very different results.

For some high level overview on painting:

Painting depends on the type of surface.

For landscapes (actual Landscape™) you will need to set up landscape layers. Plenty of documentation on this (it may be in your material screenshot even but the resolution wasn’t good enough to tell.) If you need extra help on it just ask.

For non-landscape meshes you will use vertex colors. (Also a good bit of documentation out there).

For Height based blending you can get the Pixel/Vertex World Space Position easily in the shader. The harder part of this is being sure the range you are working in is accurate. If you only sample world position of a vertex then moving the landscape up will cause the values to change. You can do some small math to make it relative to the landscapes position to keep the height blending the same even if the landscape is moved.

Basically I’m just trying to find the best way to do it. Learning as I go pretty much. :slight_smile:

I originally had my landscape hand painted, but I wanted to learn a better way to do it in the future.
I have tried with height maps exported with my landscape (world builder) but I wasn’t happy with it, something wasn’t quite right with it, but I don’t remember exactly what.

Currently I’m using material functions that are then plugged into my landscape material. I can post a better picture if needed.
I’m happy to use which ever technique, as it’s all new to me so I have no habits to break.

I think number 1 sounds more like what I am trying to do :slight_smile:

  1. Auto setup material so most of the work is done. Grass, mud, rock blending happily.

  2. Add snow to the top, mud to the bottom.

  3. Be able to paint on top walking paths etc…

you will need to set up some landscape layers. Follow the docs for this:

https://docs.unrealengine.com/latest/INT/Engine/Landscape/QuickStart/4/

Once you have some basic layers set up you can decide how to begin plugging in your auto slope output. Basically have layers such as default, path, grass, dirt, snow, mud.

You can then plug your slope math into either just default or into a lerp for blending on each layer on slopes.

Height can be good for maybe mountain tops and i would just apply that after your slope logic in a Default type layer so you can paint over it. Optionally you can plug your height as a blend in your slope logic to blend different textures based on height and support slopes at height as well.

For river beds i would just paint these. Height won’t handle them well. Picture a plateau with a river but then a large hill running down one side. The river’s bottom would be higher than the hillside and the land below the plateau.

I would start by understanding each aspect. Make a shader with slope blending. A shader with height blending. A shader with painted layers. Once you understand each one it will be more obvious how to progress to get your desired look.

I think I get it. I had layers from the start, i’ll go back to it.

The bit I don’t understand is how get and/or use the height, lets say I want to start the snow 1000m up or something?

Here is an example:

startBlend is where the blend will start. (starts blending from rock to snow)
endBlend is where it finishes (snow)

The values are in world space.

Thanks guys, I managed to get it sorted with what you both posted. I now have a graph using height based masks (are these technically called splat maps?). World position height based snow and the ability to paint on my landscape :smiley:

Only took me 2 days to figure it out -.-