Distant Horizons
Distant Horizons is a mod which enables far greater render distances through the use of LODs. Iris allows shaders to integrate with this mod, ensuring that the blend between the vanilla terrain and the DH terrain can be seamless.
Programs
Terrain
Terrain gets the program dh_terrain
. This runs before normal terrain.
Water
Water gets the program dh_water
. This runs before normal water.
Shadow
Shadow pass gets the program dh_shadow
. This runs before shadow terrain and shadow water respectively. The shadow pass retains the normal textures and projection.
Attributes
The following attributes are supported in DH programs:
gl_Vertex
gl_MultiTexCoord2
gl_Normal
gl_Color
dhMaterialId
The following built in uniforms are supported:
gl_ModelViewMatrix(Inverse, etc)
gl_ProjectionMatrix(Inverse, etc)
gl_NormalMatrix
Definitions/Properties
Enabling the DH shadow pass
The DH shadow pass is automatically enabled. It can be turned on or off with the shader property dhShadow.enabled
.
Distant Horizons has no set shadow distance; all chunks will be rendered.
Checking for Distant Horizons
All programs and properties have the DISTANT_HORIZONS
define set if DH is enabled.
Samplers
Depth textures
There are two depth textures attached to Distant Horizons;
dhDepthTex0
and dhDepthTex1
. These behave identically to their non-DH counterparts, except they have different near/far planes (explained below) and only contain DH terrain/water.
Uniforms
dhNearPlane
Declaration
This uniform specifies the near plane of DH’s projection. This does not apply to the shadow pass.
dhFarPlane
Declaration
This uniform specifies the far plane of DH’s projection. This is not the render distance! Use dhRenderDistance
for that.
dhRenderDistance
Declaration
This uniform specifies the render distance currently set in DH.
dhProjection and variants
Declaration
This is the projection matrix for the non-shadow pass of Distant Horizons. This includes a different near and far plane, see the uniforms above.
Block IDs
Normal block IDs (mc_Entity
) are not supported.
Iris provides “mini-IDs” in the form of int dhMaterialId
automatically declared.
All Mini-ID’s get their own definitions that can be used in any program.