Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
skybox [2019/03/12 13:03] – [Creating a skybox at runtime] admin | skybox [2020/01/27 08:43] – [Creating a skybox at runtime] admin | ||
---|---|---|---|
Line 26: | Line 26: | ||
uses | uses | ||
FMX.UITypes, | FMX.UITypes, | ||
- | Gorilla.Viewport; | + | Gorilla.Viewport, |
+ | Gorilla.Context.Texturing; | ||
// in our form (TForm1) we added a field named " | // in our form (TForm1) we added a field named " | ||
Line 45: | Line 46: | ||
LBmp := TBitmap.CreateFromFile(LCMPath + ' | LBmp := TBitmap.CreateFromFile(LCMPath + ' | ||
try | try | ||
- | FSkyBox.Textures[TGorillaSkyBoxTexturePart.Front] := LBmp; | + | FSkyBox.Textures[TGorillaCubeMapFace.NegativeZ] := LBmp; |
LBmp.LoadFromFile(LCMPath + ' | LBmp.LoadFromFile(LCMPath + ' | ||
- | FSkyBox.Textures[TGorillaSkyBoxTexturePart.Back] := LBmp; | + | FSkyBox.Textures[TGorillaCubeMapFace.PositiveZ] := LBmp; |
- | LBmp.LoadFromFile(LCMPath + ' | + | |
- | FSkyBox.Textures[TGorillaSkyBoxTexturePart.Top] | + | |
LBmp.LoadFromFile(LCMPath + ' | LBmp.LoadFromFile(LCMPath + ' | ||
- | FSkyBox.Textures[TGorillaSkyBoxTexturePart.Bottom] := LBmp; | + | FSkyBox.Textures[TGorillaCubeMapFace.NegativeY] := LBmp; |
+ | LBmp.LoadFromFile(LCMPath + ' | ||
+ | FSkyBox.Textures[TGorillaCubeMapFace.PositiveY] := LBmp; | ||
LBmp.LoadFromFile(LCMPath + ' | LBmp.LoadFromFile(LCMPath + ' | ||
- | FSkyBox.Textures[TGorillaSkyBoxTexturePart.Left] | + | FSkyBox.Textures[TGorillaCubeMapFace.NegativeX] := LBmp; |
LBmp.LoadFromFile(LCMPath + ' | LBmp.LoadFromFile(LCMPath + ' | ||
- | FSkyBox.Textures[TGorillaSkyBoxTexturePart.Right] := LBmp; | + | FSkyBox.Textures[TGorillaCubeMapFace.PositiveX] := LBmp; |
finally | finally | ||
FreeAndNil(LBmp); | FreeAndNil(LBmp); | ||
Line 61: | Line 62: | ||
end; | end; | ||
</ | </ | ||
- | + | ||
- | **Due to complications in combining FMX and Gorilla3D on lower texture level, skybox implementation do not support | + | Since v0.8.1.2510 skyboxes are rendered as 3D box with a real cubemap |
+ | (before only by 6 planes with simple 2D textures) | ||
+ | |||
+ | ===== DesignTime ===== | ||
+ | |||
+ | Drag and drop the TGorillaSkyBox component onto your viewport and start by uploading | ||
+ | the cubemap texture. This is done by loading all 6 faces of a box. | ||
+ | When downloading a precomputed skybox texture set, you will get 6 textures, which can be associated the following way: | ||
- | Skybox rendering is solved by six planes, which leads to tiny leaks at the border of each plane.** | + | ^Property^Face^Common TextureName^ |
+ | |FrontSide|TGorillaCubeMapFace.NegativeZ|negz.jpg| | ||
+ | |BackSide|TGorillaCubeMapFace.PositiveZ|posz.jpg| | ||
+ | |TopSide|TGorillaCubeMapFace.NegativeY|negy.jpg| | ||
+ | |BottomSide|TGorillaCubeMapFace.PositiveY|posy.jpg| | ||
+ | |LeftSide|TGorillaCubeMapFace.NegativeX|negx.jpg| | ||
+ | |RightSide|TGorillaCubeMapFace.PositiveX|posx.jpg| | ||
Next step: [[particles|Particles]] | Next step: [[particles|Particles]] |