Sunday 13 March 2016

Comparing albedo map creation techneques

In this post I am going to be looking at some different methods of producing albedo maps from a photograph for use in a PBR material system. For these tests I will initially be comparing the possible techniques such as using Photoshop to manually create the map, as well as semi-automatic creation though using software such as ShaderMap. To actually get a good idea of what results are possible I am going to be looking at a variety of materials types.

Test 1: Wood



Results

Using the manual method kept more of the dark information such as the cracks. This could probably be made better with a little more work to balance levels, however this may be a desired look for the material type.

The ShaderMap results have more colour variation as the dark areas are better filled with colour information which better fits the definition of an albedo map.



Conclusion

Close up the difference in dark areas can be seen, but at a further distances the difference is barely noticeable. Other than the dark notch detail which looks washed out in the ShaderMap version, the maps look very similar to each other but for the use of this texture I do prefer the results of the manual process.

Future tests

  • Brick
  • Fabric
  • Ground

Sunday 14 February 2016

Unreal Engine 4 environment creation

Landscape and terrain

Setup

Unreal Engine 4 environment creation playlist - https://www.youtube.com/playlist?list=PLPTQEHtBC4vkIXU8QpfMCtepPJOp19VOe


Landscape painting

Creating Landscape Materials - https://docs.unrealengine.com/latest/INT/Engine/Landscape/QuickStart/4/index.html

RATSGAME UE4 Landscape Materials playlist - https://www.youtube.com/playlist?list=PL2G_ecHWhZBmEQih1qfe4yIzY49tKxST6


Terrain creation (advanced version of landscape)

Rather than using Unreal Engine's landscape system it is possible to create a terrain which can be thought of as a large geometry mesh which can have materials applied almost like any other mesh. This mesh can be divided up to allow using of techniques such as LOD. World Machine (http://www.world-machine.com/) is a great tool for creating/generating terrain that can be imported into UE4.

Weight maps can be used to control how materials are applied to the terrain. They are quite low resolution, but in combination of using height maps the materials can be blended together more naturally.

GDC 2015: Creating the Open World Kite Real-Time Demo in Unreal Engine 4 - https://www.youtube.com/watch?v=clakekAHQx0


Lighting and Shadows (WIP)

Lightmass Global Illumination
https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/index.html

Ray Traced Distance Field Soft Shadows
https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/RayTracedDistanceFieldShadowing/index.html

Distance Field Ambient Occlusion
https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/DistanceFieldAmbientOcclusion/index.html

Unreal Engine 4 Twitch Broadcast - Soft Shadows & Subsurface Scattering - https://www.youtube.com/watch?v=DQt_OopZadI

Places to look for important settings/features

Lightmass Settings in World Settings
Static Lighting Level Scale - lower value = more contrast/deeper shading

SkyLight
  • Light and Distance Field Ambient Occlusion tabs
  • sky distance threshold to 1
  • uncheck the low hemisphere is black (to get some fake "bounce light" from the ground)

Foliage (WIP)

Overview

When creating foliage it needs to be thought of and split into 2 sets:
  1. Foliage - normally larger objects like tress and rocks that have collision which are manual or procedural placed
  2. Grass/Vegetation - smaller objects like grass, flowers and pebbles that have no collision and placed through material placement
Setup and Creation

My recommend tool is Speedtree for UE4 (http://www.speedtree.com/ue4/) allows semi-automatic generation of foliage such as tress and bushes, but manual creation for grass by simply applying textures to polygon planes.

Creating Models For UE4 (SpeedTree) - http://docs.speedtree.com/doku.php?id=creating_models_for_ue4

Unreal Engine 4 foliage creation playlist - https://www.youtube.com/playlist?list=PLPTQEHtBC4vlTDRf_YPQNThOHa_EeU2BC

Advanced features

To get the best results on foliage I enable Distance Field Ambient Occlusion and update the following settings on the mesh's Build Settings (hidden drop down under each LOD in the asset viewer):
  • Enable Generate Distance Field as if Two Sided
  • Increase Distance Field Resolution Scale to improve AO quality

The slider on the left shows the difference when Generate Distance Field as if Two Sided option is toggled and the left slider shows the difference when Distance Field Resolution Scale is increased which brings back some of the depth lost when enabling the two sided option. I found that values above 5 did not really increase visual quality, but did massively increase the time taken to generate the distance fields.

NOTE: you must enable the option for instanced foliage if you want to paint foliage or use the procedural foliage spawner system. This can be found in the Modes window under the Foliage tab, after selecting a foliage type, scroll down to the Instance Settings rollout and check the option for Affect Distance Field Lighting. This does need to be done for each foliage type which will use DFAO.

Examples

UE4 - Forest - https://www.youtube.com/watch?v=3loi-2Bx72A

UE4 SpeedTree Forest - https://www.youtube.com/watch?v=dsniFiDS1lk

UE4 - SpeedTree - DFAO/GI test - https://www.youtube.com/watch?v=slc--V2pi5c

UE4 SpeedTree dynamic day cycle - https://www.youtube.com/watch?v=AphIofwFnUU

[FREE] Foliage Starter Kit - https://forums.unrealengine.com/showthread.php?59812-Free-Foliage-Starter-Kit


Creating roads, paths, fences etc

Landscape Splines - https://docs.unrealengine.com/latest/INT/Engine/Landscape/Editing/Splines/index.html

DokipenTechTutorials Unreal Engine Spline Road Tool Tutorial playlist - https://www.youtube.com/playlist?list=PLHadbgEqCTxDgj-RwPQGkaUypb05NJYN6


Water

Water Surface Overview in UE4 - https://wiki.unrealengine.com/Videos/Player?series=PLZlv_N0_O1gYq4tiS45UAgghUxoF916rH

Gaming and Engine Tutorials Water Tutorials Unreal engine 4 playlist - https://www.youtube.com/playlist?list=PLd2rY36Ym3b8Iqc8Ji7indM4oaLv_l2UT


Level building

Building the Glass Walls (v4.7) - https://wiki.unrealengine.com/Videos/Player?series=PLZlv_N0_O1gak1_FoAJVrEGiLIploeF3F&video=xzGWuW_iWPM

Examples

Creating a quick Unreal Engine 4 desert scene - https://www.youtube.com/watch?v=MlgvfEicdwU

Creating a quick Unreal Engine 4 Night/Lake Scene - https://www.youtube.com/watch?v=FRxnKYy62KE

Creating a quick Unreal Engine 4 Valley Scene - https://www.youtube.com/watch?v=GgwtME_WhXI


Other tips

Adding Atmospheric fog to enable light shafts - https://docs.unrealengine.com/latest/INT/Engine/Actors/FogEffects/AtmosphericFog/index.html


Good examples of environments and levels developed in UE4

Breaking Bad Cabin Environment [UE4] - https://vimeo.com/101387734

Unreal Engine 4 - Ghosts'N Goblins - https://www.youtube.com/watch?v=grJZEVRx2vY

UE4 - Trailed - Walkthrough - StudentProject - NAD - https://www.youtube.com/watch?v=iEkl-h3e6Us

P.T. recreated on Unreal Engine 4 - https://www.youtube.com/watch?v=UKiy2Pwp8Ek

UE4 - Snow 2 by koooolalala - https://www.youtube.com/watch?v=E-FpKzD9_uM

UE4 - Forest by koooolalala - https://www.youtube.com/watch?v=3loi-2Bx72A

Understanding and adapting to a Physically Based Rendering (PBR) workflow

So Physically Based Rendering (PBR) is here in a big way with Unreal Engine 4, Unity 5, Quixel Suite 2 and Marmoset Toolbag 2 but a few to name that now use this workflow as standard. It's quite a lot to take in, but not too hard to understand once you get going with it. Rather than try to explain what the differences are and what you need to do to adapt, I think it's more useful to just list the materials I found while learning this new workflow, as there's others out there that have already done that job.



Reading material

Physically Based Rendering Encyclopedia - https://docs.google.com/document/d/1Fb9_KgCo0noxROKN4iT8ntTbx913e-t4Wc2nMRWPzNk/edit

The above link covers most of the other materials I have read and listed below but it's also worth reading the rest as it may cover different tools and techniques in your own workflow.

Physically Based Rendering in Substance - https://www.youtube.com/watch?v=LP7HgIMv4Qo

Allegorithmic PBR Guide Playlist - https://www.youtube.com/watch?v=mnJ8NjLRmLk&list=PLB0wXHrWAmCwwpWr5aZ1lf0wY3IcWJAjE

Texture Maps Explained - PBR Workflow - https://www.youtube.com/watch?v=PjGCtnEDDeU

Physically Based Texturing - https://www.youtube.com/watch?v=Tt30zzBQb3w

Tutorial: Physically Based Rendering, And You Can Too! - http://www.marmoset.co/toolbag/learn/pbr-practice

Basic Theory of Physically-Based Rendering - https://www.marmoset.co/toolbag/learn/pbr-theory

Tutorial: PBR Texture Conversion - http://www.marmoset.co/toolbag/learn/pbr-conversion

Allegorithmic - The Comprehensive PBR Guide - https://www.allegorithmic.com/pbr-guide

Physically Based Materials (Unreal Engine 4 documentation) - https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/index.html

PBR Texturing Techniques - http://quixel.se/dev/issue03



Textures

gametextures.com
Offers a library of ready to use maps for use in a PBR workflow. Although not free, at the time of writing they do offer a 14 day free trial which includes 75 or 200 material downloads which is very generous and helps you get started with this new workflow and for $19 and $30 per month after that it seems like a fair deal.


Tools
Allows you to take a set of maps from alternative workflows and convert for use in PBR. This is not just a plug everything in and hit convert process though. You will need to provide the required inputs to get good results and spend some time tweaking.

gametextures.com drag and drop Substance system - https://www.gametextures.com/how-to-import-gametextures-substances-into-ue4-and-unity-5/
The website now offers downloads of substances which can be quickly imported into Unreal Engine and Unity via drag and drop.

Need to create extra texture maps?
If you have a normal map then NDo has a built in feature to take a normal map and output a variety of different maps including AO, height, specular and cavity - http://quixel.se/usermanual/quixelsuite/doku.php?id=convertmenu

For the workflow converter you will also need a gloss map. These are easy enough to produce and this video shows the basic procedure - How to create a gloss map from a diffuse map https://www.youtube.com/watch?v=OKdUIm3i_jc


Workflow Tips

Albedo map creation

Manual process using Photoshop

How to Make an Albedo Texture from a Diffuse Texture - https://www.youtube.com/watch?v=KKQZN3eoKUo

Process steps:
  1. open diffuse map
  2. create a duplicate layer of the diffuse map. ensure the new layer is above the original
  3. fully desaturate (CTRL + U or add an adjustment layer) the duplicated layer to create a cavity map
  4. invert (CTRL + I) the duplicated layer, so that dark areas now show as light
  5. change blending mode of the duplicated layer to Soft Light
  6. make any changes to saturation etc of original map (if required)
  7. using the luminosity values chart below select the value most appropriate to the type of material
  8. open the histogram and ensure the expanded view is selected by clicking the arrow and four lines in the top right of the window and set Channel to Luminosity in the drop down
  9. take note of the median value
  10. adjust the levels (CTRL + L or add an adjustment layer) of the original map (or the overall new texture) so that the median level comes close to the luminosity value from the chart
Semi-automated process using ShaderMap

Creating an Albedo Map from a Photographic Texture - http://shadermaptutorials.com/tutorial/creating-an-albedo-map-from-a-photographic-texture/

Luminosity value guidelines
Material            Linear value  sRGB value  photoshop    source          
                                              median value
Brushed Metal       0.02          0.16                     [2]
Charcoal            0.04          0.22                     [1]
Fresh asphalt       0.04          0.22                     [1]
Rubber              0.04          0.23                     [2]
Black acrylic paint 0.05          0.25                     [3]
Coal                0.05          0.25                     [2]
Leaves              0.05          0.26                     [2]
Rust                0.06          0.27                     [2]
Plastic (glossy)    0.10          0.36                     [2]
Painted metal       0.12          0.38                     [2]
Rough steel         0.13          0.40                     [2]
Worn asphalt        0.12          0.38                     [1]
                    0.15          0.42                     [3]
African tanned skin 0.15          0.42                     [3]
Bare soil           0.17          0.44        112          [1]
Dirt                0.17          0.45        115          [2]
Plastic (rough)     0.19          0.48                     [2]
Brick/Concrete      0.23          0.51                     [2]
Dry clay soil       0.23          0.51                     [3]
Mud                 0.23          0.52                     [2]
Green grass         0.25          0.53                     [1][3]
Plaster             0.25          0.54                     [2]
Canvas              0.27          0.56                     [2]
Old concrete        0.30          0.57                     [3]
Wood                0.31          0.59                     [2]
Red clay tile       0.33          0.60                     [3]
Rock                0.33          0.61                     [2]
Desert sand         0.40          0.65                     [1][3]
Satin               0.43          0.69                     [2]
New concrete        0.50          0.72                     [3]
New concrete        0.55          0.76                     [1]
Clean cement        0.55          0.76                     [3]
Ceramic             0.57          0.78                     [2]
Ocean Ice           0.50–0.70     0.73-0.85                [1]
White cement        0.70          0.85                     [3]
White acrylic paint 0.80          0.90                     [3]
Fresh snow          0.80–0.90     0.90-0.95                [1][3]
Notes:
some values converted using https://docs.google.com/spreadsheets/d/1KcHvNFqQA8Y7xyjMTuuQgMTT3bB6lvNpTgpsU1MmDjs/edit#gid=0

Sources:
[1] https://seblagarde.wordpress.com/2011/08/17/feeding-a-physical-based-lighting-mode/
[2] http://www.marmoset.co/toolbag/learn/pbr-practice
[3] https://www.fxguide.com/featured/game-environments-parta-remember-me-rendering/

Tuesday 1 December 2015

Project update 1: Ken Block's Ford Fiesta RX43

It just so happens it's one month on since my last post on this project, and I've made some good progress in that time. Most of the high poly modelling is now complete with only a few small objects still to add.





A shot of the interior

A shot of the rear showing the work I've done on the radiator and fans in the boot which will be visible through the mesh of the boot lid.

While working on all of the high poly modelling, I was feeling the need for a break at one point, so I decided to texture the wheels and rims. The model for both is optimised where the rim has been smoothed and optimised by removing some of the geometry added.



For the tyre, most of the detail in in the normal map. To make the normal map for the tread, I modelled a section based on a photo, made copies to surround the edges and baked this section to a flat plane. Then in photoshop this section was duplicated to cover each section going around the wheel to save texture space i.e. only 1/8th of the wheel is actually textured and the UVs for the other 7/8th of the wheel is overlapped. For the side wall, I used a black and white image of the side wall detail and converted to a normal map using NDO from the Quixel Suite. Looking forward to getting to try out the new Suite 2.0!


Sunday 1 November 2015

Project restart: Ken Block's Ford Fiesta RX43

This is a project I started about a year ago, and never finished. I've come back to it in the last week or so and took the decision to start over. Even though I made some good progress previously the topology of the model I had was looking a little messy and I was finding it hard to work with.


This is my current progress on the new version which I am already much happier with. The mess flows much better and feels more optimized. So far I have blocked out and worked in all the major details and now working towards some finer details.



Saturday 18 July 2015

music mini reviews (Mar-Jun 2015)


Adrenaline Rush - Adrenaline RushCheck it out

Stand out track (I think): When We're Gone

The vocal style is going to be a Marmite 'love it or hate it' thing for most I feel, but the music content behind, which feels like a mix of 80's Glam Rock with 00's Pop, is actually quite enjoyable even if it does have a bit of a overly engineered feeling to it.

American Hi-Fi - Blood & LemonadeCheck it out

Stand out tracks: Coma, Killing Time, Armageddon Days, Wake Up

This is an awesome rock album with a range mixing between slower and heavy songs with lots of fun melodies and a pace that keeps the album flowing between the songs. There's reminders of some of the first rock and metal albums that got me into this type of music, so this was a really enjoyable listen and it's been a go to for the past few cars rides with the windows down while the weather's good.

36 Crazyfists - Time and TraumaCheck it out

Stand out tracks: Time And Trauma, Also I Am, Slivers, Swing The Noose

It's nice to see that the band have still plenty of material to put together a quite lengthy album with call backs to the older sound mixed with some new vibes. There are plenty of good songs across the record, but there is a lack a complete stand out songs like "Felt Through a Phone Line" on Rest Inside the Flames which hold it back from immediate classic status that early Crazyfists material holds for me.

Bury Tomorrow - RunesCheck it out

Stand out tracks: Man On Fire, Year Of The Harvest, Garden Of Thorns, Of Glory

With guitar work and a general feel which sounds like early Atreyu during most songs, this is the first Bury Tomorrow record I've heard and it's a bit of a mixed bag. When I saw them at Slam Dunk Festival I overheard somebody say at the end of the band's set "only that final song sounded any different". That song was "Man On Fire" and I kinf of see what he was getting at. There is some great musical content in the album, but there is quite a similar sound to most of it and given the album is quite long, it can feel like the same song in a row a few times.

Beartooth - DisgustingCheck it out

Stand out tracks: Relapsing, I Have A Problem, One More, Me In My Own Head, Beaten In Lips, Body Bag Keep Your American Dream

"The Lines" opens and sets the volume to loud and fast for the rest of the album. The vocal range allows for moments of quite, but can flip back instantly back to loud and brash along with strong lyrical content which drives the music behind it. There's touches of The Used throughout and Punk Rock vibes which come through in the bass playing which sounds like Rise Against riffs as well as some Thrash Metal and plenty of head banging moments throughout. This is an outstanding debut album and offers a lot which should appeal to a wide audience so I think this is a band to look out for in the future.

Cancer Bats - Searching for ZeroCheck it out

Stand out tracks: True Zero, Arsenic In The Year Of The Snake, Devil's Blood, Cursed With A Conscience

When I first heard "Arsenic In The Year Of The Snake" ahead of the full album it made me wonder about the rest of the album, but I can now see it's place and it fits in perfectly. "Beelzebub" slows down the pace with a stoner rock vibe flowing through it after a few heavy hitters to open. It's taken a little while to warm to the album as a whole, but taking each song into consideration it's pretty much everything I want from one of my favourite bands and it doesn't fail to live up to expectations. The worst thing I could say is that the album is a little short, but given Cancer Bat's track record, there's likely to be an extended Special Edition in the near future.

Danny Baranowsky - Crypt Of The NecroDancerCheck it out

Stand out tracks: Cyrpteque (1-2), Fungal Funk (2-1), Igneous Rock (3-1 Hot), Dance of the Decotous (3-2 Cold), March of the Profane (3-2 Hot)

I have a strong feeling this is going to be my favourite game soundtrack this year and likely to feature high on my top 10 of the whole year. For anybody that knows any of Danny B's previous work you'll pick up on some characteristic trade marks dashed throughout with call backs to familiar Super Meat Boy OST moments. The regular instrumental songs are great, but when the shopkeeper kicks in the alternative version it it adds another layer of amazing and the irregular modulation applied constantly puts a smile on my face which is an odd thing I find for music to do outside of a Tenacious D album. Along with the original soundtrack, FamilyJules7x's Metal version of every song is equally as epic and alone would be an instant recommendation.

Enter Shikari - The MindsweepCheck it out

Stand out tracks: The Last Garrison, Myopia, The Bank Of England, Torn Apart

For me Enter Shikari have always been a go to for something a little different, and as I'm not totally opposed to certain genres like Dub Step as there is a level on enjoyment that can be found in the Electronic, Rock, Metal cross-over that is an Enter Shikari album. It's not going to be something for everybody, but it's a good go-to when you want to subject your ears to something a little different every now and again. In fact, the more I've listened to this album, the more I've wanted to go back over the few Enter Shikari albums I've skipped over in the last couple of years.

Funeral For A Friend - Chapter And VerseCheck it out

Stand out tracks: Pencil Pusher, You Should Be Ashamed Of Yourself, Stand By Me For The Millionth Time

There's been a bit of a gap in my listening to FFAF but Chapter And Verse seems like a direction shift back towards the times of "Hours" which is the classic FFAF era for me, and although it's not the same thing as Hours, I'm quite enjoying this one. We can't expect all our favourite old bands to put out the same type of music over and over because there woudl never be any progression so I'm quite happy to see the band experiment and explore.

Imagine Dragons - Smoke + MirrorsCheck it out

Stand out tracks: I'm So Sorry, Friction, Summer

After first hearing about Imagine Dragons when they preformed at The Game Awards at the end of last year I was interested to hear some more, but wasn't really impressed with what I heard from the previous release. However, I think there's something to Smoke + Mirrors. It does have that mass appeal feeling to it like a Coldplay album, but because of that it is a safe bet to put on in the car when the parents are around.

Upon A Burning Body - The World Is My Enemy NowCheck it out

Stand out tracks: Bring The Rain, The New Breed, Blood, Sweat and Tears, Middle Finger To The World

"The New Breed" is a modern Pantera influenced song with a hard hitting pace, starts out with a Country melody then burst into a head banging session and most of the album thereafter follows on from that. Along with "A Toda Meadrè Ò Un Desmadrè" it clear that there is some influences from local music. There's a killer solo in "I've Earned My Time", but just got pushed out of the stand out tracks by "Middle Finger To The World" because that is such a heavy beast. Hard hitting melodies and strong lyric mixture throughout gives the record a similar feel to a Five Finger Death Punch album.

While She Sleeps - Brainwashed (Deluxe Edition)Check it out

Stand out tracks: New World Torture, Brainwashed, Our Legacy, Four Walls, Life In Tension, Trophies of Violence

As with their debut album, Brainwashed continues with it's complexity in it's song writing, but the band have refined that even further and each song having a different feel to it. A majority of songs contain contenders for Solo Of The Year, but the best of those has to be at the end of "Our Legacy". The short interlude songs of the deluxe edition make it feel like the album is broken down into chapters, and when the next song kicks in it's straight back to to the head banging. Having seen the band live twice since starting this review and listening to the album on average about once per day since release, this has to be a strong contender for my favourite album this year.

Tuesday 10 March 2015

Unreal Engine 4 Tip: Setting viewport resolution

When you first get started with Unreal Engine 4 you'll want to get your layout defined so you can get used to where everything is and start to speed up your workflow. During this set up, one thing you may want to do is know the resolution of your main viewport, for example to capture screenshots, and you may only want to capture at a specific resolution. So how do you know what the current viewport size is?

After doing a little googling I was unable to find a way to show the current viewport resolution within the UE4 interface, but it is possible to capture what you can currently see in the viewport, at the resolution you are currently using through the shortcut key F9. You will see a popup detailing the location of where the screenshot was saved to, and clicking the location will automatically open it in Windows Explorer.



By looking at the details of the images you will be able to see the dimensions of the image captured. If it is not to the size you require then adjust the panels surrounding the viewport in UE4 and capture a new screenshot. Repeat this until the screenshot is captured at the resolution you require.



Once you have the layout you desire, it should now be saved for future, but to ensure that your layout is saved go to Window > Save Layout.