New component TCastleBackground
allows to define a nice background for 3D games. Just add it to the design by Add Non-Visual Component -> Background (you can add it to any component, but it’s most natural to do it on viewport) and then set TCastleViewport.Background
to it.
-
You can provide up to 6 textures that define 6 sides of a skybox. See wikipedia about skyboxes.
How to make such skyboxes?
-
Sample cubemaps can be found e.g. on OpenGameArt and Emil Persson’s large cubemap collection. They are provided by setting URLs like
TCastleBackground.TexturePositiveX
(our naming follows e.g. X3D and Emil Persson’s conventions). -
You can render them in Terragen.
-
You can render them in Blender.
-
-
You can define a sky gradient using
TCastleBackground.SkyTopColor
,TCastleBackground.SkyEquatorColor
, ground gradientTCastleBackground.GroundBottomColor
,TCastleBackground.GroundEquatorColor
, and additional gradient to smooth transition from sky to groundTCastleBackground.SmoothEquator
.The sky and ground colors are visible if you don’t provide the 6 textures for a skybox, or if some of them use alpha for transparency.