Thursday, May 5, 2016

Realistic Basketball Court - Finalising the Environment

Since the last post I've made a lot of progress and I'd say i'm nearing finishing now.

Firstly I returned to modelling to make some more assets. Now that I had a base environment with a lighting and atmosphere set up close to my concept, I needed to start populating the scene with props to make it look more convincing of the vandalised and grungy aesthetic I'm striving for.

I've made some low poly assets of objects that are commonly found in neglected urban environments.



All textured with 1 x 1024x1024

Again, everything accept the rubble mound was textured in Substance Painter. Being able to quickly paint details through the Normals layer is great for giving assets damage and surface details. Obviously the results would be a lot more refined if I was to bake highpoly models down or open the workflow to Zbrush, but for non hero assets like these the results are good from Substance.

The rubble I created by overlaying different images of junk and debris and then making a height map for them. In Unreal I'm utilising a curved plane and Parralax Occlusion Mapping to give the effect of there being varying heights and non uniform edges to the plane.

 I've now populated the level with the props, focusing on the less interesting areas first and the places
where rubbish would naturally collect.







 After populating the level with all of the smaller props I didn't realise that I had gone over the triangle count and I had to go back into 3ds Max to reduce the tris where possible. However this time there wasn't anything that could optimised further without comprimising the meshes shape, so I had to delete some of the back faces from the cage mesh that you wouldn't see from player height and I reevaluated the placement of props, only adding them were it benefited the composition.

With some gaps to fill in the overall aesthetic of the level, but running out of triangles, I decided to make some assets from Alphas. I created a tarpaulin sheet to break up the silhouette of the cage and enhance the variety of scale, as at the minute most of the detail is on the floor.

The neon sign behind is also just an alpha, but I've masked off the writing to allow the emissive light to only show on that. The neon sign material is set to inject the emissive value into the LightPropagationVolume and on the StaticMesh I've ticked 'Use Emissive for Static Lighting'. This combined with the tarpaulin being set to a Subsurface material gives the impression of the sheet being slightly transparent and the neon sign having light properties.


Another alpha I chose to make was some vines. I felt like the scene definitely needed some greenery, even though it is set 10 stories of the ground.



















This interior space felt a little dull before as there is nothing in it, however the vines have now added some visual interest and variance from the building on the other side of the court. Even though its the same visual style throughout I'm trying to make each space visually different in some way to allow for multiple points of interest. The vines in harmony with other materials and a coloured light give this space a slightly different mood to the other tones featured outside. 


With some planes I've made godrays for the windows. The material consists of just a smoke cloud alpha texture, the parameters being set to 'Translucent' and 'Unlit' and a calculation of the camera position to fade out the godray when you walk towards it. The effect works well in most cases but I've found that it's best to place it in an area where the player cant navigate around it to much as it can become skewed and break the illusion if looked at from a bad angle. I've seen a cylinder used for godrays before which works well as you cant see any edges, however for me a plane will do as I don't have the tri's. You can also add particle effect to the godray to get cool floating dust inside.



I've also added glass to the windows now, something I hadn't intended originally but it adds a lot to the visuals and only required a plane to make.















The PostProcessVolume is something I've been playing with also. I utilised the colour lookup table to tweak the levels and colour balance slightly, along with the other useful features in the settings such as, Global Illumination, AO and I've used the depth of field to help emphasize the fog by blurring the city lights.

Without PostProcess
With PostProcess
With everything becoming finalised, I'm about to do the final light bake then start to execute the final renders also. The only problem I'm having now is eradicating this shadow problem that appears on some of the glass panes, I'm not sure where it's coming from, it could potentially be light map issues but the other panes have the same spacing so I don't think it's that. The light bake settings I'm using are large and time consuming but are giving good results all over the level especially in the interior spaces, so i'm going to keep using them.

Sunday, May 1, 2016

Realistic Basketball Court - Lighting

After making separate UV channels for lightmaps, i'm now starting to create the atmosphere and mood i'm looking for.

I began using the standard UE4 set up with a directional light to act as the sun, but tweaking the environment and skybox parameters myself to try and get the time of day, as seen in the image below.




After referring back to my original images for the lighting and mood I've decided not to use the directional light source as it essentially carpet bombs the scene with light and I need more control over it. Subsequently I've changed to using a combination of spotlights (for emphasis of directional highlights) and pointlights for ambient glows, as this got me closer to the effect i'm striving for. Using multiple light sources is expensive to run, also multiplying light baking times and causing problems when they're overlapping, however the results are a lot nicer and allow for more freedom with aesthetic interests such as cool and warm tones and creating focal points.





















The sky was difficult to get a good result with and I'm still not sure now if it really makes sense to have such a light sky for a night time scene. However I did try making the sky darker and it also didn't look right, making the level feel enclosed and didn't offer any contrast for the framework in front. I looked into how games like GTA portray their night time scenes and they're never pitch black but do seem to use a consistent amount of dark blues. Mine probably does need to be darker but i'm hoping it gives across the impression of light pollution from the city. I Think it's just a case of how else you portray that it's night with the surrounding environment, for example using glowing emissive lights, showing stars etc.

GTA V Screenshot
Additionally to the point and spot lights I'm using a skylight just to soften the shadows and give the slight glow to the reflective elements. I've added some simple surrounding buildings with emissive lights, the skylight s also helping here to give the impression that it's the glow of the city ambiently lighting the basketball court.
































I'm using Exponential Height Fog and Atmospheric Fog volumes to further to aesthetic of illuminated city smog.


As you can see below there is some light bleading happening on some of the interior walls, i'm hoping this is just because of the lightmap resolution and I can irradicate it by optimising the padding on my UV islands.

With some pointlights position outside the windows I'm trying to get the effect of the city lights casting through, creating focal points, I'm also intending to make some faint Godrays to emphasise this further.

 More on the lighting soon...



Friday, April 29, 2016

Realistic Basketball Court - Materials in UE4

I've just finished texturing my architectural assets in Substance Painter. One thing I've noticed when importing my textures into Unreal Engine is the impact the Image Based Lighting Substance uses has on the aesthetic of the materials, metallic materials are especially more visually pleasing in Substance than in UE4.

The material properties look more crisp and constrasting in Substance. The Version in UE4 below is lit with a Directional light and a Skylight to try and emphasis the highlights. This is also with my combined Roughness and Metalness texture with unchecked sRGB in the parameters, as I know this can have an undesired effect on the glossy aesthetic.


It's my understanding that you can replicate the effect Substance has with a HDR in UE4 but it is only useful for reflections not so much the lighting.

To fix the low resolution brick problem from my last post I've made a tiling brick texture. However As I had put the effort in to making the plaster effect and overlaying graffiti and dirt onto the exiting bricks I decided to try a different method. I've utilised the Diffuse information that was overlayed on the old bricks in Substance and blended my new tiling texture underneath. Meaning I can keep the same unique crumbling plaster details and still have a higher res brick where its exposed.



To do this meant a little bit of extra work in the material shader with blending multiple textures and creating a mask where the new brick should be exposed. Also to make the tiling brick texture I had to reduce another textures resolution, which led me to try and optimize the metal shader of the cage.




The cage is now using a 1024 texture instead of the 2048 it was displayed with above, however i've used techniques such as Bump offset Mapping to retain some of the normal emphasis and overlayed a greyscale macro texture of surface details to get a similar results in the Diffuse and Roughness. The shader now gives the cage a much more battered look, with more contrasting detail highlights.

Exploring these different nodes in the shader graph led me get more adventurous with alternate techniques for improving shaders and the material realism outcomes.

This mesh Alpha uses the Bump Offset node for the illusion of being thicker than it is.

My plastered wall material now looks a lot more realistic thanks to Pixel Depth Offset, blending multiple Angle Corrected Normals.










I went back into Substance after integrating the textures into PBR shaders to change some things that I felt could look more visually interesting now I've seen them in a new light. One area i felt was lacking was the plaster, despite the graffiti and dirt it still lacked the grungy believability.

I didn't have any reference of the interior spaces from the basketball court I'm basing the environment off, but I had been following the generic principles of an abandoned building... messy and destroyed. After looking at some more research of abandoned buildings I realised that in a lot of publicly used facilities plaster is normally painted bright colours. So I added some paint to break up the large plain of white plaster, along with a painted vent detail and more green mold. This rework surpisingly made a massive difference.



I've also learnt about adding parameters to shaders to be able to tweak them in realtime, which is frankly awesome and a lot more convenient for making aesthetic choices for material properties, so now most of my textures have a set of nodes for controlling customised parameters such as macro detail amount or Normal intensity multipliers.




 Having control over the aesthetics through more complex material shaders is very useful but also
expensive. Detail enhancing nodes such as POM are great for giving the impression of surface detail on an otherwise flat mesh, without having to add geometry. However if nodes like these are used excessively throughout your shaders it can be expensive to calculate and frame rate will take a hit.

The scene is looking as I had hoped so far, with the derelict feel coming across through meshes and materials. I'll need to work on the atmosphere next and start to create and build lighting effects.

























































One issue i've since had is with the mesh material below, because the mesh alpha is tiled a lot to get the right density, when the player is far away the mesh becomes a solid material occluding all the background. This I discovered is due to the Mipmap levels, they were previously set to 'FromTextureGroup' I've now set them to 'NoMipMaps', which in these close quarters is fine because the texture doesn't really need to be downscaled for optimization purposes. This fixes the issue a little but I don't think it can be solved fully as it's just the density that's the issue.

Tuesday, April 26, 2016

Realistic Basketball Court - Texturing, Using Substance Painter


With completing the architecture of the basketball court I've decided to start texturing the assets I have and begin to build my scene in Unreal Engine. I know I'm most likely going to be modelling smaller prop assets later but I couldn't wait to start using Allegorithmic's - Substance Painter to see what the program is capable of and to hopefully work out what works and what doesn't with the models I already have.
My intention is to texture the whole environment using Substance Painter as it houses very useful tools such as being able to create dirt masks or quickly blend different material types, and all ready for PBR export. The program is new to me but it has been very intuitive to pick up and use. There are still some features such as the blending layers and adding generators to masks that seem to be temperamental in using, but overall I'm finding it very efficient for texturing and being able to paint unique textures straight onto the mesh is a method I wish I had implemented into my pipeline in previous years.

One of the benefits of being able to paint straight onto the mesh is how quickly you can fake details. In the image below I've managed to quickly give the impression of bolts in the supports by simply painting height information into the separate channels available. Also, painting straight onto the mesh allows you to see directly how details like damage are working with the mesh and the lighting, for example the subtle scratches on the edges would have taken some back and forth between Photoshop and 3dsMax to achieve, however I was able to replicate it in seconds with Substance, and UV seems are no longer an issue either with being able to paint over them.

Substance Painter has the ability to generate all kinds of useful maps which are used to calculate things such as dirt buildup overlays. However the results weren't always that good, with issues such as light bleeding from edges being a problem, so I decided to bake my own AO maps in 3dsMax to use in the program.

To begin texturing each asset I had planned the texture sheets and grouped the meshes accordingly, having a separate file for each group and working on one sheet at a time, I.e 'Metal' assets or 'Brick and Stone' assets, allowing for a clear layer tree with shared overlays for universal material properties.



One great thing about Substance Painter is that you can scale up or down the texture size at any point without loss, so I was working mostly with 4k materials to help see painted details and then scaling them down on export. Also For efficiency I combined the grey scale textures sheets where possible into the different channels.

One problem that arose later down the line in my plan of texturing the whole environment with Substance was; that whilst the scope for texture variation for each material was fantastic for creating the look of unique grunge and interesting areas of damage, the resolution of the textures were poor. For example in the images below, the brick featured underneath the plaster wasn't so noticeably low resolution in Unreal Engine, however because the UV's were confined to the 2048x2048 I allowed for this particular mesh the brick outside was the same pixel density and looked very noticeably low res with there being so much of it on display.


In an attempt to get some higher resolution bricks I rearranged how I've divided my texture budget up and allowed for one texture sheet of just the bricks walls.


However, as you can see it didn't do much good. It's obvious that i'm going to have to create a tiling brick texture for this. The reason I didn't take this route to begin with was that I thought I might be able to save myself some time, instead of needing to make decals to break up the large plains of bricks, I used Substance to paint graffiti and dirt over the mesh, with the wider intention of making the whole environment look unique and non uniform.

I realise now that I've been neglecting the traditional methods of texturing that I know work just fine, such as using tiling textures where possible. Substance Painter is fun to use but should only be used for texturing unique assets, not an entire building.