SlideShare a Scribd company logo
1 of 18
Download to read offline
SHADERX5



           shader study http://cafe.naver.com/shader.cafe
                    ohyecloudy http://ohyecloudy.com

                                               2010.03.22
Supersamping?, Multisampling?
Drawbacks
Overcoming drawbacks
Implement supersamping
Implement selective supersampling
Conclusion
2x2 supersampling




• 모든 픽셀에 대해 여러 픽셀 샘플링
• 퀄리티
• 퍼포먼스
2x multisampling




• polygon edge만 여러 픽셀 샘플링
 – surface 안 쪽은 하지 않는다.
• 퍼포먼스
Supersamping?, Multisampling?
Drawbacks
Overcoming drawbacks
Implement supersamping
Implement selective supersampling
Conclusion
No selective-supersampling   selective-supersampling


• high-frequency component가 문제
  – specular highlight가 어른거리게 만든다
  – 밉맵mip-map을 사용하는 이유와 같다.
Supersamping?, Multisampling?
Drawbacks
Overcoming drawbacks
Implement supersamping
Implement selective supersampling
Conclusion
multisampling




                             supersampling




• hybrid solution
  – edge : multisampling
  – aliasing 문제가 있는 부분 : supersampling
Supersamping?, Multisampling?
Drawbacks
Overcoming drawbacks
Implement supersamping
Implement selective supersampling
Conclusion
float4 vfSum = 0.0;
for (int i = 0; i < SAMPLE_COUNT; i++)
{
  vfSum += OriginalShader(sampleCoordinate[i]);
}
return vfSum / SAMPLE_COUNT;


                    좀 더 정확하게 근사하자.
                    ddx와 ddy를 사용
A

                                                                               ddx

                                                                        ddy
                texture

                                        projection
                                                        OR               A’s ddx != B’s ddx
                                                                         A’s ddy != B’s ddy

                                                                               B
                                                                                   ddx

ddx
                                                                         ddy
Returns the partial derivative of the specified value with respect to
the screen-space x-coordinate.

ddy
Returns the partial derivative of the specified value with respect to
the screen-space y-coordinate.
const float2 fSamples[SAMPLE_COUNT] =
{
   // using a rotated grid
   float2( 0.125, 0.375),
   float2( 0.375, -0.125),
   float2(-0.125, -0.375),
   float2(-0.375, 0.125),
};

// compute gradients
float2 fDX = ddx(texCoord);
float2 fDY = ddy(texCoord);

float4 vfSum = 0.0;
for (int i = 0; i < SAMPLE_COUNT; ++i)
{
   float2 vfSampleCoord =
        texCoord + fSamples[i].x * fDX + fSamples[i].y * fDY;
   vfSum += OriginalShader(vfSampleCoord);
}

return vfSum / SAMPLE_COUNT;
Supersamping?, Multisampling?
Drawbacks
Overcoming drawbacks
Implement supersamping
Implement selective supersampling
Conclusion
float4 main(
   float2 texCoord : TEXCOORD0,
   float3 vnLight : TEXCOORD1) : COLOR
{
   // compute the gradients of the texture coordinates
   float2 fDX = ddx(texCoord);
   float2 fDY = ddy(texCoord);

    // Compute lighting
                                                                라이팅은 그냥 수행
    float3 vBase = tex2D(tBase, texCoord).rgb;
    float3 vBump = tex2D(tBump, texCoord).xyz;
    float3 vNormal = normalize(vBump*2.0 – 1.0); // [0,1] -> [-1,1]
    float3 cAmbient = 0.15 * vBase;
    float fDiffuse = saturate(dot(vLight, vNormal));

    float fSpecular =                   specular만 selective supersampling
         (SPECULAR(vNormal) +
         SPECULAR(SAMPLENORMAL( 0.25, 0.75)) +
         SPECULAR(SAMPLENORMAL(-0.25,-0.75)) +
         SPECULAR(SAMPLENORMAL(-0.75, 0.25)) +
         SPECULAR(SAMPLENORMAL( 0.75,-0.25))) / 5.0;

    return float4(cAmbient + fDiffuse * vBase + fSpecular, 0);
}

    #define SAMPLENORMAL(x, y) 
    normalize(tex2D(tBump, texCoord + (0.5*x) * fDX + (0.5*y) * fDY).xyz * 2.0 – 1.0)
// Center sample
float fSpecular = SPECULAR(vNormal);

// Compute specular gradients
float2 ds = float2(ddx(fSpecular), ddy(fSpecular));

// If it’s above the threshold, then take the other four samples too
if (dot(ds, ds) > 0.0002)
{
   fSpecular += SPECULAR(SAMPLENORMAL( 0.25, 0.75));
   fSpecular += SPECULAR(SAMPLENORMAL(-0.25,-0.75));
   fSpecular += SPECULAR(SAMPLENORMAL(-0.75, 0.25));
   fSpecular += SPECULAR(SAMPLENORMAL( 0.75,-0.25));
   fSpecular /= 5.0;
}


                         dynamic branch
                         threshold를 둬서 넘으면 supersampling
Supersamping?, Multisampling?
Drawbacks
Overcoming drawbacks
Implement supersamping
Implement selective supersampling
Conclusion
• 성능을 위해 multisampling을 쓰는 경우
  internal aliasing 문제가 발생할 수 있다.

• 발생하는 부분만 supersampling을 사용해서
  문제를 해결할 수 있다.
  – 전체 supersampling보다는 퍼포먼스
[shaderx5] 3.2 Selective Supersampling

More Related Content

What's hot

Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesMatthew Leingang
 
Lesson 8: Basic Differentation Rules (slides)
Lesson 8: Basic Differentation Rules (slides)Lesson 8: Basic Differentation Rules (slides)
Lesson 8: Basic Differentation Rules (slides)Matthew Leingang
 
Derivatives Lesson Oct 14
Derivatives Lesson  Oct 14Derivatives Lesson  Oct 14
Derivatives Lesson Oct 14ingroy
 
[shaderx4] 4.2 Eliminating Surface Acne with Gradient Shadow Mapping
[shaderx4] 4.2 Eliminating Surface Acne with Gradient Shadow Mapping[shaderx4] 4.2 Eliminating Surface Acne with Gradient Shadow Mapping
[shaderx4] 4.2 Eliminating Surface Acne with Gradient Shadow Mapping종빈 오
 
Lesson 25: Evaluating Definite Integrals (slides)
Lesson 25: Evaluating Definite Integrals (slides)Lesson 25: Evaluating Definite Integrals (slides)
Lesson 25: Evaluating Definite Integrals (slides)Matthew Leingang
 
Lesson 27: Evaluating Definite Integrals
Lesson 27: Evaluating Definite IntegralsLesson 27: Evaluating Definite Integrals
Lesson 27: Evaluating Definite IntegralsMatthew Leingang
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesMatthew Leingang
 
Lesson 28: The Fundamental Theorem of Calculus
Lesson 28: The Fundamental Theorem of CalculusLesson 28: The Fundamental Theorem of Calculus
Lesson 28: The Fundamental Theorem of CalculusMatthew Leingang
 
Cea0001 ppt project
Cea0001 ppt projectCea0001 ppt project
Cea0001 ppt projectcea0001
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesMatthew Leingang
 
Lesson 18: Maximum and Minimum Values (slides)
Lesson 18: Maximum and Minimum Values (slides)Lesson 18: Maximum and Minimum Values (slides)
Lesson 18: Maximum and Minimum Values (slides)Matthew Leingang
 
Approximate Integration
Approximate IntegrationApproximate Integration
Approximate IntegrationSilvius
 
Coq setoid 20110129
Coq setoid 20110129Coq setoid 20110129
Coq setoid 20110129tmiya
 
Lesson 26: The Fundamental Theorem of Calculus (Section 4 version)
Lesson 26: The Fundamental Theorem of Calculus (Section 4 version)Lesson 26: The Fundamental Theorem of Calculus (Section 4 version)
Lesson 26: The Fundamental Theorem of Calculus (Section 4 version)Matthew Leingang
 
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Matthew Leingang
 
Lesson 8: Basic Differentiation Rules (Section 41 slides)
Lesson 8: Basic Differentiation Rules (Section 41 slides)Lesson 8: Basic Differentiation Rules (Section 41 slides)
Lesson 8: Basic Differentiation Rules (Section 41 slides)Matthew Leingang
 

What's hot (20)

Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation Rules
 
Lesson 8: Basic Differentation Rules (slides)
Lesson 8: Basic Differentation Rules (slides)Lesson 8: Basic Differentation Rules (slides)
Lesson 8: Basic Differentation Rules (slides)
 
Derivatives Lesson Oct 14
Derivatives Lesson  Oct 14Derivatives Lesson  Oct 14
Derivatives Lesson Oct 14
 
[shaderx4] 4.2 Eliminating Surface Acne with Gradient Shadow Mapping
[shaderx4] 4.2 Eliminating Surface Acne with Gradient Shadow Mapping[shaderx4] 4.2 Eliminating Surface Acne with Gradient Shadow Mapping
[shaderx4] 4.2 Eliminating Surface Acne with Gradient Shadow Mapping
 
Lesson 25: Evaluating Definite Integrals (slides)
Lesson 25: Evaluating Definite Integrals (slides)Lesson 25: Evaluating Definite Integrals (slides)
Lesson 25: Evaluating Definite Integrals (slides)
 
Lesson 27: Evaluating Definite Integrals
Lesson 27: Evaluating Definite IntegralsLesson 27: Evaluating Definite Integrals
Lesson 27: Evaluating Definite Integrals
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation Rules
 
Lesson 28: The Fundamental Theorem of Calculus
Lesson 28: The Fundamental Theorem of CalculusLesson 28: The Fundamental Theorem of Calculus
Lesson 28: The Fundamental Theorem of Calculus
 
Cea0001 ppt project
Cea0001 ppt projectCea0001 ppt project
Cea0001 ppt project
 
Lesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation RulesLesson 8: Basic Differentiation Rules
Lesson 8: Basic Differentiation Rules
 
Lec 3-mcgregor
Lec 3-mcgregorLec 3-mcgregor
Lec 3-mcgregor
 
Lesson 18: Maximum and Minimum Values (slides)
Lesson 18: Maximum and Minimum Values (slides)Lesson 18: Maximum and Minimum Values (slides)
Lesson 18: Maximum and Minimum Values (slides)
 
Approximate Integration
Approximate IntegrationApproximate Integration
Approximate Integration
 
Integration. area undera curve
Integration. area undera curveIntegration. area undera curve
Integration. area undera curve
 
Wikiproject
WikiprojectWikiproject
Wikiproject
 
Coq setoid 20110129
Coq setoid 20110129Coq setoid 20110129
Coq setoid 20110129
 
Lesson 26: The Fundamental Theorem of Calculus (Section 4 version)
Lesson 26: The Fundamental Theorem of Calculus (Section 4 version)Lesson 26: The Fundamental Theorem of Calculus (Section 4 version)
Lesson 26: The Fundamental Theorem of Calculus (Section 4 version)
 
Rolle's Theorem
Rolle's TheoremRolle's Theorem
Rolle's Theorem
 
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)
 
Lesson 8: Basic Differentiation Rules (Section 41 slides)
Lesson 8: Basic Differentiation Rules (Section 41 slides)Lesson 8: Basic Differentiation Rules (Section 41 slides)
Lesson 8: Basic Differentiation Rules (Section 41 slides)
 

Similar to [shaderx5] 3.2 Selective Supersampling

[shaderx5] 4.2 Multisampling Extension for Gradient Shadow Maps
[shaderx5] 4.2 Multisampling Extension for Gradient Shadow Maps[shaderx5] 4.2 Multisampling Extension for Gradient Shadow Maps
[shaderx5] 4.2 Multisampling Extension for Gradient Shadow Maps종빈 오
 
openFrameworks 007 - 3D
openFrameworks 007 - 3DopenFrameworks 007 - 3D
openFrameworks 007 - 3Droxlu
 
CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9fungfung Chen
 
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Kyuseok Hwang(allosha)
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksJinTaek Seo
 
Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Takao Wada
 
Nodebox for Data Visualization
Nodebox for Data VisualizationNodebox for Data Visualization
Nodebox for Data VisualizationLynn Cherny
 
Trident International Graphics Workshop 2014 5/5
Trident International Graphics Workshop 2014 5/5Trident International Graphics Workshop 2014 5/5
Trident International Graphics Workshop 2014 5/5Takao Wada
 
CS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingCS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingMark Kilgard
 
MTH 2001 Project 2Instructions• Each group must choos.docx
MTH 2001 Project 2Instructions• Each group must choos.docxMTH 2001 Project 2Instructions• Each group must choos.docx
MTH 2001 Project 2Instructions• Each group must choos.docxgilpinleeanna
 
CG OpenGL Shadows + Light + Texture -course 10
CG OpenGL Shadows + Light + Texture -course 10CG OpenGL Shadows + Light + Texture -course 10
CG OpenGL Shadows + Light + Texture -course 10fungfung Chen
 
Cascades Demo Secrets
Cascades Demo SecretsCascades Demo Secrets
Cascades Demo Secretsicastano
 
Implementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES rendererImplementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES rendererDavide Pasca
 
Deep Learning for AI (2)
Deep Learning for AI (2)Deep Learning for AI (2)
Deep Learning for AI (2)Dongheon Lee
 
20101017 program analysis_for_security_livshits_lecture02_compilers
20101017 program analysis_for_security_livshits_lecture02_compilers20101017 program analysis_for_security_livshits_lecture02_compilers
20101017 program analysis_for_security_livshits_lecture02_compilersComputer Science Club
 
267 handout 2_partial_derivatives_v2.60
267 handout 2_partial_derivatives_v2.60267 handout 2_partial_derivatives_v2.60
267 handout 2_partial_derivatives_v2.60Ali Adeel
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-softwarezukun
 
C++totural file
C++totural fileC++totural file
C++totural filehalaisumit
 

Similar to [shaderx5] 3.2 Selective Supersampling (20)

[shaderx5] 4.2 Multisampling Extension for Gradient Shadow Maps
[shaderx5] 4.2 Multisampling Extension for Gradient Shadow Maps[shaderx5] 4.2 Multisampling Extension for Gradient Shadow Maps
[shaderx5] 4.2 Multisampling Extension for Gradient Shadow Maps
 
openFrameworks 007 - 3D
openFrameworks 007 - 3DopenFrameworks 007 - 3D
openFrameworks 007 - 3D
 
CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9
 
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
 
Nis differentiation1
Nis differentiation1Nis differentiation1
Nis differentiation1
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
 
Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5
 
Nodebox for Data Visualization
Nodebox for Data VisualizationNodebox for Data Visualization
Nodebox for Data Visualization
 
Trident International Graphics Workshop 2014 5/5
Trident International Graphics Workshop 2014 5/5Trident International Graphics Workshop 2014 5/5
Trident International Graphics Workshop 2014 5/5
 
CS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingCS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and Culling
 
Mini-curso JavaFX Aula2
Mini-curso JavaFX Aula2Mini-curso JavaFX Aula2
Mini-curso JavaFX Aula2
 
MTH 2001 Project 2Instructions• Each group must choos.docx
MTH 2001 Project 2Instructions• Each group must choos.docxMTH 2001 Project 2Instructions• Each group must choos.docx
MTH 2001 Project 2Instructions• Each group must choos.docx
 
CG OpenGL Shadows + Light + Texture -course 10
CG OpenGL Shadows + Light + Texture -course 10CG OpenGL Shadows + Light + Texture -course 10
CG OpenGL Shadows + Light + Texture -course 10
 
Cascades Demo Secrets
Cascades Demo SecretsCascades Demo Secrets
Cascades Demo Secrets
 
Implementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES rendererImplementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES renderer
 
Deep Learning for AI (2)
Deep Learning for AI (2)Deep Learning for AI (2)
Deep Learning for AI (2)
 
20101017 program analysis_for_security_livshits_lecture02_compilers
20101017 program analysis_for_security_livshits_lecture02_compilers20101017 program analysis_for_security_livshits_lecture02_compilers
20101017 program analysis_for_security_livshits_lecture02_compilers
 
267 handout 2_partial_derivatives_v2.60
267 handout 2_partial_derivatives_v2.60267 handout 2_partial_derivatives_v2.60
267 handout 2_partial_derivatives_v2.60
 
Modern features-part-3-software
Modern features-part-3-softwareModern features-part-3-software
Modern features-part-3-software
 
C++totural file
C++totural fileC++totural file
C++totural file
 

More from 종빈 오

트위터 봇 개발 후기
트위터 봇 개발 후기트위터 봇 개발 후기
트위터 봇 개발 후기종빈 오
 
적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0종빈 오
 
페리 수열(Farey sequence)
페리 수열(Farey sequence)페리 수열(Farey sequence)
페리 수열(Farey sequence)종빈 오
 
내가 본 미드 이야기
내가 본 미드 이야기내가 본 미드 이야기
내가 본 미드 이야기종빈 오
 
비트 경제와 공짜
비트 경제와 공짜비트 경제와 공짜
비트 경제와 공짜종빈 오
 
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해종빈 오
 
[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스종빈 오
 
Intrusive data structure 소개
Intrusive data structure 소개Intrusive data structure 소개
Intrusive data structure 소개종빈 오
 
2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템종빈 오
 
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81종빈 오
 
[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments종빈 오
 
넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우종빈 오
 
[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합종빈 오
 
LevelDB 간단한 소개
LevelDB 간단한 소개LevelDB 간단한 소개
LevelDB 간단한 소개종빈 오
 
[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline종빈 오
 
[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당종빈 오
 
[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary종빈 오
 
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬종빈 오
 
[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명종빈 오
 
[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering종빈 오
 

More from 종빈 오 (20)

트위터 봇 개발 후기
트위터 봇 개발 후기트위터 봇 개발 후기
트위터 봇 개발 후기
 
적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0적당한 스터디 발표자료 만들기 2.0
적당한 스터디 발표자료 만들기 2.0
 
페리 수열(Farey sequence)
페리 수열(Farey sequence)페리 수열(Farey sequence)
페리 수열(Farey sequence)
 
내가 본 미드 이야기
내가 본 미드 이야기내가 본 미드 이야기
내가 본 미드 이야기
 
비트 경제와 공짜
비트 경제와 공짜비트 경제와 공짜
비트 경제와 공짜
 
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
[NDC12] 게임 물리 엔진의 내부 동작 원리 이해
 
[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스[Windows via c/c++] 4장 프로세스
[Windows via c/c++] 4장 프로세스
 
Intrusive data structure 소개
Intrusive data structure 소개Intrusive data structure 소개
Intrusive data structure 소개
 
2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템2011 아꿈사 오전반 포스트모템
2011 아꿈사 오전반 포스트모템
 
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
[프로젝트가 서쪽으로 간 까닭은] chap 17, 18, 26, 33, 81
 
[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments[GEG1] 3.volumetric representation of virtual environments
[GEG1] 3.volumetric representation of virtual environments
 
넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우넘쳐나는 정보 소화 노하우
넘쳐나는 정보 소화 노하우
 
[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합[Domain driven design] 17장 전략의 종합
[Domain driven design] 17장 전략의 종합
 
LevelDB 간단한 소개
LevelDB 간단한 소개LevelDB 간단한 소개
LevelDB 간단한 소개
 
[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline[GEG1] 2.the game asset pipeline
[GEG1] 2.the game asset pipeline
 
[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당[TAOCP] 2.5 동적인 저장소 할당
[TAOCP] 2.5 동적인 저장소 할당
 
[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary[GEG1] 24. key value dictionary
[GEG1] 24. key value dictionary
 
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬[TAOCP] 2.2.3 연결된 할당 - 위상정렬
[TAOCP] 2.2.3 연결된 할당 - 위상정렬
 
[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명[TAOCP] 1.3.1 MIX 설명
[TAOCP] 1.3.1 MIX 설명
 
[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering[GEG1] 10.camera-centric engine design for multithreaded rendering
[GEG1] 10.camera-centric engine design for multithreaded rendering
 

Recently uploaded

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

[shaderx5] 3.2 Selective Supersampling

  • 1. SHADERX5 shader study http://cafe.naver.com/shader.cafe ohyecloudy http://ohyecloudy.com 2010.03.22
  • 2. Supersamping?, Multisampling? Drawbacks Overcoming drawbacks Implement supersamping Implement selective supersampling Conclusion
  • 3. 2x2 supersampling • 모든 픽셀에 대해 여러 픽셀 샘플링 • 퀄리티 • 퍼포먼스
  • 4. 2x multisampling • polygon edge만 여러 픽셀 샘플링 – surface 안 쪽은 하지 않는다. • 퍼포먼스
  • 5. Supersamping?, Multisampling? Drawbacks Overcoming drawbacks Implement supersamping Implement selective supersampling Conclusion
  • 6. No selective-supersampling selective-supersampling • high-frequency component가 문제 – specular highlight가 어른거리게 만든다 – 밉맵mip-map을 사용하는 이유와 같다.
  • 7. Supersamping?, Multisampling? Drawbacks Overcoming drawbacks Implement supersamping Implement selective supersampling Conclusion
  • 8. multisampling supersampling • hybrid solution – edge : multisampling – aliasing 문제가 있는 부분 : supersampling
  • 9. Supersamping?, Multisampling? Drawbacks Overcoming drawbacks Implement supersamping Implement selective supersampling Conclusion
  • 10. float4 vfSum = 0.0; for (int i = 0; i < SAMPLE_COUNT; i++) { vfSum += OriginalShader(sampleCoordinate[i]); } return vfSum / SAMPLE_COUNT; 좀 더 정확하게 근사하자. ddx와 ddy를 사용
  • 11. A ddx ddy texture projection OR A’s ddx != B’s ddx A’s ddy != B’s ddy B ddx ddx ddy Returns the partial derivative of the specified value with respect to the screen-space x-coordinate. ddy Returns the partial derivative of the specified value with respect to the screen-space y-coordinate.
  • 12. const float2 fSamples[SAMPLE_COUNT] = { // using a rotated grid float2( 0.125, 0.375), float2( 0.375, -0.125), float2(-0.125, -0.375), float2(-0.375, 0.125), }; // compute gradients float2 fDX = ddx(texCoord); float2 fDY = ddy(texCoord); float4 vfSum = 0.0; for (int i = 0; i < SAMPLE_COUNT; ++i) { float2 vfSampleCoord = texCoord + fSamples[i].x * fDX + fSamples[i].y * fDY; vfSum += OriginalShader(vfSampleCoord); } return vfSum / SAMPLE_COUNT;
  • 13. Supersamping?, Multisampling? Drawbacks Overcoming drawbacks Implement supersamping Implement selective supersampling Conclusion
  • 14. float4 main( float2 texCoord : TEXCOORD0, float3 vnLight : TEXCOORD1) : COLOR { // compute the gradients of the texture coordinates float2 fDX = ddx(texCoord); float2 fDY = ddy(texCoord); // Compute lighting 라이팅은 그냥 수행 float3 vBase = tex2D(tBase, texCoord).rgb; float3 vBump = tex2D(tBump, texCoord).xyz; float3 vNormal = normalize(vBump*2.0 – 1.0); // [0,1] -> [-1,1] float3 cAmbient = 0.15 * vBase; float fDiffuse = saturate(dot(vLight, vNormal)); float fSpecular = specular만 selective supersampling (SPECULAR(vNormal) + SPECULAR(SAMPLENORMAL( 0.25, 0.75)) + SPECULAR(SAMPLENORMAL(-0.25,-0.75)) + SPECULAR(SAMPLENORMAL(-0.75, 0.25)) + SPECULAR(SAMPLENORMAL( 0.75,-0.25))) / 5.0; return float4(cAmbient + fDiffuse * vBase + fSpecular, 0); } #define SAMPLENORMAL(x, y) normalize(tex2D(tBump, texCoord + (0.5*x) * fDX + (0.5*y) * fDY).xyz * 2.0 – 1.0)
  • 15. // Center sample float fSpecular = SPECULAR(vNormal); // Compute specular gradients float2 ds = float2(ddx(fSpecular), ddy(fSpecular)); // If it’s above the threshold, then take the other four samples too if (dot(ds, ds) > 0.0002) { fSpecular += SPECULAR(SAMPLENORMAL( 0.25, 0.75)); fSpecular += SPECULAR(SAMPLENORMAL(-0.25,-0.75)); fSpecular += SPECULAR(SAMPLENORMAL(-0.75, 0.25)); fSpecular += SPECULAR(SAMPLENORMAL( 0.75,-0.25)); fSpecular /= 5.0; } dynamic branch threshold를 둬서 넘으면 supersampling
  • 16. Supersamping?, Multisampling? Drawbacks Overcoming drawbacks Implement supersamping Implement selective supersampling Conclusion
  • 17. • 성능을 위해 multisampling을 쓰는 경우 internal aliasing 문제가 발생할 수 있다. • 발생하는 부분만 supersampling을 사용해서 문제를 해결할 수 있다. – 전체 supersampling보다는 퍼포먼스