This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Skybox"

From BZFlagWiki
Jump to: navigation, search
(got to be unique materials.)
(working skybox now)
Line 21: Line 21:
 
{|
 
{|
 
|
 
|
world
+
world
name SkyboxMaterialTest
+
name SkyboxMaterialTest
size 230
+
size 230
end
+
end
options
+
options
-set _drawCelestial 0
+
-set _drawCelestial 0
-set _drawClouds 0
+
-set _drawClouds 0
-set _drawGround 1
+
-set _drawGround 0
-set _drawGroundLights 0
+
-set _drawGroundLights 0
-set _drawMountains 0
+
-set _drawMountains 0
-set _wallHeight 0
+
-set _wallHeight 0
end
+
-set _skyColor black
# For reference, Include the other two "Magic" Material names.  
+
 
# TeleMaterial will be available in  BZFlag version 3.0
+
end
# teleporter texture  
+
#http://trepan.bzflag.bz/horizontal_gradient_blue_begin_red_and_transparant_end.png
material
+
# For reference, Include the other two "Magic" Material names.
name LinkMaterial
+
# TeleMaterial will be available in  BZFlag version 3.0
addtexture http://cbg.bzflag.org/images/Panzer/borg/blackholes/nebula4.PNG
+
# teleporter texture
end
+
 
# -set _drawGround 0  will disable the GroundMaterial
+
material
material
+
name GroundMaterial
name GroundMaterial
+
texture caution
addtexture http://cbg.bzflag.org/images/Panzer/borg/blackholes/nebula4.PNG
+
end
end
+
 
#Space Skybox
+
 
material
+
material
name skyboxBase
+
name LeftSkyboxMaterial
color 1 1 .99999999
+
texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox1.png
end
+
ambient 0.9 0.0 0.0 1.0
material  
+
end
name LeftSkyboxMaterial
+
 
matref skyboxBase
+
material
texture http://cbg.bzflag.org/images/Panzer/borg/borgskybox/skybox1.png
+
name FrontSkyboxMaterial
diffuse red
+
texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox2.png
end
+
ambient 0.8 0.0 0.0 1.0
material
+
end
name FrontSkyboxMaterial
+
 
matref skyboxBase
+
material
texture http://cbg.bzflag.org/images/Panzer/borg/borgskybox/skybox2.png
+
name RightSkyboxMaterial
diffuse yellow
+
texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox3.png
end
+
ambient 0.7 0.0 0.0 1.0
material
+
end
name RightSkyboxMaterial
+
 
matref skyboxBase
+
material
texture http://cbg.bzflag.org/images/Panzer/borg/borgskybox/skybox4.png
+
name BackSkyboxMaterial
diffuse green
+
texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox4.png
end
+
ambient 0.5 0.0 0.0 1.0
material
+
end
name BackSkyboxMaterial
+
 
matref skyboxBase
+
material
texture http://cbg.bzflag.org/images/Panzer/borg/borgskybox/skybox5.png
+
name TopSkyboxMaterial
diffuse blue
+
texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox5.png
end
+
ambient 0.4 0.0 0.0 1.0
material
+
end
name TopSkyboxMaterial
+
 
matref skyboxBase
+
material
texture http://cbg.bzflag.org/images/Panzer/borg/borgskybox/skybox3.png
+
name BottomSkyboxMaterial
diffuse purple
+
texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox6.png
end
+
ambient 0.3 0.0 0.0 1.0
material
+
end
name BottomSkyboxMaterial  
+
 
matref skyboxBase
+
#End Space Skybox
texture http://cbg.bzflag.org/images/Panzer/borg/borgskybox/skybox6.png  
+
diffuse white
+
end
+
#End Space Skybox
+
  
 
|}
 
|}

Revision as of 23:06, 7 February 2011

Skyboxes replace the normal scenery of BZFlag.

The material names needed to create a skybox are:

  • LeftSkyboxMaterial
  • RightSkyboxMaterial
  • TopSkyboxMaterial
  • BottomSkyboxMaterial
  • FrontSkyboxMaterial
  • BackSyboxMaterial


Working with Skyboxes.

Unless all six images load correctly, no skybox will be displayed. For this reason it is recommended to start with a working skybox, and change one texture at a time, testing each image one at a time. Colors are applied to this test world to assist in identifying left/right and front/back materials. Image size will be automatically scaled to fit. Maximum default image size for clients is 1024 by 1024 pixels. Power-of-two pixel dimensions are recommended, but not required. You will notice a thin black line in the corners, this is a bug. This thin black line is not seen on GNU/Linux. It may only be on Mac OSX.

It is important to have 6 _different_ materials. Even if they all should look the same make them differ using for example the ambient or shader properties.

Code

world name SkyboxMaterialTest size 230 end options -set _drawCelestial 0 -set _drawClouds 0 -set _drawGround 0 -set _drawGroundLights 0 -set _drawMountains 0 -set _wallHeight 0 -set _skyColor black

end

  1. http://trepan.bzflag.bz/horizontal_gradient_blue_begin_red_and_transparant_end.png
  2. For reference, Include the other two "Magic" Material names.
  3. TeleMaterial will be available in BZFlag version 3.0
  4. teleporter texture

material name GroundMaterial texture caution end


material name LeftSkyboxMaterial texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox1.png ambient 0.9 0.0 0.0 1.0 end

material name FrontSkyboxMaterial texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox2.png ambient 0.8 0.0 0.0 1.0 end

material name RightSkyboxMaterial texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox3.png ambient 0.7 0.0 0.0 1.0 end

material name BackSkyboxMaterial texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox4.png ambient 0.5 0.0 0.0 1.0 end

material name TopSkyboxMaterial texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox5.png ambient 0.4 0.0 0.0 1.0 end

material name BottomSkyboxMaterial texture http://images.bzflag.org/llegendary/Optic%20Delusion_skybox6.png ambient 0.3 0.0 0.0 1.0 end

  1. End Space Skybox