Home 3D Art Showcase & Critiques

The Sandcamp / Environment Challenge #56 Project Breakdown.

greentooth
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.

Replies

  • B_P_L
    Offline / Send Message
    B_P_L greentooth

    Scene Setup and Landscape Workflow in UE4 and World Machine + GeoGlyph 2.0

    I tend to go straight into Unreal to begin blocking out an environment like this, as opposed to setting up a fixed camera in Max. I may go more into the reasons why as an addendum to the thread later, but the simple version is this; in my experience, the FirstPerson camera in the game engine behaves nothing like a cinematic camera. As a result; the way the viewer perceives scale and proportion is so different between these two camera types that it's almost impossible to translate a scene that was built for a cinematic view into a FirstPerson view without entirely rebuilding everything.

    So, in UE4 I start out with the basic First Person game template, select all the geometry and trash it. The lighting setup and FirstPerson camera give us a good scene to begin working with.

    Adding a 2km, 2k Working Landscape (To be resampled to 4k later).

    A 2km Landscape is more than enough real-estate for this project, and 2k is a decent working resolution to get it looking how you want before outputting it at 4k once you're happy with it. 

    For reasons I think I understood once, but have long since forgotten - landscape sizes and resolutions in UE4 are based around slightly odd numbers, so a '2km 2k' landscape is not actually 2 kilometres and it's not actually 2048 pixels square. If you try to use an actual 2048sq heightmap for your UE4 landscape it'll get cropped or expanded to fit, and this can get pretty annoying when you're going back and forth between World Machine and UE4. 
    So if you just follow these settings in UE4 and WM you'll have consistency, nothing will get clipped, you wont get annoying pop-up messages every time you re-import the heightmap and it can be easily upscaled to a higher resolution later when you're ready.

    Go to the Landscape tab in the modes panel in UE4 and in the 'Manage' sub-panel, select the 'New Landscape' tool and input these settings and hit 'Create.' 


    You've now got a 2.158km landscape, which is based on a 2160 pixel heightmap. (Remember that resolution; you'll need it later). Your FirstPerson character can run around that floor and figure out where everything is going to sit and how big it needs to be. At this point I like to add a very simple preliminary material, but it's not necessary.


    Adding Reference Geometry.

    Before sculpting into the landscape I'll create some really basic geometry to take the place of the major objects that are going to be in the finished scene, so just with boxes and cylinders I'll create some compositions and group them (select them and hit 'ctrl+g') so I can move them around more easily.
    I've found that at this stage it's less import to worry about getting all the geometry to line up exactly to the reference art than it is for me to get the feel of the space I'm trying to recreate. So I jump in and out of Play mode frequently, and I'll keep running backwards and forwards between the pieces of geometry to make sure it feels about the right scale from way back and right up close and to make sure they feel like they're separated by about the right amount of space. In my experience I've found that, to make things feel like the scale they should be in-game, they need to be way bigger than they would be in reality, this is why creating things to accurate scale from the start doesn't always work. It should go without saying but, I'm looking closely at the reference art all the time I'm doing this.
     

    Once I've got the scale and the spacial relationship between the primitives about right on the flat ground, I'll need to raise them along with the Player character way up in the air; the concept shows these objects are sitting at the top of a slope. I'll raise them to about how high I want them to be above the lowest point in the scene (where the landscape is currently sitting), and then I'll sculpt the landscape up to meet the geometry.


    Sculpting basic forms into the Landscape.

    Now I'm finally ready to start sculpting in references for the major features that will appear in my final landscape. Using a tablet at this stage really helps.
    Go over to the 'Landscape' tab in your modes panel again, and chose the Sculpt tool. Sculpting is pretty straightforward, I just use the sculpt brush, the smooth brush, and the flatten brush (useful for removing mistakes as well as creating plateaus). The noise brush is useful for creating jagged mountainous shapes.
    To add some more subtle noise to the landscape I sometimes quickly go over the major features with the erode brush when I'm almost finished. It helps the erosion processing nodes in World Machine to work better if they have a slightly noisy input to work with. 

    While sculpting I'll keep jumping in and out of game mode while looking at the reference, as well as keeping one eye on the FirstPerson camera preview.
    All I'm doing at this stage is creating shapes on the landscape at about the size, shape and position that I feel looks right; this is just intended as a guide to help me with placing landscape features when I get into World Machine. It will look completely different after it's been passed through World Machine a few times.



    Exporting the Landscape and working into it with World Machine.

    Now I'm ready to send this blockout landscape over to World Machine as a heightmap and begin using it there to create a much more sophisticated environment. Export the file by again going to the Landscape tab in your Modes panel, into the 'Sculpt' sub-panel and at the bottom, right-clicking the 'Heightmap' layer at the bottom, and choosing 'Export to file'. Exporting as either a .png file or a .r16 file will work in World Machine, but keep in mind that .png files can be opened and edited in just about anything, Raw16 (and Raw32) files are way less versatile. 


    Over in World Machine - keep the world set up at the default scale; 8km square, otherwise it will interpret the vertical scale of our map completely incorrectly. Also, it's going to be easier to fit giant landscape features into our 8km heightmap than if we set our canvas to 2km. 
    Getting our resolution set correctly at the start is important - it's got to be exactly the same size as the heightmap that was sent out of UE4 - 2160 pixels square. After that create a file input node, locate the heightmap you exported from UE4 and load it in with default settings.




    There are now two ways you can go about using this map in World Machine. If you want to experiment, you could combine both these methods;

    1. Use the blockout landscape map in your File Input node as a mask. Use it to mask out, for example, an Advanced Perlin Node - then run that perlin node through the rest of the World Machine process as normal. Or...
    2. Run the File Input node itself through filters and erosion nodes, and blend it with other generators in World Machine. So you'd almost be using it like a Layout Generator node. 

    As I've mentioned I have the GeoGlyph 2.0 set of extensions for World Machine from QuadSpinner, which are pretty invaluable. (Tip: I got it in a Black Friday sale last year from QuadSpinner, and I'd guess they're going to have another one soon...) 
    I've also over the last year bought and tried the pre-release versions of QuadSpinner's new tool; 'Gaea', as well as 'World-Creator' from ByteTheBytes. Neither of which, if I'm being honest, have given me a great experience so far, so I'll probably stick with WM+GG for a while, till those other tools are a bit more featured and/or stable.
    Going into processing and creating an entire landscape is probably a bit beyond the scope of what I can get through in this breakdown I'm afraid, but simply put I tend to just use the various GeoGlyph erosion tools, the 'Peak' generator node to create mountains, Layout generators to create masks over the parts of the landscape that I don't want changed too much, and then I blend them together, generally using 'Add' or 'Max' as the blend method. Clamps are also very useful to stop the floor and ceiling of your landscape features from getting blown out. I can answer any specific questions people may have about the World Machine process and I may refer back to it when talking about the landscape material (in fact, I definitely will).

    But.... after all my processing is done in WM, it's time to export back to UE4 and have a look at it in game. So, at the very end of your WM signal chain, place a 'Height Output' node, and set it to send a PNG or R16, which you reimport to UE4 the same way you exported it.


    Upsampling the landscape to 4k for the final version.

    Once I'm done getting my landscape to look how I want in WM, I'll want a slightly sharper version to finish. First I'll upsample the current 2k landscape in UE4, so it's ready to accept the higher resolution file from WM. Go into the 'Manage' subtab in your Landscape mode panel, and select the 'Change Component Size' tool. Input the following settings and hit 'apply'. It'll take a moment or two to upscale the landscape. Make a note of that overall resolution - 4336, you'll need that again in WM....

    Back in WM, go back into your World Extents and Resolution, and set resolution to 4336. Rebuild the signal chain (which you'll notice takes a lot longer, obviously), output the file, and simply reimport in UE4 as before - you should notice a huge improvement in appearance.


    OK! That's it for the Landscape part. I'll try to answer any questions when I can, but I'll be back tomorrow with a breakdown on the Landscape material.

    Cheers, 
    B.
  • B_P_L
    Offline / Send Message
    B_P_L greentooth

    Layered Landscape Material Setup Part 1/2




    Hi again. I'm now going to try and give a breakdown of the layered material used on the landscape. I'm going to have to do it in two halves otherwise this one post will end up being too big.

    As I mentioned on my Artstation page for this artwork, I originally went a little overboard with the landscape material and added quite a few things that maybe didn't get used all that much or that could've been implemented in a more streamlined way. So, I've recreated the material from the ground up prior to doing this breakdown and it's now a great deal more simplified and hopefully a lot more easy to understand.

    Material Breakdown part one:

    1. Overview of the Master material.
    2. Textures used in the Layers.
    3. Creating and using Material Functions.
    4. The sand material function.

    Material Breakdown part two:
    1. The other 3 displacement rock material functions (as seen above, painted into the sand).
    2.  Custom Functions (DistanceFade, DisplaceFade and TesselationFade).
    3. Getting World Machine maps, setting up LandscapLayerBlend and painting.


    Overview of the Master Landscape Material.

    When you open the master landscape material, this is what you see:

    ...which probably doesn't look too complicated, but there's a lot more going on than can be seen at this level.

    1. LandscapeLayerCoords node. This maps everything onto our landscape. This needs to be set to the same size as the landscape Heightmap:

    2. Material Functions. This is where the majority of the work of setting up a landscape material goes. These are - in effect - four individual, complex materials; represented here as these four little nodes.
    3. LandscapeLayerBlend node. This gathers together all our separate MaterialFunction layers and allows us to paint with them on the landscape.
    4. BreakMaterialAttributes node. Splits apart the results of whatever is going into it into individual material slots, so we can blend other things with them, in this case the World Machine maps...
    5. World Machine maps. Colour, AO and normal overlays generated in WM. These sit on top of everything else and they're added right at the end.
    6. Distance Fade material function. This allows the World Machine maps to only be seen from way off in the distance, away from the player.
    7. Material node. Almost everything about this part is left at default, except we need to enable displacement. These are the only settings you need to change:


    Textures used in Material Functions / Landscape Layers.

    The textures used in the material functions were generated in Quixel Mixer from Megascans assets, and they're all 4k. Obviously, that wouldn't be a realistic use of texture memory in a real world scenario (at least not right now), but my goal for this project was more in line with the objectives of a Look Development process rather than to create something like a shipping product.

    Each of the four functions have 3 individual textures; albedo/colour; normal; and a pack-map containing; (R) Cavity, (G) Displacement/Height and (B) Roughness (labelled as 'CDR' maps).
    The sand material function has an extra normal map and an extra pack-map which are blended in on sloped areas of the terrain with a WorldAlignedBlend node to make the sand appear less even or smooth in steep sloped areas. 

    Creating and Using Material Functions.

    When creating more complex materials, a graph can become pretty confusing quite quickly and trying to navigate it becomes tedious. You're also probably just going to be using the same parts of the graph over and over again. 
    Material Functions allow you to save entire material graphs, or just little parts of graphs, into a single node with a couple of inputs and outputs. Once they're set up, you can then just drag and drop these into a regular Material graph as you need them.
    After adding a MakeMaterialAttributes node and attaching it to the Output Result node, the rest is pretty much the same as building a regular material graph.

    The Sand Layer


    Above: results from Sand material function, which uses slope and distance blending functions.

    Three of the four material functions that make up the layers in the landscape material are material are all identical to each other. The Sand material function, however, is a bit more complex because it covers the entire world until I manually paint over it with another layer, so I need it to do a few more things.
    You can download a version of this graph with or without annotations from my Google drive.


    That's it for this half of the Landscape material breakdown. The other material functions, landscape layers and the master material will be covered in the next post.  

    Cheers,
    B.
  • 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.


    Links

    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.

    model

    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.

    Regards,
    B.



  • 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.

  • B_P_L
    Offline / Send Message
    B_P_L greentooth

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

    In this last half of the materials breakdown, I'll cover the blending functions, the tri-planar mapping functions and finalise the master blend material.


    Blending Functions

    DFblend

    This is actually a kind of two-for-one function; as well as generating the main DF blend mask (Output Result), it also takes the blend material's normal map and corrects it for World Space. So remember that the normal map of the blended material should actually come from Output Sand Normal, rather than the original material attributes.
    The highlighted Input Slope Mask > Blend_Overlay > Clamp part of the function isn't totally essential - it just uses an output from the separate DirectionBlend function to add a little extra control over how high up the mesh the distance field is allowed to go. You could leave this part out if you want.

    DirectionBlend

    This function is really simple, it just adds a couple of parameters after the built-in WorldAlignedBlend to control the level of output. Output Slope is used by the DFblend function (See above).
    (Although those scalar parameters are labelled 'TopDown Blend'; if you set them to negative values they'll flip the direction of the blend).

    AOblend

    Another very simple function - takes the prop's baked AO map as an input and inverts it to use it as mask to bring sand into cracks and crevices etc.
    The highlighted section is optional - it takes the blue channel of the prop's baked normal map and subtracts those (flat) areas from the AO blend - useful if you just want the sand to only appear in corners and on edges. (Although this is meant to subtract sand from flat areas - if you set the AO Subtract parameter to a negative value it will add sand to those areas).

    DFedges

    This is kind of a weird one. I got this particular function here from Unreal Engines forum member, hallatore - so thanks to him for this one.
    As I understand it, the function works by dithering the parts of your mesh affected by the distance field. The idea is; when your mesh is sitting on a sandy surface - the very bottom of the mesh that makes contact with the sand will be dithered away, revealing only the sand underneath. When set correctly this should create the effect of one surface fading into another. 
    In the texture slot I've used a cavity map from my sand material, which appears to work - but apparently any noisy greyscale image/pattern will work.
    The highlighted texture tiling section is my own addition - it's not necessary for it work but it can alter the look of the dithering effect very slightly. 

    Tri Planar Mapping Function

    Ok, here's the very last function - this is by Hans Palm and you can read more about it in the Reddit thread where he originally posted it. So many thanks to Hans for this one.
    I used this to map tiling textures onto FWN meshes that had uneven UV mapping, or no mapping at all.
    If you want, you can use this function to map your blended materials - the sand in this case - onto a painted mesh that otherwise does have good UV mapping - just hook it up to the UVs of your Sand material function.
     


    Above is the original version. In mine, below, I just added some scalar parameters to allow for adjustable tiling etc.


    Final Master Blend Material settings

    And now, after you've built all those functions and put them all together where they're needed, you just have to throw it all into your master material and create material instances from it.



    As with the landscape material; the props were each assigned with unique material instances that were generated from a single master material, each material instance was then loaded with the relevant maps and had various parameters tweaked to suit each occasion.

    It's unlikely that just one material instance is going to suit every prop in every location around your scene. So, try creating material instances from material instances - spend time getting the first instance to look generally correct throughout the scene, after that you need only make minor adjustments to each child instance.

    OK! That's it from me in this thread - although I may come back at some point to shift some things around that are a bit untidy or out of place.
    Going over everything I made in the project for this breakdown has been really useful for me as it's helped me clarify and improve my own understanding of a lot of the things I learned while working on it. Also, it's all going to form the foundation of a blogpost I'll put up on my Artstation at some point. 
    Hopefully some artists who are just starting out are able to find something useful in here as well.

    Thanks again, 
    B.
  • alytlebird
    Offline / Send Message
    alytlebird interpolator
    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.

    Thanks,
    B.
  • RustySpannerz
    Offline / Send Message
    RustySpannerz polycounter lvl 13
    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. 

    B.
  • TangDao
    Offline / Send Message
    TangDao polycounter lvl 6
    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,
    B.
  • rogrobin
    Offline / Send Message
    rogrobin polycounter lvl 9
    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!

    Cheers!

  • B_P_L
    Offline / Send Message
    B_P_L greentooth
    @rogrobin

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