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:47] – [Render Targets] 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 74: | Line 74: | ||
* Transparency is no longer automatically handled - may produce fragments or incorrect values | * Transparency is no longer automatically handled - may produce fragments or incorrect values | ||
* **Gorilla3D default materials will no longer work properly!** | * **Gorilla3D default materials will no longer work properly!** | ||
+ | * FMX / Gorilla3D still modify context state settings for blending, coloring, depth-testing, | ||
+ | |||
+ | What you can do: | ||
* You can use simple Firemonkey materials (TColorMaterialSource, | * You can use simple Firemonkey materials (TColorMaterialSource, | ||
+ | * You can render by native OpenGL commands (glBegin, glEnd, glColor4f, glVertex3f, ...) | ||
==== Render-Target ==== | ==== Render-Target ==== | ||
Line 81: | 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 ==== | ||
- | Since v0.8.3.1778 Gorilla3D allows to switch to a legacy renderer by viewport property. | + | Since v0.8.3.1778 Gorilla3D allows to switch to legacy renderer by viewport property. |
<file pascal> | <file pascal> | ||
Line 101: | Line 105: | ||
Instead it renders __opague__-marked elements __at first__ and then all other elements. | Instead it renders __opague__-marked elements __at first__ and then all other elements. | ||
- | __Opaque__ rendering will perform | + | __Opaque__ rendering will be performed |
==== Compatibility with Render-Pass ==== | ==== Compatibility with Render-Pass ==== | ||
- | For render-passes it is also allowed to use legacy | + | The core mechanism of render-pass handling |
+ | Read more about [[# | ||
+ | |||
+ | You can activate legacy rendering for render-passes like in the following snippet: | ||
<file pascal> | <file pascal> | ||
Line 113: | Line 120: | ||
[...] | [...] | ||
- | constructor TMyRenderPass.Create(); | + | constructor TMyRenderPass.Create(AOwner : TComponent; |
+ | const AId : String = ' | ||
begin | begin | ||
inherited; | inherited; | ||
Line 131: | 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 145: | 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 155: | 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 194: | 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 251: | 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**. |