Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
0.8.3:renderpass [2021/02/11 15:35] – [Legacy-Renderer] admin | 0.8.3:renderpass [2021/02/11 16:01] – [Change Renderer Settings] 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|BGRA (Windows) / RGBA|UnsignedByte| |
**3) Additional translucent texture** | **3) Additional translucent texture** | ||
Line 67: | Line 67: | ||
===== Legacy-Renderer ===== | ===== Legacy-Renderer ===== | ||
- | The legacy rendering comes in place, when users want to control rendering | + | The legacy rendering comes in place, when users want to control rendering |
- | It provides not helper functionality of the forward renderer at all. | + | |
- | Instead it only sets up a default framebuffer object with a single render target texture. | + | |
- | Transparency is no longer automatically handled. | + | |
- | **__CAUTION: | + | Take care: |
+ | * It provides no helper functionality at all, given by the forward renderer | ||
+ | * It only sets up a default framebuffer object with a single render target texture | ||
+ | * Transparency is no longer automatically handled - may produce fragments or incorrect values | ||
+ | * **Gorilla3D default materials will no longer work properly!** | ||
+ | * FMX / Gorilla3D still modify context state settings for blending, coloring, depth-testing, | ||
- | But you can use the simple Firemonkey | + | What you can do: |
+ | * You can use simple Firemonkey materials | ||
+ | * You can render by native OpenGL commands (glBegin, glEnd, glColor4f, glVertex3f, ...) | ||
==== Render-Target ==== | ==== Render-Target ==== | ||
Line 85: | Line 89: | ||
==== 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 93: | Line 97: | ||
[...] | [...] | ||
GorillaViewport1.RendererType := TRendererType.LegacyRenderer; | GorillaViewport1.RendererType := TRendererType.LegacyRenderer; | ||
+ | </ | ||
+ | |||
+ | ==== Rendering ==== | ||
+ | |||
+ | When activating legacy rendering it doesn' | ||
+ | It __will not__ perform any __object sorting__ in distance to the camera. | ||
+ | Instead it renders __opague__-marked elements __at first__ and then all other elements. | ||
+ | |||
+ | __Opaque__ rendering will be performed __without blending__, while for " | ||
+ | |||
+ | ==== Compatibility with Render-Pass ==== | ||
+ | |||
+ | 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: | ||
+ | |||
+ | <file pascal> | ||
+ | uses | ||
+ | Gorilla.Renderer; | ||
+ | | ||
+ | [...] | ||
+ | |||
+ | constructor TMyRenderPass.Create(); | ||
+ | begin | ||
+ | inherited; | ||
+ | | ||
+ | RendererType := TRendererType.LegacyRenderer; | ||
+ | end; | ||
</ | </ | ||
===== Render-Pass ===== | ===== Render-Pass ===== | ||
Line 105: | Line 138: | ||
^ 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 119: | Line 152: | ||
//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 129: | Line 160: | ||
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 168: | Line 204: | ||
^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.| | ||