This page is incomplete! You can contribute information using GitHub issues or pull requests.

shader_environment is intended for opaque and alpha-tested surfaces in BSPs. A key feature of this shader is its ability to blend between two detail maps, making it ideal for outdoor ground shaders. It also supports cubemaps, bump maps, and masked specularity which can be used for metallic surfaces like Forerunner structures.

Bump maps

Bump maps are textures that add additional local surface shape information for reflections and lighting. They are represented as standard normal maps once converted from source by Tool or invader-bitmap into a bitmap tag. They are not height maps and Halo doesn't support tessellation or parallax occlusion.

Use bump maps in your environment shaders to give the surface a bumpy appearance when dynamic light sources light explosions or flashlights are nearby, and when illuminated by lightmaps. Unfortunately bump maps are not visible by lightmaps alone in H1PC and H1CE. Support for environmental bump mapping like Xbox had was added back in H1A.

When the "is alpha tested" flag is checked, the bump map's alpha channel can be used to mask the material. In this case, the material is either fully opaque or fully transparent depending on the alpha value. The billboard trees outside Timberland make use of this feature.

Use by gbxmodels

When a gbxmodel references this shader type it will not render correctly in H1CE due to renderer bugs. Specular masking and tinting don't work and sky fog does not render over it. Some affected scenery include the teleporter base and human barricades.

It is not recommended to use this shader type for custom objects when targeting Custom Edition. It is fixed in H1A.

Structure and fields

This tag inherits fields from shader which are not shown here. See the parent's page for more information. The following information is unique to the shader_environment tag.

Field Type Comments
shader environment flags bitfield
Flag Mask Comments
alpha tested 0x1
bump map is specular mask 0x2
true atmospheric fog 0x4
shader environment type enum
Option Value Comments
normal 0x0
blended 0x1
blended base specular 0x2
lens flare spacing float

Determines how far apart BSP lens flares are generated, in world units, along a surface part using this shader. If set to 0, a single lens flare will be created at the center of the surface.

lens flare TagDependency: lens_flare

References the lens flare to be rendered at the generated lens flare markers. If empty, no lens flares will be generated.

diffuse flags bitfield
Flag Mask Comments
rescale detail maps 0x1
rescale bump map 0x2
base map TagDependency: bitmap
detail map function enum
Option Value Comments
double biased multiply 0x0
multiply 0x1
double biased add 0x2
primary detail map scale float
  • Default: 1
primary detail map TagDependency: bitmap
secondary detail map scale float
  • Default: 1
secondary detail map TagDependency: bitmap
micro detail map function enum?
micro detail map scale float
  • Default: 1
micro detail map TagDependency: bitmap
material color ColorRGB
bump map scale float
  • Default: 1
bump map TagDependency: bitmap
bump map scale xy Point2D
  • Cache only
Field Type Comments
x float
y float
u animation function enum
Option Value Comments
one 0x0
zero 0x1
cosine 0x2
cosine variable period 0x3
diagonal wave 0x4
diagonal wave variable period 0x5
slide 0x6
slide variable period 0x7
noise 0x8
jitter 0x9
wander 0xA
spark 0xB
u animation period float
  • Unit: seconds
  • Default: 1
u animation scale float
  • Unit: base map repeats
  • Default: 1
v animation function enum?
v animation period float
  • Unit: seconds
  • Default: 1
v animation scale float
  • Unit: base map repeats
  • Default: 1
self illumination flags bitfield
Flag Mask Comments
unfiltered 0x1
primary on color ColorRGB
primary off color ColorRGB
primary animation function enum?
primary animation period float
  • Unit: seconds
  • Default: 1
primary animation phase float
  • Unit: seconds
secondary on color ColorRGB
secondary off color ColorRGB
secondary animation function enum?
secondary animation period float
  • Unit: seconds
  • Default: 1
secondary animation phase float
  • Unit: seconds
plasma on color ColorRGB
plasma off color ColorRGB
plasma animation function enum?
plasma animation period float
  • Unit: seconds
  • Default: 1
plasma animation phase float
  • Unit: seconds
map scale float
  • Default: 1
map TagDependency: bitmap
specular flags bitfield
Flag Mask Comments
overbright 0x1
extra shiny 0x2
lightmap is specular 0x4
brightness float
  • Min: 0
  • Max: 1
perpendicular color ColorRGB
parallel color ColorRGB
reflection flags bitfield
Flag Mask Comments
dynamic mirror 0x1
reflection type enum
Option Value Comments
bumped cube map 0x0
flat cube map 0x1
bumped radiosity 0x2
lightmap brightness scale float
  • Min: 0
  • Max: 1
perpendicular brightness float
  • Min: 0
  • Max: 1
parallel brightness float
  • Min: 0
  • Max: 1
reflection cube map TagDependency: bitmap

Acknowledgements

Thanks to the following individuals for their research or contributions to this topic:

  • Kavawuvi (Invader tag definitions)
  • MosesOfEgypt (Tag structure research)