Home 3D Art Showcase & Critiques

The Sandcamp / Environment Challenge #56 Project Breakdown.

Offline / Send Message
B_P_L greentooth
Hi there, I was very kindly asked by Eric Chadwick to create a thread where I break down my response to the September-October 2018 Environment Art Challenge. 

Here's the challenge thread and you can see my response to it over on Artstation but in the spirit of shameless self-promotion, here again is the short cinematic I put together to give an overview of the environment:

I've been thinking about how to approach this breakdown and - so people can more easily find the parts they're interested in - I've decided to break it down into four main parts:

1. Scene setup and landscape generation workflow.
2. Landscape material. (Part OnePart Two)
3. Prop modelling with Face Weighted Normal Workflow.
4. Prop materials and blending functions. (Part One, Part Two)

I'm going to go into a fair bit of detail so in parts it may be a little long-winded for more experienced artists but I remember when I was just starting out how frustrating it was when I'd read an explainer and whoever wrote it just skipped over details that were trivial to them presumably forgetting that it's only trivial when you've done it a bunch of times! 

Anyway... onto the breakdown.


  • B_P_L
    Offline / Send Message
    B_P_L greentooth

    Layered Landscape Material Setup Part 2/2

    Rock Material Functions

    The three Rock functions that sit above the Sand are essentially simplified versions of the Sand function - there is no distance or slope blending in these layers which reduces the number of nodes and instructions significantly. Just a couple extra very simple controls are added (which could be added to the Sand function if you want, but I had no cause to use them with that layer).
    Again, you can download this graph from here.

    Apart from adding contrast control to the Height output, this graph just adds the ability to rotate your texture set, but - as mentioned in the annotations - rotating an entire texture set causes the normal map to reflect light and cast shadows at the wrong angle, so it needs to be corrected by adjusting the Red/Green values in the Vector4Parameter that the normal map is multiplied with:

    And that's about it for the Rock functions. If you build the Sand function first, you can just copy all the logic from that into a new Material function for your first Rock layer and make the necessary alterations to get the graph above.
    Then you can duplicate that new function 2 more times, change the textures, rename the parameters, inputs and outputs and you're pretty much done building your material functions. Just remember to give all your scalar, vector and texture parameters relevant names or any material instances you make from materials containing these functions will be confusing to work with.

    Custom Material Functions

    Below are the graphs of the three custom material functions used throughout the Material Functions and in the Master Landscape material.
    These are made exactly the same as the Material Functions that contain entire material graphs, but they only contain little parts of a graph and don't end up at a MakeMaterialAttributes node. When you've built these graphs, save them into your functions folder and you can drag them into your other functions or materials and hook them up as you need them

    Distance Fade function

    Doesn't need anything to be plugged into it to work, just plug the output into the Alpha slot of a Lerp node to chose between the A and B inputs according to how close the camera is. 'Fade Range' is the distance in world units where one texture fades into another. 'Fade Blur' is the size of the region where both inputs overlap, giving a blurry result. 

    Tessellation Fade function

    Again, doesn't require any extra input from the user to work, just plug this straight into the 'TessellationMultiplier' slot of your material and it will increase or decrease tessellation according to where the camera is. (Tip: go into Wireframe mode to check on how this is working). 

    Displace Fade function

    Similar to the other functions, but requires your displacement map to be plugged into the Vector 3 Function Input (labelled 'Input Displacement'). Plug output into your material's 'WorldDisplacement' slot. Will raise or lower your max displace height according to camera proximity.

    Getting the World Machine Maps and Setting up the LandscapeLayerBlend.

    World Machine Maps
    Generating the Landscape Normal and Landscape Colour maps in World Machine is easy, see below:

    Experiment with the different outputs of the ReFlow node for different looks, if you get a result that looks totally empty, try another. Pick your colour palette in the GeoColor node. Remember to check 'Flip Y' in your Normal-Map maker node. Build the world, write those outputs to disk, and you're finished with World Machine.

    Setting up Layers
    We're almost done. Once you've created all those custom functions, put together your functions you want to use as layers, and generated your World Machine maps we're now ready to add it all into our Master material, which you can see right at the start of the previous post but here it is again, this time with detail on how to set up the LandscapeLayerBlend node....
    (Here's the detail again, a bit larger)...

    Now, save the Master Material, create a Material Instance from it and apply it to your Landscape and your Landscape will now turn... Black!

    There's one last step.... Go to your Landscape tab in the Modes panel, and into the Paint sub-panel. We just need to add LayerInfo to the landscape for each of the layers in the material. Click the '+' icon next to each layer and select 'Weight-Blended Layer (normal)' for every one, save them somewhere in your Content directories (I keep mine in their own folder labelled 'TargetLayers'). 

    If after you've done all this your landscape stays black, don't worry - it sometimes needs a little kick to get it working. Try applying the Material Instance again or failing that, save everything and restart the editor.
    You are FINALLY ready to start painting. Grab a paint brush from that same panel, pick a layer to work with and go to work. Set Tool Strength low and use high Brush Falloff values to blend layers together smoothly. Holding down the shift key while painting will erase paint strokes from that layer. 

    And that's all for the Landscape Material breakdown!

  • B_P_L
    Offline / Send Message
    B_P_L greentooth

    Face-Weighted Normal Modelling Workflow for Large-Scale Environment Props

    Hi again. 

    I'm going to use the jet engine that appears in my finished scene to give a run-through of the Face Weighted Normal method (FWN from here onward) used to model the large props. To see the FWN workflow in practice, check out Star Citizen and Alien:Isolation - two games that made extensive use of the method. These same techniques were used for the architectural elements you see in my scene (basically anything that isn't an oil barrel. Or made out of wood. Or cloth. Or dirt).

    Why use FWN?

    After spending some time working on the jet engine prop it became apparent that with such a large model that the player is going to be able to walk right up to; the traditional 'sculpt-bake-paint' approach I was using for texturing was not going to result in a good looking asset. 
    This is because no matter how big I made the textures, and no matter how carefully I laid out the UVs - the model just needed to be so big that the fixed resolution of a single 1:1 texture set revealed itself every time.
    To put it another way; regardless of whether I used a 2k or 4k paint-job; up-close the engine looked less like an asset from Star Citizen, and more like something that got cut from G-Police.
    So I began looking into, and ended up settling on, the FWN workflow...

    The FWN process

    The key aspect of the FWN workflow is this - the asset does not depend on a baked normal map, or baked maps of any kind at all. The smooth, rounded edges on FWN hardsurface props are modelled into the in-game mesh - they do not come from a high-poly version. High poly models are not needed at any stage.
    By getting rid of baked maps (which are fixed in size) and replacing them with tiling textures; the model can be scaled to any size and texture resolution will always hold up. 
    Below is an extremely crude summary of the FWN workflow, followed by links to more detailed info;  
    1. The in-game model is made as normal in Max/Maya/Modo etc. but with the added edge bevels, chamfers etc. that you'd normally leave to the baked normal.
    2. A dedicated FWN script is used to automatically bias the angle of the vertex normals towards the larger faces on the mesh; so the small chamfers and bevels on corners appear to blend smoothly into the large flat surfaces they connect with. 
    3. Because there isn't a normal map generated from a hi-poly model; surface details and greebles are achieved by including additional polygons in the mesh, referred to as 'floaters'. Floaters sit just on top of the model and are loaded with a different material that only contains re-usable details like screws; welds; panel lines; vents, and so on.
    4. Also, because no baking needs to be done; a) there's no need to have a perfectly unwrapped model - tri-planar mapping can be used in the game-engine instead, and b) generic, lightweight tiling textures are used in place of fixed-size, 1:1 custom painted textures.
    There are a few downsides; the added bevels in the main model, and the additional floater polygons needed to create spot details all result in a heavier mesh than if everything were handled by a baked normal map.
    Also, when using tri-planar mapping and tiling textures, the entire process of creating materials has to be done in the game engine. If you want to blend different tiling materials together (like adding a layer of sand over a large jet engine for example...) you'll need to use more complicated functions in the material.


    The FWN workflow has been explained thoroughly in detail elsewhere, including right here on PolyCount. Rather than try to improve on those explanations I'll refer you to the ones I found useful when learning the process:
    • YouTube; Warren Marshall  I highly recommend this video if you're totally new to FWN. (Note; although he demonstrates with Modo, the principles are universal. I'll provide some specific 3DS Max info later in this post anyway).
    • YouTube: Arrimus 3D Builds on the Warren Marshall video with a short 3DS Max tutorial for building a prop that fits the style of Alien: Isolation. (Note: some of the links he provides are dead; I'll provide a link to the FWN tool I use in 3DS Max later).
    • Reddit: Star Citizen art thread. An informal written explanation of the FWN workflow used in Star Citizen.
    • Gnomon Workshop: Creating Props for Games volume 1 While not specifically about FWN, it is covered at the beginning of the course as well as going beyond the basics of vertex normals; normal maps; and normal baking. This is a great course overall.

    Making the jet engine prop in Max

    I use a script for creating FWN in 3DS Max called 'Improved Face Weighted Normals' by Cattomic, there is a free version available but I use the paid-for version which has some really useful added features. You can get it here from Gumroad, and check out this very short video for how to use it - it really is a one-click process.
    Almost every time I use it, it does the job with default settings - you just make the model, put everything you want to smooth together in one smoothing group, run the script... and it's done. It will work with models that have multiple smoothing groups, and it will leave the sharp edges between the groups as normal.


    Here's an early test version of the engine without any floater details. (I couldn't find a way to output models with tri-planar mapping or tiling textures for Sketchfab or Marmoset Viewer, so this has actually been unwrapped and had a couple of smart materials applied in Substance Painter. Under normal circumstances this wouldn't be necessary). Notice how edges and corners smooth naturally into adjoining surfaces - this is done by the FWN script and not a normal map. On this test model, chamfers were made by the standard chamfer modifier in Max (standard mode, not quad-chamfer) and very few settings were tweaked. Later models were chamfered a little more carefully.

    After this part is finished, I then duplicate selected sections of polygons to become floaters. These are given a secondary material, cut to shape and properly unwrapped (tri-planar mapping can't be used for floater materials, obviously). In UE4 the secondary material is set to be a decal and loaded with a trim sheet I made in NDO.

    The trim sheet was very quick to make as it only contains screws, shut lines, welds and some vents and things that were used elsewhere -  you can download if from here if you want. There's a bit of space left on the map that I intended to put some other things in, but never got round to it 
    By the way, this is how to set a brush in Photoshop to create a welding bead effect: 

    Ok, that's it for the prop modelling. In the next post I'll cover setting up the prop materials, including tri-planar mapping and blend functions.


  • B_P_L
    Offline / Send Message
    B_P_L greentooth

    Prop Materials, Blending and Tri-Planar Functions. 1/2

    Above; sand material blended over painted prop textures with material functions.

    In this last post, I'll cover the prop materials and functions used in the scene - including a couple of different functions that are used to integrate props with their surroundings by blending in tiling materials like sand, snow, dirt etc.
    You don't need to build or use all these functions - some might not always work together with others so well, some are more expensive than others, and some might just be more useful than others - so experiment with different combinations of functions in your master blend function.

    Master blending material overview

    This is what you see when you open the blending master material:

    .... that's all there is to it: Two functions ('Prop_Basic' and 'Sand03') that contain quite simple material graphs - both of which are run through a master function - which itself contains several different blending functions - and out into the material node. As you've probably guessed -the majority of the work goes into building that 'MasterBlend' function in the middle. I'll cover the functions one at a time, and I'll come back to the master material again at the end just to finalise a couple of settings - but first we need to change some important project settings...

    Setting project, lights and meshes to enable DF blending

    Distance Field (DF) blend functions require mesh distance fields to be generated and light sources in the level need to be movable in order to create blending masks, so some settings need changing: 

    1. Go to Settings > Project Settings > Engine - Rendering. Check 'Generate Mesh Distance Fields' under Lighting. Restart the editor.
    2. Direct lighting and skylight components already in the level need to be set to Movable. 
    3. Meshes used with DF blending need to be set to generate distance fields; double-click your mesh in the content browser to open the StaticMesh Editor; and under General Settings in the Details panel, check Generate Mesh Distance Field. (Tip: try toggling Two-Sided Distance Field Generation on/off in the LOD settings if your DF blend results don't look right).
    4. The DF Edges function requires static meshes to have Affect Distance Field Lighting disabled in the level in order to look right. 

    Prop material function

    The first function is really simple. This is for the actual painted mesh itself - to be clear this is only for models that have properly unwrapped UVs and a custom painted, non-tiling texture set - this won't work for FWN models that need tri-planar mapped tiling textures.

    There's nothing here that really needs to be explained, except for maybe the pack-map (labelled 'Prop ORS') which contains R: Occlusion, G: Roughness, and B: Specularity - none of my painted models had metallic parts* so instead of wasting the blue channel on an empty metal map I used it for specularity. Also, even though it does almost nothing - remember to hook the AO map up to the AO slot - it's needed for a blend function.

    * Painted metal isn't metallic - it's paint.

    Sand material function

    The second function is again, very simple....

    This is a much simpler version of the sand function used on the landscape - no distance or slope tiling functions and no displacement. The only thing that has been added is the 'World Colour Overlay' function - this blends the World Machine colour map with the sand colour according to where the prop is placed in the world, this is just so the sand colour on the prop matches the colour of the sand it's sitting on. It's not totally necessary as you can tweak the colour with the Vector 4 Parameter that comes before it.

    Master blend function

    Here's where all the individual functions are added together....

    This could have been all done at the master material, but it saves having to hook up all the connections each time I want to change the prop function. Still, the majority of the work is hidden in the functions in the 'Blends' group, which we'll come to next, but this shows the dependencies of each function. 
    The 'Prop AO re-add' is there to bring back AO from the prop which has been lost under the sand - it's just multiplied back over the sand before blending.
    'Prop Normal Transform' converts the prop's normal map into World Space to make it compatible with the sand normal, (which is converted to WS inside the DFblend function).

    Ok, that's it for this half - in the final part I'll post the contents of the blend functions and the tri-planar function needed to map any FWN assets in the scene.

  • alytlebird
    Offline / Send Message
    alytlebird greentooth
    Wow... this is absolutely nuts. Not used to seeing this much breakdown info given out outside of 80level articles and paid tutorials. Awesome work with the scene, and thank you so much for going so in-depth with this. I bet it's going to be extremely useful to a lot of people.

    It's actually somewhat funny timing because I've got a landscape environment project for my Environment Design class over the next couple weeks, and this is probably gonna help me through that whole assignment. So thanks. :)
  • B_P_L
    Offline / Send Message
    B_P_L greentooth
    @alytlebird No problem, I hope you get some use out of it.

    I wanted to go a bit further with this because a lot of things on Polycount have helped me out in the past, so it's nice to be able to contribute for once. Also, I remember how frustrating it was when a breakdown didn't quite give me the info I was really after.

    And like I said in the last post - occasionally going back and carefully analysing your own work like this can be a valuable exercise in itself.

  • RustySpannerz
    Offline / Send Message
    RustySpannerz polycounter lvl 10
    Excellent breakdown! Going to have to bookmark this one!
  • B_P_L
    Offline / Send Message
    B_P_L greentooth
    @RustySpannerz - glad you like it dude, and thanks for taking a look. 

  • TangDao
    Offline / Send Message
    TangDao polycounter lvl 2
    Great scene and really nice breakdown.I thought the distance field blending explanation was especially clear on a somewhat complex topic.Resampling the landscape in UE4 is increasing your resolution without increasing your size so your at twice default giving you 2 vertex per meter,am I remembering that right?
     Also what were your reasons for doing all your rocks as landscape materials rather than detail mesh?
  • B_P_L
    Offline / Send Message
    B_P_L greentooth
    TangDao said:
    Great scene and really nice breakdown.I thought the distance field blending explanation was especially clear on a somewhat complex topic.

    Sorry for delayed reply - but thanks for the feedback, glad you got something out of it.

    TangDao said:
    Resampling the landscape in UE4 is increasing your resolution without increasing your size so your at twice default giving you 2 vertex per meter,am I remembering that right?

    Yeah, close enough: 4336px ÷ 2158m ≈ 2.009px/m
    If you need a greater density of vertices on the landscape mesh but don't want to increase the resolution of the heightmap from World Machine (building a complex World Machine project at 8k can take a really long time, even on a fast machine) you can still upsample further - UE4 will just resample the incoming heightmap internally. I've never tried this though.
    If you're worried about detail, I've so far found that the normal map from World Machine helps to sell fine details on landscape features like distant mountains pretty well without needing to go up to huge resolutions.

    TangDao said:
     Also what were your reasons for doing all your rocks as landscape materials rather than detail mesh?
    Just from looking at the concept - the vast majority of the landscape is desert, so... it's just sand really.
    In the foreground you can make out parts of a rocky underlying surface that aren't totally covered by sand in a few spots. It didn't make sense to make rock assets and set up blending materials for them and make the sand match the landscape etc. when just a tiny bit of rock was going to be breaking through the sand.  

    Hope that helps,
  • rogrobin
    Offline / Send Message
    rogrobin polycounter lvl 6
    Nice detailed breakdown of a great looking scene. Wow.  Youve really taken the time to clearly explain your process -which is so helpful.  I much prefer learning in this way to watching tutorials.

    Thanks for taking the time to put this together -I need to delve into this as there are quite a few things here that I can learn from.

    Many thanks man. Bookmarking this!


  • B_P_L
    Offline / Send Message
    B_P_L greentooth

    No sweat! Hope it helps.
Sign In or Register to comment.