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/08/06 12:10] – [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 78: | Line 86: | ||
{{ :: | {{ :: | ||
- | ==== 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 |
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 | + | __Bitmaps |
* 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' | + | * Instead DirectX uses an alignment on each row (the height doesn' |
- | __Regarding textures | + | __Textures |
- | * We work with no byte alignment on rows of a texture buffer | + | * We work with no byte alignment on rows of a texture buffer. So technically, it doesn' |
- | * So it technically doesn' | + | * 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.** | ||
- | | + | __Remarks: |
+ | | ||
* 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]] |