Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
layer3d [2020/01/09 11:52] – [Fix Transparency] admin | layer3d [2020/11/04 14:55] – [DirectX-OpenGL Bridge] admin | ||
---|---|---|---|
Line 13: | Line 13: | ||
</ | </ | ||
+ | ===== Effects ===== | ||
+ | With version 0.8.2.x FMX effect components, like TGaussianBlurEffect, | ||
+ | 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. | ||
+ | |||
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
===== Layers ===== | ===== Layers ===== | ||
Line 77: | Line 85: | ||
{{ :: | {{ :: | ||
+ | |||
+ | ===== 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 4.3. | ||
+ | So we integrated our OpenGL implementation compatible to DirectX. | ||
+ | But this brings some restrictions with it regarding texturing. | ||
+ | |||
+ | __Bitmaps in FMX and 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) | ||
+ | * 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' | ||
+ | |||
+ | __Textures in Gorilla3D and OpenGL:__ | ||
+ | * We work with no byte alignment on rows of a texture buffer. So technically, | ||
+ | * But - OpenGL expects textures to have a size of 2 ^ X (except render target textures) | ||
+ | * 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: | ||
+ | If using a TBitmap created by FMX and applying the image data to Gorilla3D shaders you may | ||
+ | produce some defect image data in rendering. | ||
+ | **Those defect data occurs as access-violation or by diagonal lines.** | ||
+ | |||
+ | __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 | ||
+ | * By using other image formats in Gorilla3D shaders, the framework will produce duplicated buffers | ||
+ | |||
+ | Next step: [[scripting|Scripting]] |