Add skybox or define sky/ground color gradient using TCastleBackground

Posted on

Background for skybox
Background gradient
Background for skybox

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.

  1. You can provide up to 6 textures that define 6 sides of a skybox. See wikipedia about skyboxes.

    How to make such skyboxes?

  2. You can define a sky gradient using TCastleBackground.SkyTopColor, TCastleBackground.SkyEquatorColor, ground gradient TCastleBackground.GroundBottomColor, TCastleBackground.GroundEquatorColor, and additional gradient to smooth transition from sky to ground TCastleBackground.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.

Start the discussion at Castle Game Engine Forum