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
layer3d [2020/08/06 12:10] – [Fix Transparency] adminlayer3d [2020/11/04 14:55] – [DirectX-OpenGL Bridge] admin
Line 13: Line 13:
 </file> </file>
  
 +===== Effects =====
 +With version 0.8.2.x FMX effect components, like TGaussianBlurEffect, TPixelateEffect or TPaperSketchEffect are supported by Gorilla3D and can be applied to the TGorillaViewort as post-rendering effects.
 +This is a very easy way to modify the final rendering of your scenery without building your own post-effects.
 +The used TEffect component need to be enabled and the parent property linked to the viewport.
 +
 +{{:g3d_effect_1.jpg?nolink&400 |}}
 +{{:g3d_effect_2.jpg?nolink&400 |}}
 +{{:g3d_effect_3.jpg?nolink&400 |}}
 ===== Layers ===== ===== Layers =====
  
Line 78: Line 86:
 {{ ::layer3d-2.jpg?nolink&400 |}} {{ ::layer3d-2.jpg?nolink&400 |}}
  
-==== DirectX-OpenGL Bridge ====+===== DirectX-OpenGL Bridge =====
  
-**On Windows platforms** Firemonkey by default uses DirectX 9 or 11 as graphics library. But at the moment Gorilla3D only supports OpenGL.+**On Windows platforms** Firemonkey by default uses DirectX 9 or 11 as graphics library. But at the moment Gorilla3D only supports OpenGL 4.3.
 So we integrated our OpenGL implementation compatible to DirectX. So we integrated our OpenGL implementation compatible to DirectX.
 But this brings some restrictions with it regarding texturing. But this brings some restrictions with it regarding texturing.
  
-__Regarding bitmaps in FMX and DirectX:__+__Bitmaps in FMX and DirectX:__
   * When FMX creates a TBitmap instance it uses the TCanvasD2D component to build a buffer inside of DirectX.   * When FMX creates a TBitmap instance it uses the TCanvasD2D component to build a buffer inside of DirectX.
   * This buffer uses a hardcoded BGRA image format (inside of FMX) with 1 byte per color (= 4 bytes per pixel)   * This buffer uses a hardcoded BGRA image format (inside of FMX) with 1 byte per color (= 4 bytes per pixel)
-  * The pixels per row are memory aligned and not the width multiplied with the bytes per pixel +  * The **pixels per row are memory aligned** and not the width multiplied with the bytes per pixel 
-  * Instead DirectX uses an alignment on each row (the height doesn't matter) - [seams to be 32px]+  * Instead DirectX uses an alignment on each row (the height doesn't matter) - [pixel-width needs to be a multiple of 32px]
  
-__Regarding textures in Gorilla3D and OpenGL:__ +__Textures in Gorilla3D and OpenGL:__ 
-  * We work with no byte alignment on rows of a texture buffer +  * We work with no byte alignment on rows of a texture bufferSo technically, it doesn't matter which size the image has 
-  * So it technically doesn't matter which size the image has +  * But - OpenGL expects textures to have a size of 2 ^ X (except render target textures) 
-  * But - OpenGL expects textures to have a size of 2 ^ X+  * We instanciate an additional workaround buffer of all the other image formats available 
 +  * This produces more memory consumption (by duplicated buffers), but allows to use much more image formats, f.e. in shaders
  
 __DirectX-OpenGL interaction:__ __DirectX-OpenGL interaction:__
-This means, if using a TBitmap created by FMX and applying the image data to Gorilla3D shaders you may+If using a TBitmap created by FMX and applying the image data to Gorilla3D shaders you may
 produce some defect image data in rendering. produce some defect image data in rendering.
 +**Those defect data occurs as access-violation or by diagonal lines.**
  
-  * Only apply textures with a size 2 ^ X, so it's compatible to DirectX row-alignment and OpenGL texture-restriction+__Remarks:__ 
 +  * Only apply or work with textures of a size 2 ^ X, so it's compatible to DirectX row-alignment and OpenGL texture-restriction
   * Take care of the image format used in Gorilla3D: only RGBA/BGRA is allowed, when applying bitmaps from FMX   * Take care of the image format used in Gorilla3D: only RGBA/BGRA is allowed, when applying bitmaps from FMX
 +  * By using other image formats in Gorilla3D shaders, the framework will produce duplicated buffers
  
 Next step: [[scripting|Scripting]] Next step: [[scripting|Scripting]]