SlideShare una empresa de Scribd logo
1 de 15
Descargar para leer sin conexión
ShaderX5
 8.1 Postprocessing Effects
          in Design

                       http://ohyecloudy.com
           http://cafe.naver.com/shader.cafe
                                  2009.02.23
Introduction
• 사용하는 Post-processing Effect가 증가.
  – Color correction, depth-of-field, motion blur,
    night vision, HDR tone mapping…
• 확장이 쉽고 다양한 요구 사항에 유연하게
  적응 가능한 framework를 제시.
The Goals
• Stability
   – 믿을 수 있고 일관된 결과.
• Robustness
   – 다른 시나리오와 이펙트에서 stability 보장.
• Extensibility
   – 이펙트 추가가 손쉬움.
• Performance
   – 가능한 최적, 효율적으로 동작.
• Flexibility
   – 풍부한 제어가 가능.
• Scalability
   – 지원하는 플랫폼에서 잠재적인 제한이 있더라도 잘 동작한다.
   – 예) 비디오 카드에 따라 다른 구성
The Design
Effect

Phase          Phase       Step의 그룹핑



Step

Step     구현이 필요한 파이프라인의 함수. 예) SetRenderTarget
HDR
Downsample        Calculate     Generate        Bloom        Tone-map and
scene texture    luminance     bright-pass    bright-pass    final composite



    Set             Set            Set            Set            Set
RenderTarget    RenderTarget   RenderTarget   RenderTarget   RenderTarget

   Draw            Draw           Draw            Draw           Draw
  Overlay         Overlay        Overlay         Overlay        Overlay

                    Set
                RenderTarget

                   Draw
                  Overlay

                    Set
                RenderTarget

                   Draw
                  Overlay
A Short Test Drive
<Effect Name="SepiaTone" Requirements="DX9“
       Description="Output a Sepia-toned image.">
  <Phase Description="">
    <Step Type="SetRenderTarget" Target="*CompositeOut" />
    <Step Type="Overlay" ShaderTechnique="RenderSepiaTone">
      <Texture Name="*CompositeIn" Alias="g_Texture"/>
      <Texture Name="Media/sepiatone.tga"
               Alias="g_DependantReadTexture" Type="File"/>
      <Param Name="Amout" Alias="g_fBlendAmout"
               Function="FadeIn"/>
    </Step>
    <Step Type="SetRenderTarget" Target="*Framebuffer"/>
  </Phase>
</Effect>
A Short Test Drive

<Effect Name = "Output" Requirements = "DX9"
  Description = "Output the final results to the screen.">
 <Phase Description = "">
  <Step Type = "SetRenderTarget" Target ="*Framebuffer" />
  <Step Type = "Overlay" ShaderTechnique = "RenderScreenQuad">
   <Texture Name = "*CompositeIn" Alias = "g_Texture" />
  </Step>
 </Phase>
</Effect>
Implementation Issue

                         Night
         HDR    Sepia             Output
                         Vision
 INPUT   A       B         A        B

OUTPUT   B       A         B        A
               Disable   Wrong!
Implementation Details
• Effect 활성 유무에 따라서 다음 Effect의
  RenderTarget을 변경해주는 코드만 리뷰
 – class CPostProcessTextureIoGroup
 – void Enable( bool bEnable )
 – void FixupTexturePointers()
 – CRTTexture* FindRenderTarget( const char
   *strName )
class CPostProcessEffect
{
protected:
         // The list of effects phases.
         vector< CPostProcessEffectPhase * > m_Phases;
         // The list of user created render targets.
         vector< CRTTexture * > m_UserRenderTargets;
         // The effect file name.
         char *m_strFileName;
         // The effect name.
         char *m_strEffectName;
         // The next effect in the linked-list.
         CPostProcessEffect *m_pNext;

        // Whether this effect is enabled or not.
        bool m_bIsEnabled;
        // The current texture input/output group.
        CPostProcessTextureIoGroup *m_pCurIoGroup;
        // The original texture input/output group.
        CPostProcessTextureIoGroup m_OrigIoGroup;
};
void CPostProcessEffect::Enable( bool bEnable )

// If we're disabling the effect.
if ( !bEnable )
{
         CPostProcessEffect *pCurEffect = GetNext();
         CPostProcessTextureIoGroup *pCurIoGroup = NULL;
         CPostProcessTextureIoGroup *pPrevIoGroup = GetCurIoGroup();
         // For every active effect after this effect,
         // move the io groups forward to maintain
         // the proper texture io group mappings.
         for ( ; pCurEffect; pCurEffect = pCurEffect->GetNext() )
         {
                  if ( !pCurEffect->GetIsEnabled() )
                  {
                           continue;
                  }
                  // Get the current io group.
                  pCurIoGroup = pCurEffect->GetCurIoGroup();
                  // Set the current io group and fixup texture pointers.
                  pCurEffect->SetCurIoGroup( pPrevIoGroup );
                  pCurEffect->FixupTexturePointers();
                  // Update the previous io group.
                  pPrevIoGroup = pCurIoGroup;
         }
}
void CPostProcessEffect::Enable( bool bEnable )

if ( bEnable )
{

CPostProcessEffect *pCurEffect = CPostProcessEffectsSystem::m_pInstance->GetEffectsHead();
CPostProcessEffect *pNxtActiveEffectHead = pCurEffect;
CPostProcessEffect *pNxtActiveEffect = NULL;

// To enable the effect we need to traverse the entire effect list twice,
// once moving forward through each original io groups, and second finding
// the next active effect that we can give that io group to.
for ( ; pCurEffect; pCurEffect = pCurEffect->GetNext() )
{
          // Where there are no more active effects we're done.
          if ( !pNxtActiveEffect )
          {
                    break;
          }
         // Set the next active effects
         pNxtActiveEffect->SetCurIoGroup(
                   (CPostProcessTextureIoGroup *)&pCurEffect->GetOrigIoGroup() );
         pNxtActiveEffect->FixupTexturePointers();
}

} // if ( bEnable )
// Fixup texture pointers.
void CPPFXStep_Overlay::FixupTexturePointers()
{
         if ( m_bIsLoadedFromFile )        return;

        CRTTexture *pRT = m_pParentStep->GetParentEffect()->FindRenderTarget(
                 GetRefName() );
        SetTexture( pRT );
}

// Fixup texture pointers.
void CPPFXStep_SetRenderTarget::FixupTexturePointers()
{
         CRTTexture *pRT = m_pParentEffect->FindRenderTarget(
                  m_pRTRef->GetRefName() );
         m_pRTRef->SetTexture( pRT );
}
CRTTexture *CPostProcessEffect::FindRenderTarget( const char *strName )
{
         if ( strcmp( strName, "*CompositeIn" ) == 0 )
         {
                  return m_pCurIoGroup->GetInput();
         }
         else if ( strcmp( strName, "*CompositeOut" ) == 0 )
         {
                  return m_pCurIoGroup->GetOutput();
         }

        vector< CRTTexture * >::iterator iterRT = m_UserRenderTargets.begin();
        for ( ; iterRT != m_UserRenderTargets.end(); ++iterRT )
        {
                 if ( strcmp( (*iterRT)->GetName(), strName ) == 0 )
                 {
                          return (*iterRT);
                 }
        }
        return NULL;
}
Conclusion
• Post processing effects는 텍스쳐를 바꾸어
  가며 SetRenderTarget을 한다.
  – 이 짓의 연속.
• 이 섹션에서 제시하는 Framework에서 확
  장성있고 변화에 유연한 Post processing
  effect 엔진 구현에 대한 힌트를 얻을 수 있
  다.

Más contenido relacionado

La actualidad más candente

openFrameworks 007 - video
openFrameworks 007 - videoopenFrameworks 007 - video
openFrameworks 007 - videoroxlu
 
OO JS for AS3 Devs
OO JS for AS3 DevsOO JS for AS3 Devs
OO JS for AS3 DevsJason Hanson
 
Extend GraphQL with directives
Extend GraphQL with directivesExtend GraphQL with directives
Extend GraphQL with directivesGreg Bergé
 
Application of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationApplication of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationPranamesh Chakraborty
 
JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript FunctionsBrian Moschel
 
Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functionsTAlha MAlik
 
The Ring programming language version 1.2 book - Part 45 of 84
The Ring programming language version 1.2 book - Part 45 of 84The Ring programming language version 1.2 book - Part 45 of 84
The Ring programming language version 1.2 book - Part 45 of 84Mahmoud Samir Fayed
 
Dynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAMDynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAMFumiya Nozaki
 
Comparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationComparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationPranamesh Chakraborty
 
Part 3-functions
Part 3-functionsPart 3-functions
Part 3-functionsankita44
 
Brief Summary Of C++
Brief Summary Of C++Brief Summary Of C++
Brief Summary Of C++Haris Lye
 
The Ring programming language version 1.5.1 book - Part 61 of 180
The Ring programming language version 1.5.1 book - Part 61 of 180The Ring programming language version 1.5.1 book - Part 61 of 180
The Ring programming language version 1.5.1 book - Part 61 of 180Mahmoud Samir Fayed
 
Introduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in HaskellIntroduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in Haskellnebuta
 
Groovy Api Tutorial
Groovy Api  TutorialGroovy Api  Tutorial
Groovy Api Tutorialguligala
 
Java JIT Optimization Research
Java JIT Optimization Research Java JIT Optimization Research
Java JIT Optimization Research Adam Feldscher
 
Refactoring Simple Example
Refactoring Simple ExampleRefactoring Simple Example
Refactoring Simple Exampleliufabin 66688
 

La actualidad más candente (20)

openFrameworks 007 - video
openFrameworks 007 - videoopenFrameworks 007 - video
openFrameworks 007 - video
 
OO JS for AS3 Devs
OO JS for AS3 DevsOO JS for AS3 Devs
OO JS for AS3 Devs
 
Extend GraphQL with directives
Extend GraphQL with directivesExtend GraphQL with directives
Extend GraphQL with directives
 
Functions12
Functions12Functions12
Functions12
 
Functions123
Functions123 Functions123
Functions123
 
Application of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimizationApplication of recursive perturbation approach for multimodal optimization
Application of recursive perturbation approach for multimodal optimization
 
JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript Functions
 
Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functions
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
The Ring programming language version 1.2 book - Part 45 of 84
The Ring programming language version 1.2 book - Part 45 of 84The Ring programming language version 1.2 book - Part 45 of 84
The Ring programming language version 1.2 book - Part 45 of 84
 
Dynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAMDynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAM
 
Dive Into PyTorch
Dive Into PyTorchDive Into PyTorch
Dive Into PyTorch
 
Comparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationComparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimization
 
Part 3-functions
Part 3-functionsPart 3-functions
Part 3-functions
 
Brief Summary Of C++
Brief Summary Of C++Brief Summary Of C++
Brief Summary Of C++
 
The Ring programming language version 1.5.1 book - Part 61 of 180
The Ring programming language version 1.5.1 book - Part 61 of 180The Ring programming language version 1.5.1 book - Part 61 of 180
The Ring programming language version 1.5.1 book - Part 61 of 180
 
Introduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in HaskellIntroduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in Haskell
 
Groovy Api Tutorial
Groovy Api  TutorialGroovy Api  Tutorial
Groovy Api Tutorial
 
Java JIT Optimization Research
Java JIT Optimization Research Java JIT Optimization Research
Java JIT Optimization Research
 
Refactoring Simple Example
Refactoring Simple ExampleRefactoring Simple Example
Refactoring Simple Example
 

Destacado

Tim Lucas presentation AllerDagarna
Tim Lucas presentation AllerDagarnaTim Lucas presentation AllerDagarna
Tim Lucas presentation AllerDagarnasusberg
 
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...종빈 오
 
Editors, authors, publishers - Who\'s who?
Editors, authors, publishers - Who\'s who?Editors, authors, publishers - Who\'s who?
Editors, authors, publishers - Who\'s who?chrisgraflinkedin
 
Charlottas presentation från AllerDagarna
Charlottas presentation från AllerDagarnaCharlottas presentation från AllerDagarna
Charlottas presentation från AllerDagarnasusberg
 
[shaderx5] 4.6 Real-Time Soft Shadows with Shadow Accumulation
[shaderx5] 4.6 Real-Time Soft Shadows with Shadow Accumulation[shaderx5] 4.6 Real-Time Soft Shadows with Shadow Accumulation
[shaderx5] 4.6 Real-Time Soft Shadows with Shadow Accumulation종빈 오
 
Effective Publication Practices
Effective Publication PracticesEffective Publication Practices
Effective Publication Practiceschrisgraflinkedin
 
Håkan presentation AllerDagarna
Håkan presentation AllerDagarnaHåkan presentation AllerDagarna
Håkan presentation AllerDagarnasusberg
 
Working Effectively With A Clinical Publisher
Working Effectively With A Clinical PublisherWorking Effectively With A Clinical Publisher
Working Effectively With A Clinical Publisherchrisgraflinkedin
 
Rise (and Rise) of Publication Ethics
Rise (and Rise) of Publication EthicsRise (and Rise) of Publication Ethics
Rise (and Rise) of Publication Ethicschrisgraflinkedin
 
Susanne Willfors presentation AllerDagarna
Susanne Willfors presentation AllerDagarnaSusanne Willfors presentation AllerDagarna
Susanne Willfors presentation AllerDagarnasusberg
 
Brief foray into publication ethics
Brief foray into publication ethicsBrief foray into publication ethics
Brief foray into publication ethicschrisgraflinkedin
 
A model for developing leadership expertise
A model for developing leadership expertiseA model for developing leadership expertise
A model for developing leadership expertiseDr. Shayne Tracy CMC OCC
 
오차가 적은 일정 세우기
오차가 적은 일정 세우기오차가 적은 일정 세우기
오차가 적은 일정 세우기종빈 오
 

Destacado (18)

Pathfinder Career Dilemmas2
Pathfinder Career Dilemmas2Pathfinder Career Dilemmas2
Pathfinder Career Dilemmas2
 
What Journal Authors Want
What Journal Authors WantWhat Journal Authors Want
What Journal Authors Want
 
Tim Lucas presentation AllerDagarna
Tim Lucas presentation AllerDagarnaTim Lucas presentation AllerDagarna
Tim Lucas presentation AllerDagarna
 
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
 
Editors, authors, publishers - Who\'s who?
Editors, authors, publishers - Who\'s who?Editors, authors, publishers - Who\'s who?
Editors, authors, publishers - Who\'s who?
 
Charlottas presentation från AllerDagarna
Charlottas presentation från AllerDagarnaCharlottas presentation från AllerDagarna
Charlottas presentation från AllerDagarna
 
Odyssey: The Business of Consulting
Odyssey: The Business of ConsultingOdyssey: The Business of Consulting
Odyssey: The Business of Consulting
 
Odyssey: The Business of Consulting
Odyssey: The Business of ConsultingOdyssey: The Business of Consulting
Odyssey: The Business of Consulting
 
[shaderx5] 4.6 Real-Time Soft Shadows with Shadow Accumulation
[shaderx5] 4.6 Real-Time Soft Shadows with Shadow Accumulation[shaderx5] 4.6 Real-Time Soft Shadows with Shadow Accumulation
[shaderx5] 4.6 Real-Time Soft Shadows with Shadow Accumulation
 
Effective Publication Practices
Effective Publication PracticesEffective Publication Practices
Effective Publication Practices
 
Håkan presentation AllerDagarna
Håkan presentation AllerDagarnaHåkan presentation AllerDagarna
Håkan presentation AllerDagarna
 
Working Effectively With A Clinical Publisher
Working Effectively With A Clinical PublisherWorking Effectively With A Clinical Publisher
Working Effectively With A Clinical Publisher
 
Rise (and Rise) of Publication Ethics
Rise (and Rise) of Publication EthicsRise (and Rise) of Publication Ethics
Rise (and Rise) of Publication Ethics
 
Who knows about the future?
Who knows about the future?Who knows about the future?
Who knows about the future?
 
Susanne Willfors presentation AllerDagarna
Susanne Willfors presentation AllerDagarnaSusanne Willfors presentation AllerDagarna
Susanne Willfors presentation AllerDagarna
 
Brief foray into publication ethics
Brief foray into publication ethicsBrief foray into publication ethics
Brief foray into publication ethics
 
A model for developing leadership expertise
A model for developing leadership expertiseA model for developing leadership expertise
A model for developing leadership expertise
 
오차가 적은 일정 세우기
오차가 적은 일정 세우기오차가 적은 일정 세우기
오차가 적은 일정 세우기
 

Similar a Implement Postprocessing Effects Framework Flexibly

Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...DroidConTLV
 
Four Ways to add Features to Ext JS
Four Ways to add Features to Ext JSFour Ways to add Features to Ext JS
Four Ways to add Features to Ext JSShea Frederick
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화NAVER D2
 
[232]TensorRT를 활용한 딥러닝 Inference 최적화
[232]TensorRT를 활용한 딥러닝 Inference 최적화[232]TensorRT를 활용한 딥러닝 Inference 최적화
[232]TensorRT를 활용한 딥러닝 Inference 최적화NAVER D2
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeletonIram Ramrajkar
 
Functional Programming in Java 8
Functional Programming in Java 8Functional Programming in Java 8
Functional Programming in Java 8Omar Bashir
 
Create a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdfCreate a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdfmalavshah9013
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
Functional programming principles
Functional programming principlesFunctional programming principles
Functional programming principlesAndrew Denisov
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbroncymbron
 
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...Publicis Sapient Engineering
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksJinTaek Seo
 
Unit 4
Unit 4Unit 4
Unit 4siddr
 
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxIn Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxbradburgess22840
 
Introduction to Griffon
Introduction to GriffonIntroduction to Griffon
Introduction to GriffonJames Williams
 
Design pattern - part 3
Design pattern - part 3Design pattern - part 3
Design pattern - part 3Jieyi Wu
 
Cambio de bases
Cambio de basesCambio de bases
Cambio de basesalcon2015
 

Similar a Implement Postprocessing Effects Framework Flexibly (20)

Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
 
Four Ways to add Features to Ext JS
Four Ways to add Features to Ext JSFour Ways to add Features to Ext JS
Four Ways to add Features to Ext JS
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
 
[232]TensorRT를 활용한 딥러닝 Inference 최적화
[232]TensorRT를 활용한 딥러닝 Inference 최적화[232]TensorRT를 활용한 딥러닝 Inference 최적화
[232]TensorRT를 활용한 딥러닝 Inference 최적화
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
 
Functional Programming in Java 8
Functional Programming in Java 8Functional Programming in Java 8
Functional Programming in Java 8
 
Create a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdfCreate a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdf
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
Functional programming principles
Functional programming principlesFunctional programming principles
Functional programming principles
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbron
 
OpenMP
OpenMPOpenMP
OpenMP
 
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
 
Unit 4
Unit 4Unit 4
Unit 4
 
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxIn Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
 
Introduction to Griffon
Introduction to GriffonIntroduction to Griffon
Introduction to Griffon
 
Design pattern - part 3
Design pattern - part 3Design pattern - part 3
Design pattern - part 3
 
Cambio de bases
Cambio de basesCambio de bases
Cambio de bases
 

Más de 종빈 오

트위터 봇 개발 후기
트위터 봇 개발 후기트위터 봇 개발 후기
트위터 봇 개발 후기종빈 오
 
적당한 스터디 발표자료 만들기 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종빈 오
 

Más de 종빈 오 (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
 

Último

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 

Último (20)

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 

Implement Postprocessing Effects Framework Flexibly

  • 1. ShaderX5 8.1 Postprocessing Effects in Design http://ohyecloudy.com http://cafe.naver.com/shader.cafe 2009.02.23
  • 2. Introduction • 사용하는 Post-processing Effect가 증가. – Color correction, depth-of-field, motion blur, night vision, HDR tone mapping… • 확장이 쉽고 다양한 요구 사항에 유연하게 적응 가능한 framework를 제시.
  • 3. The Goals • Stability – 믿을 수 있고 일관된 결과. • Robustness – 다른 시나리오와 이펙트에서 stability 보장. • Extensibility – 이펙트 추가가 손쉬움. • Performance – 가능한 최적, 효율적으로 동작. • Flexibility – 풍부한 제어가 가능. • Scalability – 지원하는 플랫폼에서 잠재적인 제한이 있더라도 잘 동작한다. – 예) 비디오 카드에 따라 다른 구성
  • 4. The Design Effect Phase Phase Step의 그룹핑 Step Step 구현이 필요한 파이프라인의 함수. 예) SetRenderTarget
  • 5. HDR Downsample Calculate Generate Bloom Tone-map and scene texture luminance bright-pass bright-pass final composite Set Set Set Set Set RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget Draw Draw Draw Draw Draw Overlay Overlay Overlay Overlay Overlay Set RenderTarget Draw Overlay Set RenderTarget Draw Overlay
  • 6. A Short Test Drive <Effect Name="SepiaTone" Requirements="DX9“ Description="Output a Sepia-toned image."> <Phase Description=""> <Step Type="SetRenderTarget" Target="*CompositeOut" /> <Step Type="Overlay" ShaderTechnique="RenderSepiaTone"> <Texture Name="*CompositeIn" Alias="g_Texture"/> <Texture Name="Media/sepiatone.tga" Alias="g_DependantReadTexture" Type="File"/> <Param Name="Amout" Alias="g_fBlendAmout" Function="FadeIn"/> </Step> <Step Type="SetRenderTarget" Target="*Framebuffer"/> </Phase> </Effect>
  • 7. A Short Test Drive <Effect Name = "Output" Requirements = "DX9" Description = "Output the final results to the screen."> <Phase Description = ""> <Step Type = "SetRenderTarget" Target ="*Framebuffer" /> <Step Type = "Overlay" ShaderTechnique = "RenderScreenQuad"> <Texture Name = "*CompositeIn" Alias = "g_Texture" /> </Step> </Phase> </Effect>
  • 8. Implementation Issue Night HDR Sepia Output Vision INPUT A B A B OUTPUT B A B A Disable Wrong!
  • 9. Implementation Details • Effect 활성 유무에 따라서 다음 Effect의 RenderTarget을 변경해주는 코드만 리뷰 – class CPostProcessTextureIoGroup – void Enable( bool bEnable ) – void FixupTexturePointers() – CRTTexture* FindRenderTarget( const char *strName )
  • 10. class CPostProcessEffect { protected: // The list of effects phases. vector< CPostProcessEffectPhase * > m_Phases; // The list of user created render targets. vector< CRTTexture * > m_UserRenderTargets; // The effect file name. char *m_strFileName; // The effect name. char *m_strEffectName; // The next effect in the linked-list. CPostProcessEffect *m_pNext; // Whether this effect is enabled or not. bool m_bIsEnabled; // The current texture input/output group. CPostProcessTextureIoGroup *m_pCurIoGroup; // The original texture input/output group. CPostProcessTextureIoGroup m_OrigIoGroup; };
  • 11. void CPostProcessEffect::Enable( bool bEnable ) // If we're disabling the effect. if ( !bEnable ) { CPostProcessEffect *pCurEffect = GetNext(); CPostProcessTextureIoGroup *pCurIoGroup = NULL; CPostProcessTextureIoGroup *pPrevIoGroup = GetCurIoGroup(); // For every active effect after this effect, // move the io groups forward to maintain // the proper texture io group mappings. for ( ; pCurEffect; pCurEffect = pCurEffect->GetNext() ) { if ( !pCurEffect->GetIsEnabled() ) { continue; } // Get the current io group. pCurIoGroup = pCurEffect->GetCurIoGroup(); // Set the current io group and fixup texture pointers. pCurEffect->SetCurIoGroup( pPrevIoGroup ); pCurEffect->FixupTexturePointers(); // Update the previous io group. pPrevIoGroup = pCurIoGroup; } }
  • 12. void CPostProcessEffect::Enable( bool bEnable ) if ( bEnable ) { CPostProcessEffect *pCurEffect = CPostProcessEffectsSystem::m_pInstance->GetEffectsHead(); CPostProcessEffect *pNxtActiveEffectHead = pCurEffect; CPostProcessEffect *pNxtActiveEffect = NULL; // To enable the effect we need to traverse the entire effect list twice, // once moving forward through each original io groups, and second finding // the next active effect that we can give that io group to. for ( ; pCurEffect; pCurEffect = pCurEffect->GetNext() ) { // Where there are no more active effects we're done. if ( !pNxtActiveEffect ) { break; } // Set the next active effects pNxtActiveEffect->SetCurIoGroup( (CPostProcessTextureIoGroup *)&pCurEffect->GetOrigIoGroup() ); pNxtActiveEffect->FixupTexturePointers(); } } // if ( bEnable )
  • 13. // Fixup texture pointers. void CPPFXStep_Overlay::FixupTexturePointers() { if ( m_bIsLoadedFromFile ) return; CRTTexture *pRT = m_pParentStep->GetParentEffect()->FindRenderTarget( GetRefName() ); SetTexture( pRT ); } // Fixup texture pointers. void CPPFXStep_SetRenderTarget::FixupTexturePointers() { CRTTexture *pRT = m_pParentEffect->FindRenderTarget( m_pRTRef->GetRefName() ); m_pRTRef->SetTexture( pRT ); }
  • 14. CRTTexture *CPostProcessEffect::FindRenderTarget( const char *strName ) { if ( strcmp( strName, "*CompositeIn" ) == 0 ) { return m_pCurIoGroup->GetInput(); } else if ( strcmp( strName, "*CompositeOut" ) == 0 ) { return m_pCurIoGroup->GetOutput(); } vector< CRTTexture * >::iterator iterRT = m_UserRenderTargets.begin(); for ( ; iterRT != m_UserRenderTargets.end(); ++iterRT ) { if ( strcmp( (*iterRT)->GetName(), strName ) == 0 ) { return (*iterRT); } } return NULL; }
  • 15. Conclusion • Post processing effects는 텍스쳐를 바꾸어 가며 SetRenderTarget을 한다. – 이 짓의 연속. • 이 섹션에서 제시하는 Framework에서 확 장성있고 변화에 유연한 Post processing effect 엔진 구현에 대한 힌트를 얻을 수 있 다.