SlideShare a Scribd company logo
1 of 25
Download to read offline
Custom Fabric Shader
for Unreal Engine 4
Gregory Dongseok Kim
2016-04-11
■ Two types of Fabric
⚬ Non-Metal: Cotton, denim, flax and common fabrics
⚬ Metal: Silk, satin, velvet, nylon and polyester
■ The Order approach
■ Limitations of Unreal Engine shader
■ My approach
⚬ Oren-nayar diffuse shading
⚬ Specular Term
⚬ Fiber Scatter Term
■ Result
Overview
2
Two types of Fabric: Non-Metal
■ Cotton, Denim, Flax and Common fabrics
⚬ Tiny furs on each fibers
⬝ Roughness value of those fabrics is always 1.0 unless they
wet
⬝ Reflect lights to random directions
⬝ It induces not only front scattering but also back scattering
Fuzz on rim part
⚬ Specular lobe is widely spread on view direction surface
⬝ Specular color is white but it is looked like desaturated color
of base one because of front scattering
3
Two types of Fabric: Metal (1)
■ Silk, Satin, Velvet, Nylon and Polyester
⚬ Silk has round triangular cross section and smooth surface
⬝ It induces simiral reflection with metal
⬝ Smooth surface: Reflects lights as perfect as metal surface
⬝ Triangular cross section: Reflects specific light wave
⚬ Silk can have Roughness value around 0.3 - 0.7
⬝ Thickness of each fibers is 5 - 10 μm
⬝ Thin to make smooth surface as metal
4
Two types of Fabric: Metal (2)
■ Special properties of Silk and Satin
⚬ They have much less fuzz on rim part then
cotton or common fabrics
⬝ Their intensive structure makes similar
specluar with metal’s one
⚬ They can have various specular colors
⬝ If they are woven by different colors
strings
⬝ Specular color can be changed by view
direction
⚬ They have anistropic specular shape
5
Two types of Fabric: Metal (3)
■ Special properties of Velvet
⚬ Tiny fibers are attached on the surface
⬝ Its Roughness value has to be 1.0
⬝ If the light is behind, those fibers give foward scattering
and it gives rim light effect on edge part
⚬ Diffuse shading is simiral with metal’s diffusion
⬝ Its surface color is darker than original color of fibers
6
The Order approach1
■ Custom microfiber model
⚬ Ashikhmin’s Distribution based BRDF for fresnel term
⚬ Inverse Gausian for specular term
⚬ No geometry term to improve rim light effect
⚬ Smoother specular than GGX
■ Future works
⚬ Ambient specular
⚬ Modify fresnel term to match with direct light
7
Goal of my approach
■ Shading model for every types of fabrics
⚬ From cotton to velvet
⚬ Easy to use for artists
■ Technical perspective
⚬ Oren-nayar diffusion
⚬ Specular term for fabrics
⚬ 2 colors specular
⚬ Fresnel term which is toward to light direction
8
Limitations of Unreal Engine shader
■ Hard to implement custom shading model
⚬ Diffuse shading: Lambert
⚬ No way to change specular model
■ Base Color slot can be only available slot to input custom shading code, but
⚬ The value is clamped as 0.0 - 1.0
⚬ Range of value is too narrow to use specular light
Fortunately, fabrics do not need strong specular, so its specular can be
implemented to Base Color
9
My approach - Diffuse term (1)
■ Oren-nayar diffuse shading
⚬ Based on Pope Kim’s approximation
⚬ It is not matched with real Oren-nayar shading, but its quality is great, cheap and easy to
implement
■ Removing (n∙l) from the original code
10
1
My approach - Diffuse term (2)
■ Replace (n∙l) to 1.0
■ Output value multiplys Base Color
■ If surface is smooth(Roughness = 0.0), than uses Unreal default diffuse
shading
11
My approach - Specular (1)
(Fresnel Term × Specular) + Fiber Scatter
■ Fresnel Term
⚬ Fuzz on rim part
■ Specular Term
⚬ Customized inverse gausian specular
⚬ For describing back scattering
⚬ Secondary specular lobe
■ Fiber Scatter Term
⚬ For describing front scattering
⚬ Primary specular lobe
12
My approach - Specular (2)
■ Fresnel term
⚬ Based on Schlick Fresnel approximation1
⬝
⚬ Modified 5th power of 1 - cosθd
to 4th power for increasing rim lighting effect
13
My approach - Specular (3)
■ Specular Term
⚬ Based on The Order’s approach
⬝ iverse gausian specular
⚬ Not related with Roughness value, but much simpler equation
⬝ Result is simiral with The Order’s approach when Roughness value is 1.0
⬝ I premise every non-metal fabrics’s roughness value is 1.0
If fabric surface has lower roughness than 1.0, using Unreal default specular term
Primary specular is implemented in Fiber scatter term
⚬ Masking fresnel term and it induces light direction toward rim lighting
14
My approach - Specular (3)
■ Roughness value
⚬ GGX: 0.65
⚬ The Order: 1.0
⚬ My approach: 1.0
15
My approach - Fiber Scatter Term (1)
■ Fiber Scatter Term
⚬ Wrap lighting for front scattering
⬝ Week transmission effect for the eye facing surface
⬝ Can be used as a secondary specular color for metal fabrics such as Silk or stain
⚬ Linear interpolation between two types of fresnel
⬝ First one is wider
⬝ Second one is narrwer
⬝ Blend them by fabric scatter amount value
Can describe from fuzzy cotton to smooth denim
⬝ Fabric scattering color is multiplied to this value
16
My approach - Fiber Scatter Term (2)
■ Wrap lighting
17
My approach - Fiber Scatter Term (3)
■ Linear interpolation between two types of fresnel
18
My approach - Final
19
Result - Fabric scatter amount compare
■ Define which part will use fabric scatter color
⚬ If the value is 0, than rim part will use fabric scatter color
⚬ If the value is getting increased, area of fabric scatter color is getting wider
⚬ If the value is 1.0, most of surface is fabric scatter color and rim part is base color
20
Result - Fabric examples (1)
21
Cotton
Velvet
Result - Fabric examples (2)
■ Hint to make good look fabric material with my approach
⚬ Set Metalic value for ratio of silk fibers in the fabric
⚬ Only Metal fabrics can have lower Roughness value than 1.0
⚬ Do not use Normal map to describe patterns on silk surface
⬝ Using different values of Roughness for pattern and non-pattern part
22
Satin
Recomend values for fabrics
23
Fabric Types Metalic Roughness Fabric Scatter amount
Cotton or ordinary
fabrics
0 1 0.5
Velvat 1 1 0
Silk, Satin 0.8 - 0.9 0.35 - 0.7 1
Bibliography
■ Page 3
⚬ image 1: http://www.apparelsearch.com/fibers.htm
⚬ image 2: http://www.trimfabric.com/nv-97.html
■ Page 4
⚬ image 1: https://www.asahi-kasei.co.jp/fibers/en/cupro/what/function1.html
⚬ image 2: https://quizlet.com/92490419/intro-2-textiles-test-1-flash-cards/
⚬ image 3: https://quizlet.com/92490419/intro-2-textiles-test-1-flash-cards/
■ Page 5
⚬ image 2: https://wallpaperscraft.com/download/silk_material_soft_light_50576/3840x2160
■ Page 6
⚬ image 1: http://www.bloomsburgcarpet.com/resources/weave-structures
⚬ image 2: http://www.textilestock.in/productdetail/47/Fabrics-HomeFurnishingFabrics-Velvet-Velvet-Stock.html
24
Bibliography
■ Page 7
⚬ citation 1: Neubelt, David, Matt Pettineo, and Ready At Dawn Studios. "Crafting a Next-Gen
Material Pipeline for The Order: 1886." part of “Physically Based Shading in Theory and
Practice,” SIGGRAPH (2013).
■ Page 10
⚬ citation 1: http://www.slideshare.net/blindrenderer/rendering-tech-of-space-marinekgc-2011
■ Page 13
⚬ citation 1: Schlick, Christophe. “An inexpensive BRDF Model for Physically-based Rendering.”
Computer graphics forum 1 Aug. 1994: 233-246
25

More Related Content

What's hot

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
 
Penner pre-integrated skin rendering (siggraph 2011 advances in real-time r...
Penner   pre-integrated skin rendering (siggraph 2011 advances in real-time r...Penner   pre-integrated skin rendering (siggraph 2011 advances in real-time r...
Penner pre-integrated skin rendering (siggraph 2011 advances in real-time r...
JP Lee
 
High Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in FrostbiteHigh Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in Frostbite
Electronic Arts / DICE
 
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
MinGeun Park
 

What's hot (20)

언차티드4 테크아트 파트1 톤맵핑&색보정
언차티드4 테크아트 파트1 톤맵핑&색보정언차티드4 테크아트 파트1 톤맵핑&색보정
언차티드4 테크아트 파트1 톤맵핑&색보정
 
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based Rendering
 
Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1Rendering AAA-Quality Characters of Project A1
Rendering AAA-Quality Characters of Project A1
 
Penner pre-integrated skin rendering (siggraph 2011 advances in real-time r...
Penner   pre-integrated skin rendering (siggraph 2011 advances in real-time r...Penner   pre-integrated skin rendering (siggraph 2011 advances in real-time r...
Penner pre-integrated skin rendering (siggraph 2011 advances in real-time r...
 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016
 
Practical usage of Lightmass in Architectural Visualization (Kenichi Makaya...
Practical usage of Lightmass in  Architectural Visualization  (Kenichi Makaya...Practical usage of Lightmass in  Architectural Visualization  (Kenichi Makaya...
Practical usage of Lightmass in Architectural Visualization (Kenichi Makaya...
 
[데브루키] Color space gamma correction
[데브루키] Color space gamma correction[데브루키] Color space gamma correction
[데브루키] Color space gamma correction
 
High Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in FrostbiteHigh Dynamic Range color grading and display in Frostbite
High Dynamic Range color grading and display in Frostbite
 
Rendering Tech of Space Marine
Rendering Tech of Space MarineRendering Tech of Space Marine
Rendering Tech of Space Marine
 
「原神」におけるコンソールプラットフォーム開発
「原神」におけるコンソールプラットフォーム開発「原神」におけるコンソールプラットフォーム開発
「原神」におけるコンソールプラットフォーム開発
 
Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The Surge
 
아티스트에게 사랑받는 3DS Max 우버쉐이더
아티스트에게 사랑받는 3DS Max 우버쉐이더아티스트에게 사랑받는 3DS Max 우버쉐이더
아티스트에게 사랑받는 3DS Max 우버쉐이더
 
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
The Rendering Technology of 'Lords of the Fallen' (Game Connection Europe 2014)
 
[IGC 2016] 넷게임즈 김영희 - Unreal4를 사용해 모바일 프로젝트 제작하기
[IGC 2016] 넷게임즈 김영희 - Unreal4를 사용해 모바일 프로젝트 제작하기[IGC 2016] 넷게임즈 김영희 - Unreal4를 사용해 모바일 프로젝트 제작하기
[IGC 2016] 넷게임즈 김영희 - Unreal4를 사용해 모바일 프로젝트 제작하기
 
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)
 
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
스크린 스페이스 데칼에 대해 자세히 알아보자(워햄머 40,000: 스페이스 마린)
 
Triangle Visibility buffer
Triangle Visibility bufferTriangle Visibility buffer
Triangle Visibility buffer
 

Viewers also liked

김병관 성공캠프 SNS팀 자원봉사 후기
김병관 성공캠프 SNS팀 자원봉사 후기김병관 성공캠프 SNS팀 자원봉사 후기
김병관 성공캠프 SNS팀 자원봉사 후기
Harns (Nak-Hyoung) Kim
 
자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012
자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012
자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012
Esun Kim
 

Viewers also liked (20)

[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기
[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기
[야생의 땅: 듀랑고] 지형 관리 완전 자동화 - 생생한 AWS와 Docker 체험기
 
Behavior Tree in Unreal engine 4
Behavior Tree in Unreal engine 4Behavior Tree in Unreal engine 4
Behavior Tree in Unreal engine 4
 
Re:Zero부터 시작하지 않는 오픈소스 개발
Re:Zero부터 시작하지 않는 오픈소스 개발Re:Zero부터 시작하지 않는 오픈소스 개발
Re:Zero부터 시작하지 않는 오픈소스 개발
 
Developing Success in Mobile with Unreal Engine 4 | David Stelzer
Developing Success in Mobile with Unreal Engine 4 | David StelzerDeveloping Success in Mobile with Unreal Engine 4 | David Stelzer
Developing Success in Mobile with Unreal Engine 4 | David Stelzer
 
PyCon 2017 프로그래머가 이사하는 법 2 [천원경매]
PyCon 2017 프로그래머가 이사하는 법 2 [천원경매]PyCon 2017 프로그래머가 이사하는 법 2 [천원경매]
PyCon 2017 프로그래머가 이사하는 법 2 [천원경매]
 
NDC16 스매싱더배틀 1년간의 개발일지
NDC16 스매싱더배틀 1년간의 개발일지NDC16 스매싱더배틀 1년간의 개발일지
NDC16 스매싱더배틀 1년간의 개발일지
 
레퍼런스만 알면 언리얼 엔진이 제대로 보인다
레퍼런스만 알면 언리얼 엔진이 제대로 보인다레퍼런스만 알면 언리얼 엔진이 제대로 보인다
레퍼런스만 알면 언리얼 엔진이 제대로 보인다
 
Online game server on Akka.NET (NDC2016)
Online game server on Akka.NET (NDC2016)Online game server on Akka.NET (NDC2016)
Online game server on Akka.NET (NDC2016)
 
NDC17 게임 디자이너 커리어 포스트모템: 8년, 3개의 회사, 4개의 게임
NDC17 게임 디자이너 커리어 포스트모템: 8년, 3개의 회사, 4개의 게임NDC17 게임 디자이너 커리어 포스트모템: 8년, 3개의 회사, 4개의 게임
NDC17 게임 디자이너 커리어 포스트모템: 8년, 3개의 회사, 4개의 게임
 
Docker
DockerDocker
Docker
 
8년동안 테라에서 배운 8가지 교훈
8년동안 테라에서 배운 8가지 교훈8년동안 테라에서 배운 8가지 교훈
8년동안 테라에서 배운 8가지 교훈
 
김병관 성공캠프 SNS팀 자원봉사 후기
김병관 성공캠프 SNS팀 자원봉사 후기김병관 성공캠프 SNS팀 자원봉사 후기
김병관 성공캠프 SNS팀 자원봉사 후기
 
Deep learning as_WaveExtractor
Deep learning as_WaveExtractorDeep learning as_WaveExtractor
Deep learning as_WaveExtractor
 
Luigi presentation NYC Data Science
Luigi presentation NYC Data ScienceLuigi presentation NYC Data Science
Luigi presentation NYC Data Science
 
게임회사 취업을 위한 현실적인 전략 3가지
게임회사 취업을 위한 현실적인 전략 3가지게임회사 취업을 위한 현실적인 전략 3가지
게임회사 취업을 위한 현실적인 전략 3가지
 
Profiling - 실시간 대화식 프로파일러
Profiling - 실시간 대화식 프로파일러Profiling - 실시간 대화식 프로파일러
Profiling - 실시간 대화식 프로파일러
 
Approximate nearest neighbor methods and vector models – NYC ML meetup
Approximate nearest neighbor methods and vector models – NYC ML meetupApproximate nearest neighbor methods and vector models – NYC ML meetup
Approximate nearest neighbor methods and vector models – NYC ML meetup
 
자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012
자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012
자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012
 
영상 데이터의 처리와 정보의 추출
영상 데이터의 처리와 정보의 추출영상 데이터의 처리와 정보의 추출
영상 데이터의 처리와 정보의 추출
 
버텍스 셰이더로 하는 머리카락 애니메이션
버텍스 셰이더로 하는 머리카락 애니메이션버텍스 셰이더로 하는 머리카락 애니메이션
버텍스 셰이더로 하는 머리카락 애니메이션
 

Similar to Custom fabric shader for unreal engine 4

Tihomir Dovramadjiev PhD. Blender Tutorial. Various 3D Objects. Mirror Reflec...
Tihomir Dovramadjiev PhD. Blender Tutorial. Various 3D Objects. Mirror Reflec...Tihomir Dovramadjiev PhD. Blender Tutorial. Various 3D Objects. Mirror Reflec...
Tihomir Dovramadjiev PhD. Blender Tutorial. Various 3D Objects. Mirror Reflec...
FIDE Master Tihomir Dovramadjiev PhD
 
Lasers basics mechanism and principles
Lasers basics mechanism and principlesLasers basics mechanism and principles
Lasers basics mechanism and principles
Chaitanya Areti
 

Similar to Custom fabric shader for unreal engine 4 (7)

A general lens design method, with a photographic lens example
A general lens design method, with a photographic lens exampleA general lens design method, with a photographic lens example
A general lens design method, with a photographic lens example
 
Tihomir Dovramadjiev PhD. Blender Tutorial. Various 3D Objects. Mirror Reflec...
Tihomir Dovramadjiev PhD. Blender Tutorial. Various 3D Objects. Mirror Reflec...Tihomir Dovramadjiev PhD. Blender Tutorial. Various 3D Objects. Mirror Reflec...
Tihomir Dovramadjiev PhD. Blender Tutorial. Various 3D Objects. Mirror Reflec...
 
Shaders & Standard Shader In Unity
Shaders & Standard Shader In UnityShaders & Standard Shader In Unity
Shaders & Standard Shader In Unity
 
Portable Glossmeter Full Technical details and working Principle.
Portable Glossmeter Full Technical details and working Principle.Portable Glossmeter Full Technical details and working Principle.
Portable Glossmeter Full Technical details and working Principle.
 
3 D texturing
 3 D texturing 3 D texturing
3 D texturing
 
Ep notes
Ep notesEp notes
Ep notes
 
Lasers basics mechanism and principles
Lasers basics mechanism and principlesLasers basics mechanism and principles
Lasers basics mechanism and principles
 

Recently uploaded

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 

Custom fabric shader for unreal engine 4

  • 1. Custom Fabric Shader for Unreal Engine 4 Gregory Dongseok Kim 2016-04-11
  • 2. ■ Two types of Fabric ⚬ Non-Metal: Cotton, denim, flax and common fabrics ⚬ Metal: Silk, satin, velvet, nylon and polyester ■ The Order approach ■ Limitations of Unreal Engine shader ■ My approach ⚬ Oren-nayar diffuse shading ⚬ Specular Term ⚬ Fiber Scatter Term ■ Result Overview 2
  • 3. Two types of Fabric: Non-Metal ■ Cotton, Denim, Flax and Common fabrics ⚬ Tiny furs on each fibers ⬝ Roughness value of those fabrics is always 1.0 unless they wet ⬝ Reflect lights to random directions ⬝ It induces not only front scattering but also back scattering Fuzz on rim part ⚬ Specular lobe is widely spread on view direction surface ⬝ Specular color is white but it is looked like desaturated color of base one because of front scattering 3
  • 4. Two types of Fabric: Metal (1) ■ Silk, Satin, Velvet, Nylon and Polyester ⚬ Silk has round triangular cross section and smooth surface ⬝ It induces simiral reflection with metal ⬝ Smooth surface: Reflects lights as perfect as metal surface ⬝ Triangular cross section: Reflects specific light wave ⚬ Silk can have Roughness value around 0.3 - 0.7 ⬝ Thickness of each fibers is 5 - 10 μm ⬝ Thin to make smooth surface as metal 4
  • 5. Two types of Fabric: Metal (2) ■ Special properties of Silk and Satin ⚬ They have much less fuzz on rim part then cotton or common fabrics ⬝ Their intensive structure makes similar specluar with metal’s one ⚬ They can have various specular colors ⬝ If they are woven by different colors strings ⬝ Specular color can be changed by view direction ⚬ They have anistropic specular shape 5
  • 6. Two types of Fabric: Metal (3) ■ Special properties of Velvet ⚬ Tiny fibers are attached on the surface ⬝ Its Roughness value has to be 1.0 ⬝ If the light is behind, those fibers give foward scattering and it gives rim light effect on edge part ⚬ Diffuse shading is simiral with metal’s diffusion ⬝ Its surface color is darker than original color of fibers 6
  • 7. The Order approach1 ■ Custom microfiber model ⚬ Ashikhmin’s Distribution based BRDF for fresnel term ⚬ Inverse Gausian for specular term ⚬ No geometry term to improve rim light effect ⚬ Smoother specular than GGX ■ Future works ⚬ Ambient specular ⚬ Modify fresnel term to match with direct light 7
  • 8. Goal of my approach ■ Shading model for every types of fabrics ⚬ From cotton to velvet ⚬ Easy to use for artists ■ Technical perspective ⚬ Oren-nayar diffusion ⚬ Specular term for fabrics ⚬ 2 colors specular ⚬ Fresnel term which is toward to light direction 8
  • 9. Limitations of Unreal Engine shader ■ Hard to implement custom shading model ⚬ Diffuse shading: Lambert ⚬ No way to change specular model ■ Base Color slot can be only available slot to input custom shading code, but ⚬ The value is clamped as 0.0 - 1.0 ⚬ Range of value is too narrow to use specular light Fortunately, fabrics do not need strong specular, so its specular can be implemented to Base Color 9
  • 10. My approach - Diffuse term (1) ■ Oren-nayar diffuse shading ⚬ Based on Pope Kim’s approximation ⚬ It is not matched with real Oren-nayar shading, but its quality is great, cheap and easy to implement ■ Removing (n∙l) from the original code 10 1
  • 11. My approach - Diffuse term (2) ■ Replace (n∙l) to 1.0 ■ Output value multiplys Base Color ■ If surface is smooth(Roughness = 0.0), than uses Unreal default diffuse shading 11
  • 12. My approach - Specular (1) (Fresnel Term × Specular) + Fiber Scatter ■ Fresnel Term ⚬ Fuzz on rim part ■ Specular Term ⚬ Customized inverse gausian specular ⚬ For describing back scattering ⚬ Secondary specular lobe ■ Fiber Scatter Term ⚬ For describing front scattering ⚬ Primary specular lobe 12
  • 13. My approach - Specular (2) ■ Fresnel term ⚬ Based on Schlick Fresnel approximation1 ⬝ ⚬ Modified 5th power of 1 - cosθd to 4th power for increasing rim lighting effect 13
  • 14. My approach - Specular (3) ■ Specular Term ⚬ Based on The Order’s approach ⬝ iverse gausian specular ⚬ Not related with Roughness value, but much simpler equation ⬝ Result is simiral with The Order’s approach when Roughness value is 1.0 ⬝ I premise every non-metal fabrics’s roughness value is 1.0 If fabric surface has lower roughness than 1.0, using Unreal default specular term Primary specular is implemented in Fiber scatter term ⚬ Masking fresnel term and it induces light direction toward rim lighting 14
  • 15. My approach - Specular (3) ■ Roughness value ⚬ GGX: 0.65 ⚬ The Order: 1.0 ⚬ My approach: 1.0 15
  • 16. My approach - Fiber Scatter Term (1) ■ Fiber Scatter Term ⚬ Wrap lighting for front scattering ⬝ Week transmission effect for the eye facing surface ⬝ Can be used as a secondary specular color for metal fabrics such as Silk or stain ⚬ Linear interpolation between two types of fresnel ⬝ First one is wider ⬝ Second one is narrwer ⬝ Blend them by fabric scatter amount value Can describe from fuzzy cotton to smooth denim ⬝ Fabric scattering color is multiplied to this value 16
  • 17. My approach - Fiber Scatter Term (2) ■ Wrap lighting 17
  • 18. My approach - Fiber Scatter Term (3) ■ Linear interpolation between two types of fresnel 18
  • 19. My approach - Final 19
  • 20. Result - Fabric scatter amount compare ■ Define which part will use fabric scatter color ⚬ If the value is 0, than rim part will use fabric scatter color ⚬ If the value is getting increased, area of fabric scatter color is getting wider ⚬ If the value is 1.0, most of surface is fabric scatter color and rim part is base color 20
  • 21. Result - Fabric examples (1) 21 Cotton Velvet
  • 22. Result - Fabric examples (2) ■ Hint to make good look fabric material with my approach ⚬ Set Metalic value for ratio of silk fibers in the fabric ⚬ Only Metal fabrics can have lower Roughness value than 1.0 ⚬ Do not use Normal map to describe patterns on silk surface ⬝ Using different values of Roughness for pattern and non-pattern part 22 Satin
  • 23. Recomend values for fabrics 23 Fabric Types Metalic Roughness Fabric Scatter amount Cotton or ordinary fabrics 0 1 0.5 Velvat 1 1 0 Silk, Satin 0.8 - 0.9 0.35 - 0.7 1
  • 24. Bibliography ■ Page 3 ⚬ image 1: http://www.apparelsearch.com/fibers.htm ⚬ image 2: http://www.trimfabric.com/nv-97.html ■ Page 4 ⚬ image 1: https://www.asahi-kasei.co.jp/fibers/en/cupro/what/function1.html ⚬ image 2: https://quizlet.com/92490419/intro-2-textiles-test-1-flash-cards/ ⚬ image 3: https://quizlet.com/92490419/intro-2-textiles-test-1-flash-cards/ ■ Page 5 ⚬ image 2: https://wallpaperscraft.com/download/silk_material_soft_light_50576/3840x2160 ■ Page 6 ⚬ image 1: http://www.bloomsburgcarpet.com/resources/weave-structures ⚬ image 2: http://www.textilestock.in/productdetail/47/Fabrics-HomeFurnishingFabrics-Velvet-Velvet-Stock.html 24
  • 25. Bibliography ■ Page 7 ⚬ citation 1: Neubelt, David, Matt Pettineo, and Ready At Dawn Studios. "Crafting a Next-Gen Material Pipeline for The Order: 1886." part of “Physically Based Shading in Theory and Practice,” SIGGRAPH (2013). ■ Page 10 ⚬ citation 1: http://www.slideshare.net/blindrenderer/rendering-tech-of-space-marinekgc-2011 ■ Page 13 ⚬ citation 1: Schlick, Christophe. “An inexpensive BRDF Model for Physically-based Rendering.” Computer graphics forum 1 Aug. 1994: 233-246 25