Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
renderpass [2020/01/09 14:09] – [Start / End] adminrenderpass [2020/01/09 14:24] – [How to use] admin
Line 305: Line 305:
 To use a render target from the framebuffer object, we need to clear it on each rendering step. To use a render target from the framebuffer object, we need to clear it on each rendering step.
 After that, we have to activate it for shader usage by the Prepare() method. After that, we have to activate it for shader usage by the Prepare() method.
 +The prepare method will activate all supplied render targets for shader computation.
 +If you forget to execute prepare() only the default target Color_0 will be available for computation.
  
 We do this all in the render-pass callback method (DoOnRenderPass), when state is "TRenderPassEventState.OnPassBegin": We do this all in the render-pass callback method (DoOnRenderPass), when state is "TRenderPassEventState.OnPassBegin":
Line 319: Line 321:
       FFBO.Clear(Point(AContext.Width, AContext.Height),        FFBO.Clear(Point(AContext.Width, AContext.Height), 
         LTarget, TAlphaColorF.Create(0, 0, 0, 0), 0, 0);         LTarget, TAlphaColorF.Create(0, 0, 0, 0), 0, 0);
-       
-      // bind again the framebuffer object 
-      FFBO.Bind(); 
              
       // activate the specific render target buffer for shader       // activate the specific render target buffer for shader
Line 336: Line 335:
   begin   begin
     [...]     [...]
-     
-    // unbind framebuffer object 
-    FFBO.Unbind(); 
   end;   end;
 </file> </file>
Line 398: Line 394:
 FMyRenderPass.Enabled := true; FMyRenderPass.Enabled := true;
 </file> </file>
 +
 +Next step: [[shadows|Shadows]]