1. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 1
By Matumit Sombunjaroen V1.0 2017/07/24
Historica Fantasia Dev Blog
Chapter8:
Prototype Units
3. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 3
Target
Highlight toward adjacent
Bright Color
Red, Green => Yellow
Blue , Green => Cyan
Blue, Red => MagentaBase Color
Shadow contain
Opposite Color
Red <=> Cyan
Blue <=> Yellow
Green <=> Magenta
4. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 4
Initial Setup
Make the Image 2000x
This will make it
more convenient to work on than 2048x
After the work is done,
we can Resize it down to 1024x
Split The Horizontal Grid to 20 Sections
**Unity have Automated Image Compression**
It is more convenient to work
on a large file then compress it down,
than to create a small texture and
have problem making it big later
5. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 5
Color Spectrum
Use the Gradient Tool and Spectrum preset
to create a Color Spectrum
Edit => Pixelate => Mosaic
and set Cell Size value to 100
This will divide the Cell to 20 Even Columns
Because Red is duplicated on the Right
We can delete it to make Monochrome Column
6. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 6
Base Color Shifting
Split vertical parts into 4 equal Sections
Create a Vertical Monochrome Gradient
on the top part, Mosaic it,
then duplicate like in the image
Color Dodge
Difference
Color Dodge shift the Highlight to the Base Color that we wanted
Gradually lower Opacity for top Colors
The Base Color is blended with opposite Color
Obsolete, Reference only
Process this in ShaderForge
7. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 7
Leveling
Multiply
Adjust the Opacity accordingly,
We Finally got the Color Chart that we wanted
However, Because we only need 5 Levels
We will extract only the Parts that we need
Screen
Original
De-saturated
Reserved for Metal Shader
To be Change accordingly
Reserved for
Faction Colors
In case anything else
are needed
Obsolete, Reference only
Process this in ShaderForge
9. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 9
Color Chart
After reviewing the Process,
Color Shifting was easier to be done in Shader Forge
So, we only use HardLight
to create the needed Base Spectrum
Metal Part is simply the part where
there will be Specular
The Latter Part is reserved
for anything that might came up
Original
Metal
Reserved
For anything else
10. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 10
Masking
Mask the Metal part
with White in Alpha Channel
Alpha Channel can be
extracted in Shader Forge
11. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 11
Faction Color
Red ( 0.025, 0.875 )
U = 0.025
V = 1 – ( 0.05*2 + 0.025 ) = 0.875
Blue ( 0.675, 0.875 )
U = 13*0.05 + 0.025 = 0.675
V = 1 – ( 0.05*2 + 0.025 ) = 0.875
Shift from Base to Metal
Add Vector2( 0, 0.25 )
5*0.05 = 0.25
0.0250.05
13. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 13
LODs
The Model will be create for Medium Long Shot
Then, use Simplygon to make LODs
Medium Long Shot
~ 20 Models
~5000-10000 poly each
200000
Long Shot
~80 Models
~2000-5000 poly each
400000
Extreme Long Shot
<=200 Models
~500-2000 poly each
400000
14. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 14
Automatic LOD
Automatic LOD will be use for the time being,
If the Performance is not satisfactory,
We will try Simplygon instead.
Since We already have Fracturing & Destruction,
Upgrading to Mega Pack is more convenient
(+30USD)
15. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 15
**FBX EXPORT NOTES**
- Set all Materials to Lambert
- Use PNG
- Don’t Forget to Parent Items to right Bone
- iClone use Hand Down T-Pose by Default
21. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 21
After thoughts
Large Shield is a real hassle
when Animating
Hard to do dynamic animation
Need to rethink overall design
Model need averagely
Long arms to hold Rifle
….Use Rockbuster-type
Hand Cannon instead
Need more Armor
Need to redesign Cap
Ref Swan’s Form
Rune Circles are
a pain to animate
+ They Blocked vision
Just take them out
23. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 23
Base Color
This will give the same effect as an unlit shader
Texture2D Node will produce the output needed
But If User wanted the Node to be expose in Editor, TextureAsset node is needed
24. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 24
Add Light Color
Blending LightColor node will add Light Color to base Color
However, because the base shading is unlit,
It creates instant color change when going near point light
Since we NEED point light to simulate fire, this is needed to be fix
25. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 25
Light Blending
Multiply with Light Attenuation will add blending……but
It also create Shadowing from Other Objects,
which is not what we wanted, since we need to do Toon Shadowing
But Receiving Shadow
is also Created
Color is gradually blended
26. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 26
Adjust Key-light Setting
For the time being, Shadow from Key-Light got soften down,
to allow toon step shading
Further experiment will determine whether we keep this method or not
27. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 27
Add Atmospheric Color
Blend Color with Linear Light to add more Color to overall model
While Adjusting Directional Light pretty much do the same Effect,
Directional Light is Global, while Shader is Local
This Allow for more Control, such as making Unit Brighter in the dark
28. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 28
Grouping Base Color Nodes
Use Set to Group Base Color to a Single Node,
then use Get to get Node Data
29. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 29
Toon shadow Step – Half Lambert
These Nodes will create Half-Lambert
Where the Key Value will be constant base on Lighting Direction,
And is independent of Intensity
31. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 31
Toon shadow Step – Shadow Color
1st Add RGB Color to Shadow step will change Shadow’s overall color
2nd Texture=>OneMinus=>RGBToHSV=>HSVToRGB to extract opposite Hue
3rd Blend Opposite Color with Shadow Color via Linear Light to get final Shadow Color
4th Multiply this to Base Color to get Final Result
Switch Node is being use,
to test which one is more desirable
Base Shadow W/ Opposite
Color blend
32. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 32
Metallic – RimLight
1st Use Fresnel to get outer lying glow
2nd Get Dot Product of NormalDir*LightDir => Then OneMinus to inverse it
3rd Multiply everything to Get Final Kicker
Fresnel without
Inverse Dot
Fresnel with
Inverse Dot
33. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 33
Metallic – Gloss
I cant remember how it worked anymore,
Mainly, using Dot Product of HalfDir * NormalDir
and Multiply it with Dot Product of NormalDir*LightDir
35. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 35
Metallic – Masking
Masking for Metal Part was added to Texture’s Alpha Channel
Multiply it to part that need Lighting to get final Glow
36. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 36
Blend up everything
With Highlight
+ Masking
Add Light Layer to Base Color
Without Highlight
37. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 37
After thoughts – No Metal Masking
Metallic Parts
don’t look good
in bright condition
Base Color should be Darker,
And they should use their own
Shadow steps for better highlight
38. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 38
After thoughts – Self Shadowing
….They just look hideous,
We will take out this
Outline is hard
to be seen in the dark
Add RimLight to Base Color as well
39. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 39
After thoughts – Opposite Color Shadow
Even just for a bit,
Colors seem more vibrant
In Final Production,
-Add more Shadow Steps
-Give Metal Part its own Steps
-Rim Light for Base Color
41. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 41
Mesh Types
Skinned Mesh must be access via
SkinnedMeshRenderer
While Static Mesh must be access via
MeshFilter
They don’t share Common Inheritance
42. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 42
Instantiate Meshes
**Really important**
**Just found out this Process Breaking Issue**
**DO NOT** work on sharedMesh
Otherwise, THE ORIGINAL DATA WILL BE ALTERED
Clone Meshes need to be made,
But more Memory will be used
43. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 43
Test – Duplicate Material Instead
I’ve tried testing Duplicate Material
instead of Duplicate Mesh
The Result –
No change in Memory Used
But SetPass is nearly doubled
45. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 45
Comparison
Duplicate Materials (Constant of 2 Materials) –
- SetPass doubled, but remain almost a constant regardless of the Number of meshes
- Easier to Setup Model + Script
Duplicate Meshes (Increased per Unit Type) –
- SetPass Minimized
- Need Sub-meshes -> Harder to Setup Model
- Memory Usage doubled per Model type
Issues with SetPass increased is less significant than
possible Problems with Increased Memory Consumption
+ It’s just harder to setup
As such, We will change to using Duplicate Materials instead
46. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 46
Fixed Shader
Metal Mask was moved to a new Texture,
using Red Channel
Faction Color Mask is temporary for now,
using Green Channel
47. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 47
Faction Color Manager
Faction Color Manager
Will duplicate the base Material,
and create a new one per Faction Color
The Units will then reassign all Materials
based on their Factions
49. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 49
Automatic LOD
…….At the very least,
It’s not working well for the Meshes
May be it’s due to Color Slot Method
May be the models are too small
I don’t know why,
Any how, It’s not working
50. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 50
Mesh Simplify
…….And for some reason,
Mesh Simplify…worked
Even when they came
from the same Publisher
….But they don’t have LOD generated
51. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 51
Unity LOD Group
…Figured out how to use Unity’s LOD Group….
…..But I’m not going to use it
What happened is,
Unity treated each LOD as different Objects,
Meaning that,
Animation Controls must be
send to all Objects In order for them to sync properly
….It’s just way too much of a hassle
OR, we had to skinned each LOD mesh to the same bones,
inside XSI instead…. Which is also another hassle.
Figured how to work it out,
NEXT PAGE
52. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 52
Unity LOD Group
…Just Duplicate the Meshes INSIDE GameObject
The Meshes will retain Skinning Parameter
Then Add Mesh Simplify to each Meshes
Then, Drag each Mesh to LOD Groups
WALLAH!!! THEY WORKED NOW!!!
Note to Self:
Create Automated Editor for this Process
Figured how to work it out,
When about to quit for the day