SlideShare uma empresa Scribd logo
1 de 10
Введение в шейдера
GPU outside



Вершины, треугольники, нормали, текстуры,                 Картинка
                                                 GPU      на экране
                   etc
GPU inside
Типичный шейдер
Shader "MyShader" {
  Properties {
    _MyTexture ("My Texture", 2D) = "white" { }
  }
  SubShader {//first shader
  }
  SubShader { //if first doesn’t work, try next
  }
  FallBack "Diffuse” //if nothing works, use this
}
Типы шейдеров
 Fixed function shaders: ShaderLab – простой, но
   ограниченный путь

 Surface shaders: CG/HLSL –
   шейдера, использующие свойства света

 Vertex, fragment shaders: CG/HLSL – все остальные
   шейдера
Круги нарисованы,
рисуем остальную сову
   (surface shaders)
Output data
 Albedo – цвет(half3)

 Alpha – непрозрачность(half)

 Emission – излучение света(half3)

 Normal – нормаль (half3)

 Specular – зеркальное отражение (half)

 Gloss – блеск (half)
Алгоритм написания
          шейдеров
1. Находим шейдер, который подходит больше всего

2. Шейдер удовлетворяет – return.

3. Понимаем, каких свойств не хватает шейдеру

4. Допиливаем шейдер
Ссылки
http://docs.unity3d.com/Documentation/Components/S
L-Reference.html

http://http.developer.nvidia.com/CgTutorial/cg_tutorial_
chapter01.html

http://cgcookie.com/unity/2012/10/20/unity-surface-
shader-introduction-part-1/
Спасибо за внимание.
     Вопросы?

Mais conteúdo relacionado

Destaque

How's the Perl Job Market - YAPCEU2016
How's the Perl Job Market - YAPCEU2016How's the Perl Job Market - YAPCEU2016
How's the Perl Job Market - YAPCEU2016Rick Deller
 
2 - Recruitment in Perl The State of the Perl Market - YAPC Final 2
2 - Recruitment in Perl  The State of the Perl Market - YAPC Final 22 - Recruitment in Perl  The State of the Perl Market - YAPC Final 2
2 - Recruitment in Perl The State of the Perl Market - YAPC Final 2Rick Deller
 
Introduction to Google's Go programming language
Introduction to Google's Go programming languageIntroduction to Google's Go programming language
Introduction to Google's Go programming languageMario Castro Contreras
 
Object oriented programming in go
Object oriented programming in goObject oriented programming in go
Object oriented programming in goJaehue Jang
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go ProgrammingLin Yo-An
 
Using the Internet and Social Media in Your Job Search
Using the Internet and Social Media in Your Job SearchUsing the Internet and Social Media in Your Job Search
Using the Internet and Social Media in Your Job SearchClearedJobs.Net
 
Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1Lin Yo-An
 
CV Writing by Tai Tran
CV Writing by Tai TranCV Writing by Tai Tran
CV Writing by Tai TranTai Tran
 
Finding a Job in the IT Industry
Finding a Job in the IT IndustryFinding a Job in the IT Industry
Finding a Job in the IT IndustrySvetlin Nakov
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid themSteven Francia
 
Основы программирования на C++
Основы программирования на C++Основы программирования на C++
Основы программирования на C++Olga Maksimenkova
 
Finding a Job in the IT Industry Seminar - Opening
Finding a Job in the IT Industry Seminar - OpeningFinding a Job in the IT Industry Seminar - Opening
Finding a Job in the IT Industry Seminar - OpeningSvetlin Nakov
 
How to Pass an Interview for Software Engineer / IT Specialist?
How to Pass an Interview for Software Engineer / IT Specialist?How to Pass an Interview for Software Engineer / IT Specialist?
How to Pass an Interview for Software Engineer / IT Specialist?Svetlin Nakov
 
7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)Steven Francia
 
How to Build Your First Web App in Go
How to Build Your First Web App in GoHow to Build Your First Web App in Go
How to Build Your First Web App in GoAll Things Open
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with GoSteven Francia
 
How to Use Cryptography Properly: Common Mistakes People Make When Using Cry...
How to Use Cryptography Properly:  Common Mistakes People Make When Using Cry...How to Use Cryptography Properly:  Common Mistakes People Make When Using Cry...
How to Use Cryptography Properly: Common Mistakes People Make When Using Cry...All Things Open
 
AddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingAddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingSamuel Lampa
 
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Steven Francia
 

Destaque (20)

How's the Perl Job Market - YAPCEU2016
How's the Perl Job Market - YAPCEU2016How's the Perl Job Market - YAPCEU2016
How's the Perl Job Market - YAPCEU2016
 
2 - Recruitment in Perl The State of the Perl Market - YAPC Final 2
2 - Recruitment in Perl  The State of the Perl Market - YAPC Final 22 - Recruitment in Perl  The State of the Perl Market - YAPC Final 2
2 - Recruitment in Perl The State of the Perl Market - YAPC Final 2
 
Introduction to Google's Go programming language
Introduction to Google's Go programming languageIntroduction to Google's Go programming language
Introduction to Google's Go programming language
 
Object oriented programming in go
Object oriented programming in goObject oriented programming in go
Object oriented programming in go
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go Programming
 
Using the Internet and Social Media in Your Job Search
Using the Internet and Social Media in Your Job SearchUsing the Internet and Social Media in Your Job Search
Using the Internet and Social Media in Your Job Search
 
My way-to-perl
My way-to-perlMy way-to-perl
My way-to-perl
 
Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1
 
CV Writing by Tai Tran
CV Writing by Tai TranCV Writing by Tai Tran
CV Writing by Tai Tran
 
Finding a Job in the IT Industry
Finding a Job in the IT IndustryFinding a Job in the IT Industry
Finding a Job in the IT Industry
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them
 
Основы программирования на C++
Основы программирования на C++Основы программирования на C++
Основы программирования на C++
 
Finding a Job in the IT Industry Seminar - Opening
Finding a Job in the IT Industry Seminar - OpeningFinding a Job in the IT Industry Seminar - Opening
Finding a Job in the IT Industry Seminar - Opening
 
How to Pass an Interview for Software Engineer / IT Specialist?
How to Pass an Interview for Software Engineer / IT Specialist?How to Pass an Interview for Software Engineer / IT Specialist?
How to Pass an Interview for Software Engineer / IT Specialist?
 
7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)
 
How to Build Your First Web App in Go
How to Build Your First Web App in GoHow to Build Your First Web App in Go
How to Build Your First Web App in Go
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with Go
 
How to Use Cryptography Properly: Common Mistakes People Make When Using Cry...
How to Use Cryptography Properly:  Common Mistakes People Make When Using Cry...How to Use Cryptography Properly:  Common Mistakes People Make When Using Cry...
How to Use Cryptography Properly: Common Mistakes People Make When Using Cry...
 
AddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingAddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based Programming
 
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
 

Shaders