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
transparency [2020/01/09 09:34] – [Transparency] admintransparency [2020/06/02 14:51] – [Order-Independent Rendering] admin
Line 12: Line 12:
 [[https://www.khronos.org/opengl/wiki/Transparency_Sorting]] [[https://www.khronos.org/opengl/wiki/Transparency_Sorting]]
  
-The result is incorrect, which some of you already found out by using multiple components of a TTextLayer3D. FMX renders artifacts if rendering order is not correct which leads to bad results.+The result sometimes is correct, but in more complex scenery mostly incorrect, which some of you already found out by using multiple components of a TTextLayer3D. FMX renders artifacts or even hidden objects, if elements order is not correct, especially for intersected elements. 
 + 
 +Many other methods also have their difficulties in incorrectness, performance-costs, memory-usage or complexicity: 
 +  * Depth Peeling by A-Buffer 
 +  * Depth Peeling by linked lists 
 +  * Moment-Based OIT
  
 ===== Order-Independent Rendering ===== ===== Order-Independent Rendering =====
Line 26: Line 31:
 FMX already provides the "Opaque" property, but was not really used until now. FMX already provides the "Opaque" property, but was not really used until now.
  
 +{{youtube>5zXlZLWZeVk?medium}}
 ==== Usage ==== ==== Usage ====
  
Line 38: Line 44:
  
 === Transparency-Limit === === Transparency-Limit ===
-Weighted Blended Order-Independent Transparency do not know zero transparency colors. This means, if you expect a nearly not-transparent object to be renderedm, it may lead to overlay problems. Declare an object as "Opaque := false" when you deal with an opacity/alpha value of less than 0.75.+Weighted Blended Order-Independent Transparency do not know zero transparency colors. This means, if you expect a nearly not-transparent object to be rendered, it may lead to overlay problems. Declare an object as "Opaque := false" when you deal with an opacity/alpha value of less than 0.75.
  
 === OpenGL Version === === OpenGL Version ===
Line 50: Line 56:
 Gorilla3D components are all able to handle the weighted blended order-independent transparency rendering, **but Delphi FMX objects are not**! Gorilla3D components are all able to handle the weighted blended order-independent transparency rendering, **but Delphi FMX objects are not**!
  
-Because there is no general way of intersecting FMX 3D components in rendering, we have to add to some code to **each translucent 3D component** used.+Because there is no general way of intersecting FMX 3D components in rendering, we have to add to some code to **each translucent FMX 3D component** used.
  
 === Inheritance === === Inheritance ===
Line 81: Line 87:
 </file> </file>
  
 +=== Alternatives ===
 +
 +For many 3D FMX components we provide alternatives, also for layers:
 +
 +  * TGorillaCube
 +  * TGorillaSphere
 +  * TGorillaCylinder
 +  * TGorillaPlane
 +  * TGorillaTextLayer3D (also optimized for android platform)
 +
 +==== Materials ====
 +Besides component's setting you'll need a material that outputs all necessary image information for compositing.
 +
 +Any extended material of TGorillaDefaultMaterial is able to write that data to the bound framebuffer object.
 +
 +You can of course write your own shader. But you'll need to write the compressed fragment color (RGBA) and the alpha 
 +value (R8) to separated Render targets.
 +
 +Next step: [[layer3d|2D FMX components]]