Friday, January 25, 2019

Week 14 

Big update!

So this update is quite large. So I'm going to give you a before and after from what it was in my previous post to now. This is so you have some relevance to go off on how much its changed and what has changed.



As you can see just from the front view dramatic changes have been made. Most importantly the temple in the background has finally been textured. Seeing as this is the biggest change I'll start with it.



The temple has been reduced from 85.5K triangles to 55K. This is a loss of almost 30K triangles nearly cutting it down by half. As you can see there is no real change in the geometry from the first temple to the second in the before and after picture. The reason the temple has been further cut down isn't because of performance but actually because the UV unwrapping of the first temple was abysmal. It was awful. So, to fix this, I had to actually remodel the entire temple apart from the walls. This took an approximate 3 hours to do simply because I had a temple to already go off. The way I molded the temple made it both efficient in time and UV unwrapping space. A big thanks to my tutor Ian for helping me. 

The texturing of the temple took a while to establish. The thought process behind how to texture it was messy. I went through many different ideas. I started originally by handpainting a seamless wood texture and then applying it to the UV map. Although this looked effective it didn't fit the style unless I hand painted all the textures. Given my time frame this wasn't an option. So then I opted to using substance painter materials. The material I have mainly been using for all my models is a wood texture that has variation of normal strength. This is good because not all wood would look the same. Although I believe all the structures would be made out of all the same wood as the trees were sourced from the same environment. 

There are still a couple of things that need changing with the temple. For example the specular reflection on the roof is too much. The colour of the walls doesn't match the colour scheme for the rest of the environment. The roof joints still need to be textured. They only have a simple green material on them that unreal supplied. 




I've stated previously that the normal maps appear weird when under post processing effects due to the cel-shader. However, in this picture I actually do not mind it to much. I think it adds to the style more. So I might not try and fix this visual interaction. 

The only problem I have with using substance painter is that I feel as if the textures aren't mine. Everything within this environment was sourced by me. Either I took the photographs or painted it. This for some reasons bugs me but I guess this can not be helped. 

I made some alpha maps in order to add to the Chinese aesthetic. In which I then just converted into a normal map within substance painter. 



Although the one on the left doesn't look too good at first glance when converted to a normal map it turns out fine.

Next on the list is the flags.

 The flags were a very long process. Not modelling wise but trying to get the animated within Unreal Engine. I first tried to add a cloth simulation to a model within max. Collapsing it and baking an animation. Then reversing the animation so it looped. It didn't look great but each flag on the model was uniquely animated and it looked close to how Tibetan flags fly in the wind. The problem with all this after spending a substantial amount of time on creating this was that I found out Unreal Engine doesn't support vertex animation... This was a huge waste of time. But I learnt something. So then I went on to plan B. Actually using blueprints to get an animation working. This didn't work so then I had to make a plan C. It turns out Unreal Engine has a great cloth simulation built into it. 

The engine requires a hierarchy of models for this to work. You need to link the flag as a separate object underneath the rope model. This is so when you import it as an FBX the flag is a bone of the rope. Then by painting the weights within the engine you can tell it where the flag attaches to the rope. Then by drop and dragging wind from the engine search bar it then automatically works. This was a very informative tangent I unwillingly went down and I'm glad I did. The reference video for where I learnt how to use this cloth simulation with in unreal is here - > Thankyou to this guy

                            https://www.youtube.com/watch?v=kjOq8OB_3AQ&t=317s

The only problem with this simulation is I'm yet how to work out how to get the wind to treat each individual flag differently because at the moment they all move near identical to each other. Changing the physical model of each flag does not change anything, nor does detaching them from one object. So the only Idea i can think of is through either scripting a wind radius as the wind radius within unreal engine doesn't seem to work too effectively. I think this is because the scale of my level is a lot larger than its Intended to be. 



Next I'll talk about the new gate model. 

So this model was more basic than it is now. This is due to the poly count on the temple decreasing, allowing me to update models that do not match the rest of the environment in its detail. The tiles are identical to the tiles on the temple to keep thematic consistency. I've textured the walls with the self made alpha maps. The normal maps on the circle entrance are very strong and need to be bought down. Apart from this I'm happy with the texturing on this wall and claiming it to be finished.



I've also changed the fences to be more wooden in nature rather than golden metallic. This is so it fits the environment to a greater degree. 

Because of how contrasting metallic maps looking within my environment I've used them sparingly to bring attention of not only your eyes but of your thoughts to sparingly make a reflection of a temple that is not great in wealth but proud aesthetically. 

Lastly I've added a foundation base to the temple. This is because the temple resting on solid ground looked unnatural to a real life Chinese temple. It also adds greater dynamic to the map layout so it's not boring walking around flat ground. 












Wednesday, January 9, 2019

Week 13

Post Christmas holiday.

I didn't touch my FMP during the Christmas holiday simply because of the vast amount of work I had for my other modules however since being back for a day I have added a few changes to the environment. 

First of all the second presentation of the year gave me some valuable information. This presentation took place on week 10 of University. After my presentation I got given 4 sets of information I need to work with to improve my environment.

- I need a way to blend the spawn zone of the environment into a bigger setting so you cant see the end of the world terrain.

- I need to re texture my rocks as the texturing doesn't resemble rock.

- I need to resize my large trees as they do not look realistic (in terms of proportion)

- I should focus on my temple when it comes to texturing before anything else.


I will work on this information as soon as possible. For now I've added simple pond plants and other flora to decorate the inner area of the temple and fill it out from the emptiness that it was. Attempted a few texturing tests around my environment to try and grasp a style. However, for now I will try and match the texturing to the aesthetic qualities of flora, which is quite basic, calm colours that blend in well with each other.

All the textures at the moment are just placeholder. There are a few problems I need to address. For example the resolution of the lake floor although being 4096x4096 you can still see pixelation in the grounds normal maps. This might be due to the cel-shader not being able to render normal maps correctly due to only a two tone lighting system which makes the normal maps come out strange and not correct (this is also an issue I need to fix). 

Metallic maps and roughness maps seem to work correctly however they bring out a contrast within the environment that contrasts with the style. Meaning it doesn't quite fit the washy colour scheme and makes a very strong colour.







This is the area I need to make fit into a larger environment to keep a consistency of the "illusion of seclusion" functionality of a small game environment. To address this, I will most likely create another terrain past the one that the player spawns on, and then map planes with tree alphas on top to give the illusion of a forest surrounding the temple. 









Monday, December 3, 2018




Week 9

This week made more additions to my organic modelling collection. New asetts that have been created - 

- Rocks
- Large Trees
- Buddha

The rocks are approximately 1K Tris each. I didn't want to go beyond this as rocks can be achieved with a significant low poly count using baking methods. I went with more runic shaped rocks. By this I mean rocks that would be seen around altars or henges across the globe. An example of this is of course Stone Henge which although native to England, still boasts magical presence with the shape of its stones. I didn't recreate the structure as that would of been out of place within my environment just the shape of the individual stones.

 The tree was a little different from the usual modelling process. This is only because the polygon density needs to be higher at eye level rather than at the top of the tree. Meaning I had to use poly paint to zremesh within zbrush. Polypainting excels at specific tasks such as this one. 

I also worked with the re-topology of my dragon. Originally it was dynameshed and imported straight from Zbrush. This was a problem due to two factors. One the normals of the model were wrong. Secondly the engine finds reading a irregularly triangle mesh much harder than a good working topology. 

This also means its much easier to UV unwrap and the seems wont be quite so noticeable. I'm still currently struggling to retopologise the Buddha. Mainly because the face wasn't symmetrical which makes attempting to get a good zremesh topology near impossible so i believe I will have to remodel the head of the Buddha. However apart from that I'm happy with the robe and hands.




Friday, November 23, 2018

Week 8 

After optimising my level better i can finally add more models and detail to the environment. The first step i wanted to cover before importing new models was the finalisation of the temple.

The temple has been an on going issue. The first problem was its polygon count, which I've managed to fix and reduce to 87K. The second issue I came across was that the temple was not welded at certain parts which mean light would break through the roof. It wasn't a solid build. To fix this i welded the corners and roofs together making it one solid piece. I then experimented with attaching the roof parts and the walls into one mesh, then duplicating it two times, re scaling and attaching them. Approaching the temple this way would mean i would only have to use one draw call of 4096 x 4096. This is a lot more efficient and would be ideal. 

The main problem with this was that the lighting of the temple within the engine wasn't building correctly. It  took a few hours of understanding how light maps work to fix this. Light maps are simply a separate UV that unreal automatically creates. It works much like the flattening map function within 3DS MAX in which it creates individual islands for every polygon within the UV. However with a model that has 80K polygons the Light map resolution would have to be roughly 8196 x 8196. Unreal only lets you create a light map resolution of 4096 x 4096. This meant i simply couldn't have a single mesh sharing one UV with such a polygon density. Thus i had to readjust how many models I split the temple into so unreal engine could build the lighting with no problems. 



After finishing the temple it was time to add more models to my scene to fill it out more. I started with walls surrounding the perimeter because I wasn't happy with the current set up. After researching traditional gates and towers that surround a historic Chinese temple I applied the most common recurring theme to my environment. The build it self wasn't complex and i managed to keep it relativity low polygon.



I then went on to create a shrine in which I could place the Buddha which in my original concept drawings would of been within the temple. But since the feedback i got given I decided to instead put it outside and work only on the outside environment. This meant creating a shrine in which it could be placed.



After this i went on to create fences that fit more to the theme than the bamboo originally did. I then also added a lake terrain box so it wasn't the standard terrain surrounding the temple grounds. This will allow me to add tiles or ground textures with custom normals, roughness, speculars so on and so forth achieving a higher quality finish than standard terrain could create. 



Lastly and most importantly I decided against using the outline blueprint within my environment. The main reason for this was that it was clashing with the ability to create dynamic lighting, god rays, volumetric fog and dynamic shadows. These 4 aspects are the reason unreal engine thrives graphically over unity. And since I chose unreal for its better graphical implementations I decided i should make use of them. Over all it has greatly increased the aesthetics of my environment and unless i can work out how to manipulate the blueprint to still allow for these graphical enhancements to occur i will not be going back. This also means that my original plan of having a high polygon count on technically implemented models was wasted and I could infact get away with greatly decreased poly counts on models such as the temple as there is no outline giving the suggestion of the polygon count anymore. This art style is more representative of games such as Zelda: Breath of the wild rather than my original inspiration of dungeon defenders. 




Saturday, November 17, 2018

Week 7 - Optimisation 

My project finally starting hitting the breaking point of optimisation. I had never made a unreal engine project this big before so i didn't know the limits of the engine and how far I could go before it started to drop below an FPS that was optimal. 

This didn't mean i had no awareness that 200K tris for a building was abnormally large. I was aware through the teachings i've received what should be expected of polygon count but without breaking the system my self i would never have known how far i can go and how far i should be going. 

The most taxing part of my project so far was not even the polygon count it was more the amount of alpha planes the engine was trying to compute. But i'll break it all more down in the proceeding paragraphs. 

List of assets that have been optimised -

Temple 207k Tris -> 99k Tris 

150K Grass Plane Foliage -> 56.7K

Blossom 10k Tris -> 6k Tris

20 Tree Foliage Instances -> 14 Tree Foliage Instances

Baked shadows off on Blossom Trees

Static shadows on all objects from half dynamic

Cull range from 0 -> 5K on all grass foliage

Environment change for linear movement to reduce polycount

The temple.

The temple was exceedingly large on the polygon count. The polygon count reduces performance because of the amount of individual faces the engine has to calculate how the light responds the the normals and smoothing groups being applied to the model. The temple is made of approximately 52 individual models, majority of them are duplicates and varied in someway meaning I could easily then unwrap them and attach to share the same UV space.

This allowed me to combine the entirety of the 52 models down into a mere 12 static mesh instances. Each of these static mesh instances is it's own draw call. This is optimisation for the future when I move on to texturing.  

The cel-shader depending on how its coded in the blue print can either allow for outlines around smoothing groups (or, and) around the geometry of the building. So I tried to keep the integrity of the shape as much as I could when cutting the Tri count down. I won't to greatly in detail of what parts of the temple were more or less efficient than others but I will outline the ones that were great or the ones that were terrible. 

The walls of my temple were by far the least efficient. This is simply because I'm now focusing on only the outside environment I didn't need double sided meshes to block light from penetrating the walls. Meaning I could model simple plane geometry in the shape similar to the original. Just cutting the shape of the walls down meant removing approximately 16000 Tris. 

Each polygonal instance of the roofs were around 5000 Tris. I managed to cut each instance down to around 2500 which meant around Half my Tri count was obliterated. The fences were 16000 Tris which is so ridiculously large that I just deleted them instead of trying to find a work around. I will most likely remodel a lower polygon version. 

You can naturally tell a difference between the high poly and low poly in engine. However as I anticipated it's not anywhere near enough to justify keeping a static instances that doubles the lower poly. If in the near future I find a problem with my engine that was costing severe performance and fixed it and can in fact use the lower poly as a LOD and not as the mesh I will do so. And if I further need to optimise I will LOD the lowerpoly and use this aswell. 

                98k(not in scale)                                                           207k

Foliage

I've never worked with foliage in unreal engine or even unity for that matter so it makes sense that I wouldn't know the limitations for quantity within an engine. Nothing surprised me immensely about how little or how much you could push it before you dipped below 60 fps. However I've learnt much more than I thought I would in terms of foliage within a game engine.

Firstly the blossom tree, I managed to cut it down from 10k to 6k. The trunk of the tree was roughly 2.1k which I then cut down to around 0.8k already taking off 1.3k Tris. The leaves were 8k Tris. I realised that the amount of planes within a fibermesh instance in zbrush does not dictate the amount of leaves. The amount of leaves is a variable decided on the alpha texture, this meant i could drastically decrease the polycount and even increase the quality of the tree. 

Iv'e decided to keep both meshes but mostly use the 6k and then dot the 10k around for variation in colour and size. This all together cut down around 120k Tris from my scene. 

I turned shadows off the blossom trees for now because calculating where light doesn't penetrate in an instance of 4K alpha planes is very taxing.

However I was a little surprised to find that the most taxing aspect of my FMP so far was indeed the grass planes. I expected the process of optimisation to maybe involve reducing the plane count but not so much on the use of lighting. However static shadows are essential for aesthetically pleasing foliage so I kept it on and simply reduced the amount of planes instead. 


This is with the amount of planes reduced. As you can see the grass foliage is still "extremely bad" meaning I'll need to possibly increase the size of the grass on the texture to reduce the amount of light that can get through the plane, increasing performance. 

Its also important to note I've decided to change my plan of the environment. Originally I was going to let the player run around the forest surrounding the temple. However because of the player perspective if i do this it means i cant reduce the grass planes on either side of the main path. However if they are forced down a linear path then because of their eye level its a lot harder to make out the grass plane count across the field as they are all parallaxing and its not been viewed from a top down perspective. 

So far this is all the optimisation I've applied. I will find that I'll need to optimise more when I start bringing in textures with draw calls, more models, particle effects, animations, terrain instances and high resolution mountain textures for around the environment. But I will cross that bridge when I come to it. 

So far I've managed to increase the FPS from 80 to 130 in a single day with very little loss of quality and an even cleaner temple build. 

Wednesday, November 14, 2018

Week 7 - Large Update


Since week 6 I have added a substantial more amount of content into my FMP after critical reflection of my presentation last week.

Aspects that have been added -

(Organic)

- One blossom tree model & foliage instance
- One grass plane foliage instance
- One flower foliage instance
- New terrain textures

(Technical)

- One water wheel & house extension (animated)
- Two dragon statues (duplicated)
- Four fountain models (duplicated)
- Bridge 
- Second & Third tier of temple
- Outside terrace walks

(Removed)

- Main walk way up to the temple (player spawn)

Organic Modelling

Originally i was going to leave all organic modelling towards the end of my self made modelling deadline simply because I wanted everything to be white boxed and most organic modelling with alpha maps cant be added without colour.

The blossom tree is around 10K polygons. Which is fundamentally too high IF they were all single static meshes. However because I unwrapped the leaves and tree within the same UV and attached them as a single mesh with two different materials it allows me the possibility to add them as static mesh foliage instances. Which greatly increases performance and optimisation so the polygon count doesn't become irrelevant but defiantly matters less. The modelling of the tree was a standard z-brush process with nothing too complex. However it required a better understanding of how fibermesh worked and I now feel comfortable using the modifier to create foliage for large living organic meshes. I also learnt of a new modifier within max called optimisation. Optimisation drastically reduces the poly count much like Z-remsher in zbrush only you don't have the control through polypainting the desired place for high polygon or low polygon redistribution.



The grass plane model was the standard process of creating grass blade models within max, applying smoothing groups, turbo-smoothing and applying a gradient material. The reason this process is widely used is because when baking onto a plane you can choose any custom resolution, auto inputs a alpha map, bakes a normal map and also bakes dynamic shadowing through specular and light maps. The only downside is you don't get photorealstic texturing on the blades of grass post baking. However you can paint this onto the baked diffuse map after. But for my game in which photorealism does give anything it only takes away from the style so this method doesn't have any drawbacks.

I also followed the same method for the baking of the flower texture. By creating petals, rotating and mirroring them around a pivot point at 72 degree angles, modelling a cylinder and applying a FF3 modifier to bend in the direction I wished, I created the stem. I then used the grass models to create the leaves.



The material differs from materials added to technical modelling because you need to allow for dynamic lighting to be applied to both the side the normal is facing and the side its not. In other words you need to apply a subsurface lighting application into the blueprint. Along with this I needed to add wind animation to my foliage. Which is simple contrary to how complex it may sound at first. This is made easy due to unreal built in wind blueprint nodes. I followed a great tutorial on YouTube which made use of multiple vector parameters to control variation of wind, saturation and tint on the material which made the same blueprint applicable to multiple models.



The terrain textures are pictures I took my self with a DLSR camera. There were 3 variables I needed to consider when taking real life texture photos. The direction of light, the colour temperature of the day, how easily the photo can be made seamless. Along with this there was also the variation of distance, close, mid range and far away which can all be used in their own unique situations. This meant a total of 9 pictures of the same texture in order to find the perfect shot for my game. The reason i worried about the colour balance of the photo (temperature tint, e.g, red or blue tint) was so I didn't lose quality if I changed the saturation after the photo was taken. I would of taken RAW photos for even more graphical control but its not needed and more work to the workflow.  After the photoshoot was done I simply resized the photo and made the one i thought was most relevant to my game seamless. 

Its worth mentioning that I'm aware the photos might be to realistic for my artstyle however if this is the case its fairly easy to readjust the textures to look more hand drawn. 

Technical Modelling

The waterwheel was a basic model and even more basic to animate it. I wont go to in depth because its simply not necessary. The only part worth mentioning about the process here would be that finding a decent reference of a waterwheel that represented Chinese architecture was hard. All the references of Chinese water wheels looked very different from each other. So in order to make it fit my theme I applied it to a Chinese styled house on the side of it. 



The dragon model was also fairly simple. However there were a few aspects I did change and a couple more I would change if I had time to go over it again. For starters the model itself although it does look like a Chinese dragon, the statues outside of temples are alot more robust, and figuratively suggest the idea of a Chinese dragon unlike mine which is a literal representation of the mythical beast meaning its less authentically less believable in my environment which contrasts with the idea of creating an immersive environment.  Secondly the dragon was around 10K polygons which i thought at first was actually too low. Rethinking it this was a bad deduction and then I further reduced it to 5k, If this still proves too high i will try applying the optimisation tool i learnt previously that is built into max. 



I personally feel my ability within the software increasing. I'm much more comfortable and efficient in my workflow. This project so far has increased my knowledge through research tenfold compared to the passive learning environment of a class. There is alto more problem solving and intuition in creating an environment than i originally thought. Furthermore readdressing the problem of polycount within my FMP I believe within the last week I've made active decisions to solve this.

I should note that I've decided against a bamboo forest because it no matter how many times I revisit this idea I just cant find away or even picture it looking good within my environment. 



References

https://www.youtube.com/watch?v=XuY5WIaqdkg Blueprint Tutorial (for foliage mat) 

Notes

 - I have added the third and second layer to the temple. The reason this isn't of higher priority in the blog is because they are really just duplicates with abit of polygon trimming (around 40k) on each tier. There wasn't any major modelling issues or critical reflection that needed mentioning. However this is a large landmark for me to of completed. 

- I've drastically increased my focus on the outside terrain due to the feedback given on the presentation. 

- I've added some smaller buildings around the temple as you can see in the last picture 

- I've changed the cloud textures and animation speed on the sky box as Ian said it was too stormy

- Every single aspect in this project is now hand made or self referenced ( There are no outside placeholders in these pictures, textures, models or anything else).

-

Friday, November 9, 2018

Week 6 - Presentation - Critical Reflection 

On the 6/11/2018 I had a presentation of my ongoing progress of my FMP so far. The presentation its self went smoothly although i could defiantly delivered it with more clarity. Most importantly I want to highlight the feed back I was given on my project.

They gave me 5 points of feedback. All of them I'm going to implement into my environment.

- The poly count needs reducing.
- The project is too ambitious i should focus on the outside environment before attempting the inside.
- The skybox doesn't match the atmosphere I'm trying to create.
- The overall grade of my environment is highly dependent on how efficiently I build it, cheating the system. 
- I should focus the polygon density more on the architecture rather than organic modelling such as the bamboo. 

To reduce the polycount they gave me a further in depth method of doing this. For example screen shotting the walls one the tier two of the temple and higher and replacing that with the walls currently there instead. As I will not be able to go in the temple or up there this will be a more effective use of my poly count. They also suggested this method to be used on my bamboo. 

The also suggested I use the free poly count on creating statues and detailed misc around the environment. 

This is the first adjustment I'm making based on the feedback. I'm currently in the process of modelling a dragon statue within Zbrush.