Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
0.8.3:renderpass [2021/02/11 15:53] – [Compatibility with Render-Pass] admin | 0.8.3:renderpass [2021/02/12 22:16] (current) – [Render-Target] admin | ||
---|---|---|---|
Line 51: | Line 51: | ||
**2) Additional opaque texture** | **2) Additional opaque texture** | ||
^ Texture-ID ^Format ^InternalFormat^DataType^ | ^ Texture-ID ^Format ^InternalFormat^DataType^ | ||
- | |Albedo Texture|BGRA (Windows) / RGBA|BGRA (Windows) / RGBA|UnsignedByte| | + | |Albedo Texture|BGRA (Windows) / RGBA|RGBA8|UnsignedByte| |
**3) Additional translucent texture** | **3) Additional translucent texture** | ||
Line 61: | Line 61: | ||
**4) Composite texture / final output texture** | **4) Composite texture / final output texture** | ||
^ Texture-ID ^Format ^InternalFormat^DataType^ | ^ Texture-ID ^Format ^InternalFormat^DataType^ | ||
- | |Composite Texture|BGRA (Windows) / RGBA|BGRA (Windows) / RGBA|UnsignedByte| | + | |Composite Texture|BGRA (Windows) / RGBA|RGBA8|UnsignedByte| |
This texture will be filled by an embedded composite render-pass, | This texture will be filled by an embedded composite render-pass, | ||
Line 85: | Line 85: | ||
^ Texture-ID ^Format ^InternalFormat^DataType^ | ^ Texture-ID ^Format ^InternalFormat^DataType^ | ||
- | |Composite Texture|BGRA (Windows) / RGBA|BGRA (Windows) / RGBA|UnsignedByte| | + | |Composite Texture|BGRA (Windows) / RGBA|RGBA8|UnsignedByte| |
==== How to use ==== | ==== How to use ==== | ||
Line 110: | Line 110: | ||
The core mechanism of render-pass handling is still available, but it might influence your final result, when using forward and legacy renderer inconsistently. | The core mechanism of render-pass handling is still available, but it might influence your final result, when using forward and legacy renderer inconsistently. | ||
+ | Read more about [[# | ||
You can activate legacy rendering for render-passes like in the following snippet: | You can activate legacy rendering for render-passes like in the following snippet: | ||
Line 119: | Line 120: | ||
[...] | [...] | ||
- | constructor TMyRenderPass.Create(); | + | constructor TMyRenderPass.Create(AOwner : TComponent; |
+ | const AId : String = ' | ||
begin | begin | ||
inherited; | inherited; | ||
Line 137: | Line 139: | ||
^ Type ^ Description ^ | ^ Type ^ Description ^ | ||
| TRenderPassType.Pre | render-pass will be executed before main loop. | | | TRenderPassType.Pre | render-pass will be executed before main loop. | | ||
- | | TRenderPassType.Intermediate | render-pass will be executed in between main loop (**very ineffective** - because executed each renderlist element) | | + | | TRenderPassType.Intermediate | render-pass will be executed in between main loop (**not recommended - very ineffective** - because executed each renderlist element) | |
| TRenderPassType.Post | render-pass will be executed after main loop. | | | TRenderPassType.Post | render-pass will be executed after main loop. | | ||
Line 151: | Line 153: | ||
//Elder methods: RenderListToContext and RectToContext were removed while pipeline refactoring.// | //Elder methods: RenderListToContext and RectToContext were removed while pipeline refactoring.// | ||
- | |||
- | The [[FBO|framebuffer object (FBO)]] is a structure inside of each render-pass and the main-loop. Render results are stored into that buffers. This allows to forward results from one step to another. | ||
^ Type ^ Description ^ | ^ Type ^ Description ^ | ||
Line 161: | Line 161: | ||
FMethod := TRenderPassMethod.RenderListToFBO; | FMethod := TRenderPassMethod.RenderListToFBO; | ||
</ | </ | ||
+ | |||
+ | The [[FBO|framebuffer object (FBO)]] is a structure inside of each render-pass and the main-loop. | ||
+ | (Or better to say: A structure in each context of a TRenderer). | ||
+ | |||
+ | Render results are stored into that buffers. This allows to forward results from one step to another. | ||
==== Rendering Procedure ==== | ==== Rendering Procedure ==== | ||
Because it's not enough to tell the renderer what and where to render, we need to define a way of rendering. | Because it's not enough to tell the renderer what and where to render, we need to define a way of rendering. | ||
- | Therefore the render-pass controller supplies a property FRenderProc. | + | Therefore the render-pass controller supplies a property |
Currently there are 2 ways defined: | Currently there are 2 ways defined: | ||
* DefaultRendering | * DefaultRendering | ||
Line 200: | Line 205: | ||
^Flag^Description^ | ^Flag^Description^ | ||
- | |TRendererFlag.IgnoreRenderTargets|Will not create any of the meta-textures (Albedo, TranslucentAlbedo, | + | |TRendererFlag.IgnoreRenderTargets|Will not create any of the meta-textures (Albedo, TranslucentAlbedo, |
|TRendererFlag.IgnoreCompositeCtrl|Will not create the embedded composite render pass to merge meta-textures.| | |TRendererFlag.IgnoreCompositeCtrl|Will not create the embedded composite render pass to merge meta-textures.| | ||
Line 257: | Line 262: | ||
1) For **RenderListToFBO** rendering: | 1) For **RenderListToFBO** rendering: | ||
- | * Create a global material shader for all objects and override the object-specific shaders | + | * Create a global material shader for all objects and override the object-specific shaders |
- | * Use the object-specific shaders, by returning NIL in the CreateMaterial() method | + | * Use the object-specific shaders, by returning NIL in the CreateMaterial() method |
2) For **RectToFBO** rendering: | 2) For **RectToFBO** rendering: | ||
- | * Create a global material shader | + | * Create a global material shader |
To create an global material shader for your render-pass you need to extend **TGorillaRenderPassMaterialSource** and **TGorillaRenderPassMaterial**. | To create an global material shader for your render-pass you need to extend **TGorillaRenderPassMaterialSource** and **TGorillaRenderPassMaterial**. |