SlideShare a Scribd company logo
Shaders
Ehsan Ehrari
1
Materials, Shaders & Textures
• Rendering in Unity uses Materials, Shaders and Textures. All three
have a close relationship.
2
Materials
• Materials define how a surface should be rendered, by including
references to the Textures it uses, tiling information, Color tints and
more. The available options for a Material depend on which Shader
the Material is using.
3
Textures
• Textures are bitmap images. A Material can contain references to
textures, so that the Material’s Shader can use the textures while
calculating the surface color of a GameObject. In addition to basic
Color (Albedo) of a GameObject’s surface, Textures can represent
many other aspects of a Material’s surface such as its reflectivity or
roughness.
4
Shader
• Small scripts that contain the mathematical calculations and
algorithms for calculating the Color of each pixel rendered, based on
the lighting input and the Material configuration.
• A program specifically made to run on a GPU
• Post processing
5
3D models
• a collection of 3D coordinates called vertices
• Triangles
• Each vertices can contain few other information's color , direction
• Models cannot be rendered without a material
• Materials are wrappers which contain a shader and the values for its
properties.
• Hence, different materials can share the same shader
6
Diagram
7
Anatomy of a shaders
• Unity has two different types of shaders
• surface shaders
• fragment and vertex shaders
• fixed function shaders
8
Anatomy of a shaders
• multiple SubShader sections
• actual instructions for the GPU
• Unity execute in order until it finds one that is compatible with your
graphics
• different platforms
9
The properties
• equivalent to the public fields in a C# script
• changes made to the properties of a material while the game is
running in the editor are permanent.
10
The properties
11
The surface VS Vertex and fragment
• Whenever the material you want to simulate needs to be affected by lights
in a realistic way, chances are you’ll need a surface shader
• Surface shaders hide the calculations of how light is reflected and allows to
specify “intuitive” properties such as the albedo, the normals, the
reflectivity and so on in a function called surf.
• Vertex and fragment shaders work close to the way the GPU renders
triangles, and have no built-in concept of how light should behave. The
geometry of your model is first passed through a function called vert which
can alter its vertices. Then, individual triangles are passed through another
function called frag which decides the final RGB colour for every pixel. They
are useful for 2D effects, postprocessing and special 3D effects which are
too complex to be expressed as surface shaders.
12
Unity Standard Shader
• built-in shader
• “real-world” objects
• wide range of shader types and combinations
• enabled or disabled by simply using or not using
• Incorporate PBS
13
Physics Base Shading
• Simulates the interactions between materials and light in a way that
mimics reality.
• Only recently become possible in real-time graphics
• It works at its best in situations where lighting and materials need to
exist together intuitively and realistically.
• Advance lighting model
14
Standard Shader
• The Standard Shader is designed with hard surfaces in mind (also
known as “architectural materials”), and can deal with most real-
world materials like stone, glass, ceramics, brass, silver or rubber. It
will even do a decent job with non-hard materials like skin, hair and
cloth.
• With the Standard Shader, a large range of shader types (such as
Diffuse, Specular, Bumped Specular, Reflective) are combined into a
single shader intended to be used across all material types.
15
Rendered using the standard shader on all models
16
Material Parameters
17
Rendering Mode
• Opaque
• Cutout
• Transparent
• Fade
18
Opaque
• Opaque - Is the default, and suitable for normal solid objects with no
transparent areas.
19
Cutout
• Cutout - Allows you to create a transparent effect that has hard edges
between the opaque and transparent areas. In this mode, there are
no semi-transparent areas, the texture is either 100% opaque, or
invisible. This is useful when using transparency to create the shape
of materials such as leaves, or cloth with holes and tatters.
20
Transparent
• Transparent - Suitable for rendering realistic transparent materials
such as clear plastic or glass.
21
Fade
• Fade - Allows the transparency values to entirely fade an object out,
including any specular highlights or reflections it may have. This mode
is useful if you want to animate an object fading in or out. It is not
suitable for rendering realistic transparent materials such as clear
plastic or glass because the reflections and highlights will also be
faded out.
22
Albedo Color
• The Albedo parameter controls the base color of the
surface.
• More common to assign a texture map for the
Albedo parameter
• Albedo texture should not contain any lighting
23
Albedo Transparency
• The alpha value of the Albedo colour controls the transparency level
for the material. This only has an effect if the Rendering
Mode for the material is set to one of the transparent mode, and
not Opaque.
24
Specular mode: Specular parameter
• Standard (Specular setup):
Choose this shader for the
classic approach. A Specular
color is used to control the
color and strength of
specular reflections in the
material.
25
Metallic mode: Metallic Parameter
• When working in the Metallic
workflow (as opposed to the
Specular workflow), the the
reflectivity and light response of
the surface are modified by the
Metallic level and
the Smoothness level.
26
Metallic
27
Smoothness
• The smoothness of the material is controlled by a slider. This slider
allows you to control the “microsurface detail” or smoothness across
a surface
28
Normal Maps
• Normal maps are a type of Bump Map. They are a special kind of
texture that allow you to add surface detail such as bumps, grooves,
and scratches to a model which catch the light as if they are
represented by real geometry.
29
Normal Map
30
Height Map
• Height mapping (also known as parallax mapping) is a similar concept
to normal mapping, however this technique is more complex - and
therefore also more performance-expensive.
31
Occlusion Map
• The occlusion map is used to provide information about which areas
of the model should receive high or low indirect lighting.
32
Emission
• Emission controls the color and intensity of light emitted from the
surface. When you use an emissive Material in your Scene, it appears
as a visible source of light. The GameObject appears to be self-
illuminated.
33
Thank You
34

More Related Content

What's hot

Physically Based Rendering
Physically Based RenderingPhysically Based Rendering
Physically Based Rendering
Koray Hagen
 
Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in Games
Colin Barré-Brisebois
 
Motion blur
Motion blurMotion blur
Motion blur
changehee lee
 
Real-time lightmap baking
Real-time lightmap bakingReal-time lightmap baking
Real-time lightmap baking
Rosario Leonardi
 
Cascades Demo Secrets
Cascades Demo SecretsCascades Demo Secrets
Cascades Demo Secrets
icastano
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
Naughty Dog
 
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal FilteringStable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Electronic Arts / DICE
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space Marine
Pope Kim
 
mssao presentation
mssao presentationmssao presentation
mssao presentation
ozlael ozlael
 
The Unique Lighting of Mirror's Edge
The Unique Lighting of Mirror's EdgeThe Unique Lighting of Mirror's Edge
The Unique Lighting of Mirror's Edge
Electronic Arts / DICE
 
Custom fabric shader for unreal engine 4
Custom fabric shader for unreal engine 4Custom fabric shader for unreal engine 4
Custom fabric shader for unreal engine 4
동석 김
 
Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3
stevemcauley
 
Choi JiHyun NDC2011
Choi JiHyun  NDC2011Choi JiHyun  NDC2011
Choi JiHyun NDC2011
지현 최
 
SPU Optimizations-part 1
SPU Optimizations-part 1SPU Optimizations-part 1
SPU Optimizations-part 1
Naughty Dog
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
Naughty Dog
 
Shaders in Unity
Shaders in UnityShaders in Unity
Shaders in Unity
Matias Lavik
 
[1023 박민수] 깊이_버퍼_그림자
[1023 박민수] 깊이_버퍼_그림자[1023 박민수] 깊이_버퍼_그림자
[1023 박민수] 깊이_버퍼_그림자
MoonLightMS
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
Tiago Sousa
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based Rendering
Electronic Arts / DICE
 
UE4 Lightmass for Large Console Games (UE4 Lightmass Deep Dive)
UE4 Lightmass for Large Console Games  (UE4 Lightmass Deep Dive)UE4 Lightmass for Large Console Games  (UE4 Lightmass Deep Dive)
UE4 Lightmass for Large Console Games (UE4 Lightmass Deep Dive)
エピック・ゲームズ・ジャパン Epic Games Japan
 

What's hot (20)

Physically Based Rendering
Physically Based RenderingPhysically Based Rendering
Physically Based Rendering
 
Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in Games
 
Motion blur
Motion blurMotion blur
Motion blur
 
Real-time lightmap baking
Real-time lightmap bakingReal-time lightmap baking
Real-time lightmap baking
 
Cascades Demo Secrets
Cascades Demo SecretsCascades Demo Secrets
Cascades Demo Secrets
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
 
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal FilteringStable SSAO in Battlefield 3 with Selective Temporal Filtering
Stable SSAO in Battlefield 3 with Selective Temporal Filtering
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space Marine
 
mssao presentation
mssao presentationmssao presentation
mssao presentation
 
The Unique Lighting of Mirror's Edge
The Unique Lighting of Mirror's EdgeThe Unique Lighting of Mirror's Edge
The Unique Lighting of Mirror's Edge
 
Custom fabric shader for unreal engine 4
Custom fabric shader for unreal engine 4Custom fabric shader for unreal engine 4
Custom fabric shader for unreal engine 4
 
Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3Calibrating Lighting and Materials in Far Cry 3
Calibrating Lighting and Materials in Far Cry 3
 
Choi JiHyun NDC2011
Choi JiHyun  NDC2011Choi JiHyun  NDC2011
Choi JiHyun NDC2011
 
SPU Optimizations-part 1
SPU Optimizations-part 1SPU Optimizations-part 1
SPU Optimizations-part 1
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
 
Shaders in Unity
Shaders in UnityShaders in Unity
Shaders in Unity
 
[1023 박민수] 깊이_버퍼_그림자
[1023 박민수] 깊이_버퍼_그림자[1023 박민수] 깊이_버퍼_그림자
[1023 박민수] 깊이_버퍼_그림자
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based Rendering
 
UE4 Lightmass for Large Console Games (UE4 Lightmass Deep Dive)
UE4 Lightmass for Large Console Games  (UE4 Lightmass Deep Dive)UE4 Lightmass for Large Console Games  (UE4 Lightmass Deep Dive)
UE4 Lightmass for Large Console Games (UE4 Lightmass Deep Dive)
 

Similar to Shaders & Standard Shader In Unity

3 D texturing
 3 D texturing 3 D texturing
3 D texturing
krishn verma
 
Les 2 game 3d - texturing & materials
Les 2   game 3d - texturing & materialsLes 2   game 3d - texturing & materials
Les 2 game 3d - texturing & materials
Francisco Peters
 
Deferred shading
Deferred shadingDeferred shading
Deferred shading
ozlael ozlael
 
Game development terminologies
Game development terminologiesGame development terminologies
Game development terminologies
Ahmed Badr
 
From Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGLFrom Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGL
FITC
 
TASK 2
TASK 2TASK 2
TASK 2
10metzm
 
[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline
William Hugo Yang
 
Clean architecture for shaders unite2019
Clean architecture for shaders unite2019Clean architecture for shaders unite2019
Clean architecture for shaders unite2019
Abhilash Majumder
 
Layar - 3D Content Creation Tips and Tricks
Layar - 3D Content Creation Tips and TricksLayar - 3D Content Creation Tips and Tricks
Layar - 3D Content Creation Tips and Tricks
Layar
 
Modeling and texturing in 3 ds max
Modeling and texturing in 3 ds maxModeling and texturing in 3 ds max
Modeling and texturing in 3 ds max
sribalaji0007
 
Modelo y textrurizado 3 ds max
Modelo y textrurizado 3 ds maxModelo y textrurizado 3 ds max
Modelo y textrurizado 3 ds max
LuchIn Avalos
 
WT in IP.ppt
WT in IP.pptWT in IP.ppt
WT in IP.ppt
viveksingh19210115
 
3D modeling and animation
3D modeling and animation3D modeling and animation
3D modeling and animation
Imran Javed Joura
 
OpenCV presentation series- part 4
OpenCV presentation series- part 4OpenCV presentation series- part 4
OpenCV presentation series- part 4
Sairam Adithya
 
digital image processing.pptx
digital image processing.pptxdigital image processing.pptx
digital image processing.pptx
nibiganesh
 
PPT s08-machine vision-s2
PPT s08-machine vision-s2PPT s08-machine vision-s2
PPT s08-machine vision-s2
Binus Online Learning
 
Cahall Final Intern Presentation
Cahall Final Intern PresentationCahall Final Intern Presentation
Cahall Final Intern Presentation
Daniel Cahall
 
Rendering basics
Rendering basicsRendering basics
Rendering basics
icedmaster
 
Authoring of procedural rocks in The Blacksmith realtime short
Authoring of procedural rocks in The Blacksmith realtime shortAuthoring of procedural rocks in The Blacksmith realtime short
Authoring of procedural rocks in The Blacksmith realtime short
Vesselin Efremov
 
Make your designers love (working with) you
Make your designers love (working with) youMake your designers love (working with) you
Make your designers love (working with) you
Vinay Shenoy
 

Similar to Shaders & Standard Shader In Unity (20)

3 D texturing
 3 D texturing 3 D texturing
3 D texturing
 
Les 2 game 3d - texturing & materials
Les 2   game 3d - texturing & materialsLes 2   game 3d - texturing & materials
Les 2 game 3d - texturing & materials
 
Deferred shading
Deferred shadingDeferred shading
Deferred shading
 
Game development terminologies
Game development terminologiesGame development terminologies
Game development terminologies
 
From Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGLFrom Experimentation to Production: The Future of WebGL
From Experimentation to Production: The Future of WebGL
 
TASK 2
TASK 2TASK 2
TASK 2
 
[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline
 
Clean architecture for shaders unite2019
Clean architecture for shaders unite2019Clean architecture for shaders unite2019
Clean architecture for shaders unite2019
 
Layar - 3D Content Creation Tips and Tricks
Layar - 3D Content Creation Tips and TricksLayar - 3D Content Creation Tips and Tricks
Layar - 3D Content Creation Tips and Tricks
 
Modeling and texturing in 3 ds max
Modeling and texturing in 3 ds maxModeling and texturing in 3 ds max
Modeling and texturing in 3 ds max
 
Modelo y textrurizado 3 ds max
Modelo y textrurizado 3 ds maxModelo y textrurizado 3 ds max
Modelo y textrurizado 3 ds max
 
WT in IP.ppt
WT in IP.pptWT in IP.ppt
WT in IP.ppt
 
3D modeling and animation
3D modeling and animation3D modeling and animation
3D modeling and animation
 
OpenCV presentation series- part 4
OpenCV presentation series- part 4OpenCV presentation series- part 4
OpenCV presentation series- part 4
 
digital image processing.pptx
digital image processing.pptxdigital image processing.pptx
digital image processing.pptx
 
PPT s08-machine vision-s2
PPT s08-machine vision-s2PPT s08-machine vision-s2
PPT s08-machine vision-s2
 
Cahall Final Intern Presentation
Cahall Final Intern PresentationCahall Final Intern Presentation
Cahall Final Intern Presentation
 
Rendering basics
Rendering basicsRendering basics
Rendering basics
 
Authoring of procedural rocks in The Blacksmith realtime short
Authoring of procedural rocks in The Blacksmith realtime shortAuthoring of procedural rocks in The Blacksmith realtime short
Authoring of procedural rocks in The Blacksmith realtime short
 
Make your designers love (working with) you
Make your designers love (working with) youMake your designers love (working with) you
Make your designers love (working with) you
 

Recently uploaded

BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 

Recently uploaded (20)

BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 

Shaders & Standard Shader In Unity

  • 2. Materials, Shaders & Textures • Rendering in Unity uses Materials, Shaders and Textures. All three have a close relationship. 2
  • 3. Materials • Materials define how a surface should be rendered, by including references to the Textures it uses, tiling information, Color tints and more. The available options for a Material depend on which Shader the Material is using. 3
  • 4. Textures • Textures are bitmap images. A Material can contain references to textures, so that the Material’s Shader can use the textures while calculating the surface color of a GameObject. In addition to basic Color (Albedo) of a GameObject’s surface, Textures can represent many other aspects of a Material’s surface such as its reflectivity or roughness. 4
  • 5. Shader • Small scripts that contain the mathematical calculations and algorithms for calculating the Color of each pixel rendered, based on the lighting input and the Material configuration. • A program specifically made to run on a GPU • Post processing 5
  • 6. 3D models • a collection of 3D coordinates called vertices • Triangles • Each vertices can contain few other information's color , direction • Models cannot be rendered without a material • Materials are wrappers which contain a shader and the values for its properties. • Hence, different materials can share the same shader 6
  • 8. Anatomy of a shaders • Unity has two different types of shaders • surface shaders • fragment and vertex shaders • fixed function shaders 8
  • 9. Anatomy of a shaders • multiple SubShader sections • actual instructions for the GPU • Unity execute in order until it finds one that is compatible with your graphics • different platforms 9
  • 10. The properties • equivalent to the public fields in a C# script • changes made to the properties of a material while the game is running in the editor are permanent. 10
  • 12. The surface VS Vertex and fragment • Whenever the material you want to simulate needs to be affected by lights in a realistic way, chances are you’ll need a surface shader • Surface shaders hide the calculations of how light is reflected and allows to specify “intuitive” properties such as the albedo, the normals, the reflectivity and so on in a function called surf. • Vertex and fragment shaders work close to the way the GPU renders triangles, and have no built-in concept of how light should behave. The geometry of your model is first passed through a function called vert which can alter its vertices. Then, individual triangles are passed through another function called frag which decides the final RGB colour for every pixel. They are useful for 2D effects, postprocessing and special 3D effects which are too complex to be expressed as surface shaders. 12
  • 13. Unity Standard Shader • built-in shader • “real-world” objects • wide range of shader types and combinations • enabled or disabled by simply using or not using • Incorporate PBS 13
  • 14. Physics Base Shading • Simulates the interactions between materials and light in a way that mimics reality. • Only recently become possible in real-time graphics • It works at its best in situations where lighting and materials need to exist together intuitively and realistically. • Advance lighting model 14
  • 15. Standard Shader • The Standard Shader is designed with hard surfaces in mind (also known as “architectural materials”), and can deal with most real- world materials like stone, glass, ceramics, brass, silver or rubber. It will even do a decent job with non-hard materials like skin, hair and cloth. • With the Standard Shader, a large range of shader types (such as Diffuse, Specular, Bumped Specular, Reflective) are combined into a single shader intended to be used across all material types. 15
  • 16. Rendered using the standard shader on all models 16
  • 18. Rendering Mode • Opaque • Cutout • Transparent • Fade 18
  • 19. Opaque • Opaque - Is the default, and suitable for normal solid objects with no transparent areas. 19
  • 20. Cutout • Cutout - Allows you to create a transparent effect that has hard edges between the opaque and transparent areas. In this mode, there are no semi-transparent areas, the texture is either 100% opaque, or invisible. This is useful when using transparency to create the shape of materials such as leaves, or cloth with holes and tatters. 20
  • 21. Transparent • Transparent - Suitable for rendering realistic transparent materials such as clear plastic or glass. 21
  • 22. Fade • Fade - Allows the transparency values to entirely fade an object out, including any specular highlights or reflections it may have. This mode is useful if you want to animate an object fading in or out. It is not suitable for rendering realistic transparent materials such as clear plastic or glass because the reflections and highlights will also be faded out. 22
  • 23. Albedo Color • The Albedo parameter controls the base color of the surface. • More common to assign a texture map for the Albedo parameter • Albedo texture should not contain any lighting 23
  • 24. Albedo Transparency • The alpha value of the Albedo colour controls the transparency level for the material. This only has an effect if the Rendering Mode for the material is set to one of the transparent mode, and not Opaque. 24
  • 25. Specular mode: Specular parameter • Standard (Specular setup): Choose this shader for the classic approach. A Specular color is used to control the color and strength of specular reflections in the material. 25
  • 26. Metallic mode: Metallic Parameter • When working in the Metallic workflow (as opposed to the Specular workflow), the the reflectivity and light response of the surface are modified by the Metallic level and the Smoothness level. 26
  • 28. Smoothness • The smoothness of the material is controlled by a slider. This slider allows you to control the “microsurface detail” or smoothness across a surface 28
  • 29. Normal Maps • Normal maps are a type of Bump Map. They are a special kind of texture that allow you to add surface detail such as bumps, grooves, and scratches to a model which catch the light as if they are represented by real geometry. 29
  • 31. Height Map • Height mapping (also known as parallax mapping) is a similar concept to normal mapping, however this technique is more complex - and therefore also more performance-expensive. 31
  • 32. Occlusion Map • The occlusion map is used to provide information about which areas of the model should receive high or low indirect lighting. 32
  • 33. Emission • Emission controls the color and intensity of light emitted from the surface. When you use an emissive Material in your Scene, it appears as a visible source of light. The GameObject appears to be self- illuminated. 33