SlideShare a Scribd company logo
1 of 31
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 1
By Matumit Sombunjaroen V1.1 2017/04/17
Historica Fantasia Dev Blog
Chapter6:
Character Shader Hypothesis
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 2
The Reason this is done before Programming
Historica Fantasia will field
Up to a Maximum of 100-200 individual Characters at once.
Most Models will be duplicate.
But Processing test is still needed to see the Limits.
Depending on the result of this Experiment,
Certain Battle Presentations cannot be Use
Best Case Scenario: Full3D
Just put everyone on the field like in TotalWars
Worst Case Scenario: Cut-in Battle
Only do full render on Units that are taking part in a Battle
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 3
Rendering Objective
Flesh
Cloth02
Leather01
Metal
Faction
Color
Leather02
Every Characters will all share the Same Materials.
This is done by allocating UV to a color slot in the texture.
Pros:
Minimal Resources Needed for Rendering
Can field vast amount of Characters with Shared Materials
Cons:
Cannot use Normal or Occlusion Map
Need High PolyCount to obtain Hi-Quality Visual
Because there will be no close-up shots of the Characters,
The Cons should not be much of an issue.
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 4
Toon Ramp Shading
Flesh
Cloth02
Leather01
Faction
Color
Leather02
Non Metallic parts will use Toon Ramp Shader
With Maximum of 3 Ramps for
Shadow => Base => Highlight
The Shader will also receive Lighting from Environment.
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 5
Toon Metallic Shading
Gloss
Highlight
Fresnel Light
(Not sure if it’s
the correct term)
Rim Light
On top of Toon Ramp Shading,
Add Gloss Fresnel and Rim Lights.
Variations for various Metals
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 6
Shader Forge
For various Reasons,
Shader Forge, will be use for the Experiment
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 7
Experiment 1
Faction Color
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 8
Issues
Player and Enemy will have Different Color Clothing.
But increasing Materials or SubMesh will increase SetPass.
The Problem is, Adjusting a Material will make a Global Effect
As such, the same Material cannot be use for both Faction
Primary Solutions:
Using Script to relocate Cloth’s UV to another Color’s coordinate.
Secondary Solutions:
Add another Material per Faction.
Add SubMesh to Model.
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 9
Experiment – Relocating UV
This Script successfully allocate the 1st 50UVs
To Blue Coordinate (0.5,0.5).
The Problem is, In order for this to work,
You need to know which UV Indexes are used for
the Faction Cloth Mesh.
Because there is no effective way of finding it out,
Other than Trials & Errors per Model,
This is really impractical.
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 10
Experiment – Relocating UV 1.1FIXED
This will get Tri index Arrays from Submesh
UV Index is the same as Triangle
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 11
Experiment – Multiple Objects
By increasing the exact same objects.
Batches & SetPass Calls do not get increase.
Adding another Material to same Object
Increase Batches & SetPass.
Adding a different Object with same Material
Increase Batches,
But do not increase SetPass.
Therefore, it is preferable to
Increase Object Count,
than to Increase Material.
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 12
Experiment – SubMesh
This one is an Object with a SubMesh,
And Have 2 Materials assigned to it.
The Result is similar to having 2 of the same Object
With different Material.
Because SubMesh is part of the same Object,
It also has the issue with UV index
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 13
Conclusion
Make Faction Cloth a separate Mesh,
Share the Same Material with Every Factions,
Then use Script to reallocate just the Cloth UVs.
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 14
Experiment 2
Multiple Shader Material
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 15
Issues
Using Masking in ShaderForge,
Is it possible to obtain different Shadings in different Color Slot
In a Single Material?
We will try a simple Experiment,
Where only Red Slot will have a different Shading.
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 16
ShaderForge Test
…..IT WORKED…..
This is more simple than I thought.
Basically, all I had to do is Multiply Masking
-----------------------------------------------------
In the case of very Complex Masking,
Pre-Multiply each Shading Scheme to a Mask
=> Then Add everything with Add Node.
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 17
Conclusion
By Using ShaderForge Masking,
There is no need to separate Metal
to a different Materials
As such, only 1 Material is needed
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 18
Experiment 3
Shader Setup
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 19
Toon Ramp
This part of the Shader will create Toon Ramp
The Color is affected by Environmental Light
Ramp is created by Multiplying a Gradient Texture
-----------
As an alternative,
Light Color can be replace with Colored Ramp.
This will reduce needed Processing Power.
But the Color will no longer
be affected by Environmental Light
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 20
Metallic Toon
I cannot remember what I did any more,
Let just say it worked
Rim Light
Gloss
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 21
Toon Ramp V02
A Different Version,
This one Create Ramp Step from Float Value
Compare to Ramp Texture, it is faster to update,
But it cannot do Smooth Shadowing on Steps.
-----------
The Process is made by Unity’s Kobayashi-San
You can reference his shader from here
https://www.slideshare.net/nyaakobayashi/unity-14-
shader-forge-102-shaderforge
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 22
Experiment 4
Try Mass Field Units
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 23
Characters to use
I am using Aoi Character Pack, from Asset Store.
It has Multiple Preset Characters with 3 LODs each.
Since each Model are from different Files,
We can use each of them to represent a Model
We will try with HiRes Models first,
then down to LowRes Models
10 Models were randomly selected as Base
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 24
Setup
In the case of a Single Character,
FPS: 124.4
Tri: 52k
Batches: 22
SetPass Calls: 7
After Filling in the Scene with 200 Characters,
FPS: 76.1
Tri: 4.8M
Batches: 2062
SetPass Calls: 8
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 25
…..Try Animating
Using Walking Motion from Blendshape & Tails
FPS: 56.7
Tri: 4.8M
Batches: 2062
SetPass Calls: 8
….This turned out way better than I thought…..
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 26
What else can we do?
Even if I were to go for a relatively high Polycount for the Final Product,
it should be no more than 5k per Model
5k*200 = 1M Tri => Nearly 5times lower than what we tested.
+ The Models will not be shown all at once on Screen
So, In Conclusion,
there should be no Problem
With Method Selection
But just for the sake of Science,
I will try to see how many Models can I fit in to get it down lower than 30FPS
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 27
After several try,
600 Characters
FPS: 24.7
Tri: 12.8M
Batches: 5458
SetPass Calls: 8
As a Side note, this is my PC Spec
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 28
Try the Original
Try Animating 200 Characters
w/10 Different Base Models + Original Materials
FPS: 95.8
Tri: 168k
Batches: 71
SetPass Calls: 71
FPS: 39.6
Tri: 3.3M
Batches: 1401
SetPass Calls: 1401
There’s a really big differences
when compared to using a Single Material
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 29
One Final Try
Originally, each Model has Submeshes with 4 Materials
We tried using one Material per Model instead
FPS: 92.5
Tri: 188.6k
Batches: 81
SetPass Calls: 23
FPS: 39.3
Tri: 3.7M
Batches: 1601
SetPass Calls: 441
Even if the Models do have Submeshes,
Assigning them with the same Material lower it down
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 30
Final Comparison
Single Material
FPS: 56.7
Tri: 4.8M
Batches: 2062
SetPass Calls: 8
10 Materials
FPS: 39.3
Tri: 3.7M
Batches: 1601
SetPass Calls: 441
Original
FPS: 39.6
Tri: 3.3M
Batches: 1401
SetPass Calls: 1401
@OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 31
Final Conclusion
Put every character on the field
like Total Wars is possible
With this Single Material Method

More Related Content

What's hot

What's hot (9)

Historica Fantasia, Development Blog 01 Introduction
Historica Fantasia, Development Blog 01 IntroductionHistorica Fantasia, Development Blog 01 Introduction
Historica Fantasia, Development Blog 01 Introduction
 
James Pierro Pitch
James Pierro PitchJames Pierro Pitch
James Pierro Pitch
 
Joel antony beck portfolio
Joel antony beck   portfolioJoel antony beck   portfolio
Joel antony beck portfolio
 
Parsec pitch
Parsec pitchParsec pitch
Parsec pitch
 
Turn based tactical design fundamentals and a handful of tips - takeaway version
Turn based tactical design fundamentals and a handful of tips - takeaway versionTurn based tactical design fundamentals and a handful of tips - takeaway version
Turn based tactical design fundamentals and a handful of tips - takeaway version
 
Designing balance (takeaway version)
Designing balance (takeaway version)Designing balance (takeaway version)
Designing balance (takeaway version)
 
Prince of persia2
Prince of persia2Prince of persia2
Prince of persia2
 
Important Michael Pic
Important Michael PicImportant Michael Pic
Important Michael Pic
 
Phantom Doctrine: a Design Post-Mortem
Phantom Doctrine: a Design Post-MortemPhantom Doctrine: a Design Post-Mortem
Phantom Doctrine: a Design Post-Mortem
 

Viewers also liked

Photograph selection for magazine cover 4
Photograph selection for magazine cover 4Photograph selection for magazine cover 4
Photograph selection for magazine cover 4
bc05093848
 

Viewers also liked (17)

Historica fantasia 企画書
Historica fantasia 企画書Historica fantasia 企画書
Historica fantasia 企画書
 
Spring Tax Update 2017 - Torquay
Spring Tax Update 2017 - TorquaySpring Tax Update 2017 - Torquay
Spring Tax Update 2017 - Torquay
 
Contabilidad 10 a
Contabilidad 10 aContabilidad 10 a
Contabilidad 10 a
 
Manual corpo2
Manual corpo2Manual corpo2
Manual corpo2
 
Διερευνητικές εργασίες
Διερευνητικές εργασίεςΔιερευνητικές εργασίες
Διερευνητικές εργασίες
 
T1 e1 domenech-gerard
T1 e1 domenech-gerardT1 e1 domenech-gerard
T1 e1 domenech-gerard
 
Boob jiggle in Unity Part4
 Boob jiggle in Unity Part4 Boob jiggle in Unity Part4
Boob jiggle in Unity Part4
 
Napoleón
NapoleónNapoleón
Napoleón
 
Búsqueda en base de datos PubMed
Búsqueda en base de datos PubMedBúsqueda en base de datos PubMed
Búsqueda en base de datos PubMed
 
Progetto FITT! Forma il Tuo FuTuro. Il sistema duale dall'impresa alla bilate...
Progetto FITT! Forma il Tuo FuTuro. Il sistema duale dall'impresa alla bilate...Progetto FITT! Forma il Tuo FuTuro. Il sistema duale dall'impresa alla bilate...
Progetto FITT! Forma il Tuo FuTuro. Il sistema duale dall'impresa alla bilate...
 
Boob jiggle in Unity Part2
Boob jiggle in Unity Part2Boob jiggle in Unity Part2
Boob jiggle in Unity Part2
 
Projeto integração família
Projeto integração famíliaProjeto integração família
Projeto integração família
 
Planeación, reclutamiento selección personal
Planeación, reclutamiento selección personalPlaneación, reclutamiento selección personal
Planeación, reclutamiento selección personal
 
дорогань н.в. укр. мова тв. впр.
дорогань н.в. укр. мова тв. впр.дорогань н.в. укр. мова тв. впр.
дорогань н.в. укр. мова тв. впр.
 
Тренды Digital маркетинга 2017, Виталий Попов, Титансофт
Тренды Digital маркетинга 2017, Виталий Попов, ТитансофтТренды Digital маркетинга 2017, Виталий Попов, Титансофт
Тренды Digital маркетинга 2017, Виталий Попов, Титансофт
 
Photograph selection for magazine cover 4
Photograph selection for magazine cover 4Photograph selection for magazine cover 4
Photograph selection for magazine cover 4
 
Task 3B
Task 3BTask 3B
Task 3B
 

Similar to Historica Fantasia, Development Blog 06, ShaderForge Character Shader

Similar to Historica Fantasia, Development Blog 06, ShaderForge Character Shader (6)

Unity Morph performance test
Unity Morph performance testUnity Morph performance test
Unity Morph performance test
 
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
 
React, Electron & Braaains - Magikcraft.io Project Update
React, Electron & Braaains - Magikcraft.io Project UpdateReact, Electron & Braaains - Magikcraft.io Project Update
React, Electron & Braaains - Magikcraft.io Project Update
 
Optimizing Large Scenes in Unity
Optimizing Large Scenes in UnityOptimizing Large Scenes in Unity
Optimizing Large Scenes in Unity
 
190410 sc fegan-face_editing_generative_adversarial_network_with_users_sketch...
190410 sc fegan-face_editing_generative_adversarial_network_with_users_sketch...190410 sc fegan-face_editing_generative_adversarial_network_with_users_sketch...
190410 sc fegan-face_editing_generative_adversarial_network_with_users_sketch...
 
Independent Activity 8
Independent Activity 8Independent Activity 8
Independent Activity 8
 

More from Matumit Sombunjaroen

The Reasons why people who said [Video Games are bad] are either ignorance or...
The Reasons why people who said[Video Games are bad]are either ignorance or...The Reasons why people who said[Video Games are bad]are either ignorance or...
The Reasons why people who said [Video Games are bad] are either ignorance or...
Matumit Sombunjaroen
 
Read mepdf v3_0_08_damagingcontrol
Read mepdf v3_0_08_damagingcontrolRead mepdf v3_0_08_damagingcontrol
Read mepdf v3_0_08_damagingcontrol
Matumit Sombunjaroen
 

More from Matumit Sombunjaroen (20)

「ティルズ・オブ・アライズ」のスキットは スキットの劣化である
「ティルズ・オブ・アライズ」のスキットは スキットの劣化である「ティルズ・オブ・アライズ」のスキットは スキットの劣化である
「ティルズ・オブ・アライズ」のスキットは スキットの劣化である
 
ヒストリカ・ファンタジア 日本語版ゲーム制作 20210319
ヒストリカ・ファンタジア 日本語版ゲーム制作 20210319ヒストリカ・ファンタジア 日本語版ゲーム制作 20210319
ヒストリカ・ファンタジア 日本語版ゲーム制作 20210319
 
タイ人オタクが艦これ聖地山を巡った話 第3話1章 和歌山 新宮市 熊野川
タイ人オタクが艦これ聖地山を巡った話 第3話1章 和歌山 新宮市 熊野川タイ人オタクが艦これ聖地山を巡った話 第3話1章 和歌山 新宮市 熊野川
タイ人オタクが艦これ聖地山を巡った話 第3話1章 和歌山 新宮市 熊野川
 
タイ人オタクが艦これ聖地山を巡った話 第2話 神戸 摩耶
タイ人オタクが艦これ聖地山を巡った話 第2話 神戸 摩耶タイ人オタクが艦これ聖地山を巡った話 第2話 神戸 摩耶
タイ人オタクが艦これ聖地山を巡った話 第2話 神戸 摩耶
 
タイ人オタクが艦これ聖地山を巡った話 第1話 京都 高雄~愛宕山
タイ人オタクが艦これ聖地山を巡った話 第1話 京都 高雄~愛宕山タイ人オタクが艦これ聖地山を巡った話 第1話 京都 高雄~愛宕山
タイ人オタクが艦これ聖地山を巡った話 第1話 京都 高雄~愛宕山
 
สาเหตุที่ไม่ควรเอา JLPT N1...N2.... มาเป็นจุดเป้าหมายในการเรียนภาษาญี่ปุ่น
สาเหตุที่ไม่ควรเอา JLPT N1...N2.... มาเป็นจุดเป้าหมายในการเรียนภาษาญี่ปุ่นสาเหตุที่ไม่ควรเอา JLPT N1...N2.... มาเป็นจุดเป้าหมายในการเรียนภาษาญี่ปุ่น
สาเหตุที่ไม่ควรเอา JLPT N1...N2.... มาเป็นจุดเป้าหมายในการเรียนภาษาญี่ปุ่น
 
タイ人オタクが日本でモバイルゲーム制作を諦めた経緯の話
タイ人オタクが日本でモバイルゲーム制作を諦めた経緯の話タイ人オタクが日本でモバイルゲーム制作を諦めた経緯の話
タイ人オタクが日本でモバイルゲーム制作を諦めた経緯の話
 
เรื่องเกี่ยวกับ โรงเรียนวิชาชีพ ในญี่ปุ่น
เรื่องเกี่ยวกับ โรงเรียนวิชาชีพ ในญี่ปุ่นเรื่องเกี่ยวกับ โรงเรียนวิชาชีพ ในญี่ปุ่น
เรื่องเกี่ยวกับ โรงเรียนวิชาชีพ ในญี่ปุ่น
 
Idol Master Platinum Stars アイマス プラチナスターズ Game Review
Idol Master Platinum Stars アイマス プラチナスターズ Game ReviewIdol Master Platinum Stars アイマス プラチナスターズ Game Review
Idol Master Platinum Stars アイマス プラチナスターズ Game Review
 
Ram is not RAM
Ram is not RAMRam is not RAM
Ram is not RAM
 
Game development process 1 GDD
Game development process 1 GDDGame development process 1 GDD
Game development process 1 GDD
 
กระบวนการผลิตงานศิลปะ
กระบวนการผลิตงานศิลปะกระบวนการผลิตงานศิลปะ
กระบวนการผลิตงานศิลปะ
 
Games workshop
Games workshopGames workshop
Games workshop
 
あるタイ人オタクが数々の日本のオンラインゲームを辞めた経緯の話
あるタイ人オタクが数々の日本のオンラインゲームを辞めた経緯の話あるタイ人オタクが数々の日本のオンラインゲームを辞めた経緯の話
あるタイ人オタクが数々の日本のオンラインゲームを辞めた経緯の話
 
What is Generalization
What is GeneralizationWhat is Generalization
What is Generalization
 
What is Otaku
What is OtakuWhat is Otaku
What is Otaku
 
Reasons Thailand Education Suck like Hell
Reasons Thailand Education Suck like HellReasons Thailand Education Suck like Hell
Reasons Thailand Education Suck like Hell
 
Reason to go or not to go to university
Reason to go or not to go to universityReason to go or not to go to university
Reason to go or not to go to university
 
The Reasons why people who said [Video Games are bad] are either ignorance or...
The Reasons why people who said[Video Games are bad]are either ignorance or...The Reasons why people who said[Video Games are bad]are either ignorance or...
The Reasons why people who said [Video Games are bad] are either ignorance or...
 
Read mepdf v3_0_08_damagingcontrol
Read mepdf v3_0_08_damagingcontrolRead mepdf v3_0_08_damagingcontrol
Read mepdf v3_0_08_damagingcontrol
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Historica Fantasia, Development Blog 06, ShaderForge Character Shader

  • 1. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 1 By Matumit Sombunjaroen V1.1 2017/04/17 Historica Fantasia Dev Blog Chapter6: Character Shader Hypothesis
  • 2. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 2 The Reason this is done before Programming Historica Fantasia will field Up to a Maximum of 100-200 individual Characters at once. Most Models will be duplicate. But Processing test is still needed to see the Limits. Depending on the result of this Experiment, Certain Battle Presentations cannot be Use Best Case Scenario: Full3D Just put everyone on the field like in TotalWars Worst Case Scenario: Cut-in Battle Only do full render on Units that are taking part in a Battle
  • 3. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 3 Rendering Objective Flesh Cloth02 Leather01 Metal Faction Color Leather02 Every Characters will all share the Same Materials. This is done by allocating UV to a color slot in the texture. Pros: Minimal Resources Needed for Rendering Can field vast amount of Characters with Shared Materials Cons: Cannot use Normal or Occlusion Map Need High PolyCount to obtain Hi-Quality Visual Because there will be no close-up shots of the Characters, The Cons should not be much of an issue.
  • 4. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 4 Toon Ramp Shading Flesh Cloth02 Leather01 Faction Color Leather02 Non Metallic parts will use Toon Ramp Shader With Maximum of 3 Ramps for Shadow => Base => Highlight The Shader will also receive Lighting from Environment.
  • 5. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 5 Toon Metallic Shading Gloss Highlight Fresnel Light (Not sure if it’s the correct term) Rim Light On top of Toon Ramp Shading, Add Gloss Fresnel and Rim Lights. Variations for various Metals
  • 6. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 6 Shader Forge For various Reasons, Shader Forge, will be use for the Experiment
  • 7. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 7 Experiment 1 Faction Color
  • 8. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 8 Issues Player and Enemy will have Different Color Clothing. But increasing Materials or SubMesh will increase SetPass. The Problem is, Adjusting a Material will make a Global Effect As such, the same Material cannot be use for both Faction Primary Solutions: Using Script to relocate Cloth’s UV to another Color’s coordinate. Secondary Solutions: Add another Material per Faction. Add SubMesh to Model.
  • 9. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 9 Experiment – Relocating UV This Script successfully allocate the 1st 50UVs To Blue Coordinate (0.5,0.5). The Problem is, In order for this to work, You need to know which UV Indexes are used for the Faction Cloth Mesh. Because there is no effective way of finding it out, Other than Trials & Errors per Model, This is really impractical.
  • 10. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 10 Experiment – Relocating UV 1.1FIXED This will get Tri index Arrays from Submesh UV Index is the same as Triangle
  • 11. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 11 Experiment – Multiple Objects By increasing the exact same objects. Batches & SetPass Calls do not get increase. Adding another Material to same Object Increase Batches & SetPass. Adding a different Object with same Material Increase Batches, But do not increase SetPass. Therefore, it is preferable to Increase Object Count, than to Increase Material.
  • 12. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 12 Experiment – SubMesh This one is an Object with a SubMesh, And Have 2 Materials assigned to it. The Result is similar to having 2 of the same Object With different Material. Because SubMesh is part of the same Object, It also has the issue with UV index
  • 13. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 13 Conclusion Make Faction Cloth a separate Mesh, Share the Same Material with Every Factions, Then use Script to reallocate just the Cloth UVs.
  • 14. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 14 Experiment 2 Multiple Shader Material
  • 15. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 15 Issues Using Masking in ShaderForge, Is it possible to obtain different Shadings in different Color Slot In a Single Material? We will try a simple Experiment, Where only Red Slot will have a different Shading.
  • 16. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 16 ShaderForge Test …..IT WORKED….. This is more simple than I thought. Basically, all I had to do is Multiply Masking ----------------------------------------------------- In the case of very Complex Masking, Pre-Multiply each Shading Scheme to a Mask => Then Add everything with Add Node.
  • 17. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 17 Conclusion By Using ShaderForge Masking, There is no need to separate Metal to a different Materials As such, only 1 Material is needed
  • 18. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 18 Experiment 3 Shader Setup
  • 19. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 19 Toon Ramp This part of the Shader will create Toon Ramp The Color is affected by Environmental Light Ramp is created by Multiplying a Gradient Texture ----------- As an alternative, Light Color can be replace with Colored Ramp. This will reduce needed Processing Power. But the Color will no longer be affected by Environmental Light
  • 20. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 20 Metallic Toon I cannot remember what I did any more, Let just say it worked Rim Light Gloss
  • 21. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 21 Toon Ramp V02 A Different Version, This one Create Ramp Step from Float Value Compare to Ramp Texture, it is faster to update, But it cannot do Smooth Shadowing on Steps. ----------- The Process is made by Unity’s Kobayashi-San You can reference his shader from here https://www.slideshare.net/nyaakobayashi/unity-14- shader-forge-102-shaderforge
  • 22. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 22 Experiment 4 Try Mass Field Units
  • 23. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 23 Characters to use I am using Aoi Character Pack, from Asset Store. It has Multiple Preset Characters with 3 LODs each. Since each Model are from different Files, We can use each of them to represent a Model We will try with HiRes Models first, then down to LowRes Models 10 Models were randomly selected as Base
  • 24. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 24 Setup In the case of a Single Character, FPS: 124.4 Tri: 52k Batches: 22 SetPass Calls: 7 After Filling in the Scene with 200 Characters, FPS: 76.1 Tri: 4.8M Batches: 2062 SetPass Calls: 8
  • 25. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 25 …..Try Animating Using Walking Motion from Blendshape & Tails FPS: 56.7 Tri: 4.8M Batches: 2062 SetPass Calls: 8 ….This turned out way better than I thought…..
  • 26. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 26 What else can we do? Even if I were to go for a relatively high Polycount for the Final Product, it should be no more than 5k per Model 5k*200 = 1M Tri => Nearly 5times lower than what we tested. + The Models will not be shown all at once on Screen So, In Conclusion, there should be no Problem With Method Selection But just for the sake of Science, I will try to see how many Models can I fit in to get it down lower than 30FPS
  • 27. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 27 After several try, 600 Characters FPS: 24.7 Tri: 12.8M Batches: 5458 SetPass Calls: 8 As a Side note, this is my PC Spec
  • 28. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 28 Try the Original Try Animating 200 Characters w/10 Different Base Models + Original Materials FPS: 95.8 Tri: 168k Batches: 71 SetPass Calls: 71 FPS: 39.6 Tri: 3.3M Batches: 1401 SetPass Calls: 1401 There’s a really big differences when compared to using a Single Material
  • 29. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 29 One Final Try Originally, each Model has Submeshes with 4 Materials We tried using one Material per Model instead FPS: 92.5 Tri: 188.6k Batches: 81 SetPass Calls: 23 FPS: 39.3 Tri: 3.7M Batches: 1601 SetPass Calls: 441 Even if the Models do have Submeshes, Assigning them with the same Material lower it down
  • 30. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 30 Final Comparison Single Material FPS: 56.7 Tri: 4.8M Batches: 2062 SetPass Calls: 8 10 Materials FPS: 39.3 Tri: 3.7M Batches: 1601 SetPass Calls: 441 Original FPS: 39.6 Tri: 3.3M Batches: 1401 SetPass Calls: 1401
  • 31. @OtakuEatMama : @HistoricaFantasiaDevBlog : Zenneth@zodiac-alliance.com 31 Final Conclusion Put every character on the field like Total Wars is possible With this Single Material Method