Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
renderpass [2019/04/12 13:37] – [Render-Pass Material] admin | renderpass [2020/01/09 14:06] – [Rendering Method] admin | ||
---|---|---|---|
Line 15: | Line 15: | ||
You are allowed to configure a destination / method for your individual render pass. | You are allowed to configure a destination / method for your individual render pass. | ||
+ | A render destination is the place where computed image data is going to stored to. | ||
+ | * Context | ||
+ | * FrameBufferObject (FBO) | ||
+ | |||
+ | While the context (aka. main texture or Default-FBO) is the default texture used for final rendering output, the FrameBufferObject (FBO) is a buffer created for each render pass instance. | ||
+ | The FrameBufferObject (FBO) can be used to temporarily store your rendering result and push it to another render pass. | ||
+ | For further information read down below. | ||
^ Type ^ Description ^ | ^ Type ^ Description ^ | ||
- | | TRenderPassMethod.RenderList | + | | TRenderPassMethod.RenderListToContext |
- | | TRenderPassMethod.ToContext | + | | TRenderPassMethod.RenderListToFBO | Will render |
+ | | TRenderPassMethod.RectToContext | ||
+ | | TRenderPassMethod.RectToFBO | Will render a rectangle to the render pass specific FrameBufferObject (FBO). The render pass need to have an individual | ||
- | In the next step you have to decide, if the element materials (only in RenderList) or an especially | + | In the next step you have to decide, if a **one-for-all material |
Because sometimes you want the full scene just to be rendered from another perspective (like reflection) or you want to store a specific value (like the depth-value in shadow mapping) in the FBO. | Because sometimes you want the full scene just to be rendered from another perspective (like reflection) or you want to store a specific value (like the depth-value in shadow mapping) in the FBO. | ||
Line 45: | Line 54: | ||
case AState of | case AState of | ||
OnPassBegin: | OnPassBegin: | ||
- | begin | + | begin |
- | // rendering method for rendering pass | + | |
- | FFBO.Clear(Point(AContext.Width, | + | |
- | [TRenderTarget.Color_0, | + | |
- | TAlphaColorF.Create(0, | + | |
- | FFBO.Bind(); | + | |
- | FFBO.Prepare([TRenderTarget.Color_0, | + | |
- | + | ||
// deactivate ZTest in OpenGL | // deactivate ZTest in OpenGL | ||
AContext.SetContextState(TContextState.csZTestOff); | AContext.SetContextState(TContextState.csZTestOff); | ||
Line 60: | Line 62: | ||
AContext.SetCameraMatrix(GetViewMatrix(AContext)); | AContext.SetCameraMatrix(GetViewMatrix(AContext)); | ||
AContext.SetCameraAngleOfView(Viewport.CurrentCamera.AngleOfView); | AContext.SetCameraAngleOfView(Viewport.CurrentCamera.AngleOfView); | ||
+ | | ||
+ | // rendering method for rendering pass | ||
+ | FFBO.Clear(Point(AContext.Width, | ||
+ | [TRenderTarget.Color_0, | ||
+ | TAlphaColorF.Create(0, | ||
+ | FFBO.Bind(); | ||
+ | FFBO.Prepare([TRenderTarget.Color_0, | ||
end; | end; | ||
OnPassEnd: | OnPassEnd: | ||
- | begin | + | begin |
- | | + | |
| | ||
- | | + | |
end; | end; | ||
end; | end; | ||
Line 263: | Line 272: | ||
The callback also provides an " | The callback also provides an " | ||
It is possible to set a number of iterations this pass should run. | It is possible to set a number of iterations this pass should run. | ||
- | This is very useful | + | This is very useful for ping-pong rendering techniques like blurring. |
Set the " | Set the " |