diff --git a/src/content/docs/reference/Buffers/noisetex.mdx b/src/content/docs/reference/Buffers/noisetex.mdx index 268e08a..fe8a69e 100644 --- a/src/content/docs/reference/Buffers/noisetex.mdx +++ b/src/content/docs/reference/Buffers/noisetex.mdx @@ -8,4 +8,4 @@ sidebar: ### `uniform sampler2D noisetex;` -This buffer stores a generated RGB white noise texture. The resolution of this texture can be configured with the `const int noiseTextureResolution` constant, and defaults to 256x256. The texture is always square, meaning its width and height are equal. \ No newline at end of file +This buffer stores a generated RGB white noise texture. The resolution of this texture can be configured with the [`noiseTextureResolution`](/reference/directives/constants/noisetextureresolution) constant, and defaults to 256x256. The texture is always square, meaning its width and height are equal. \ No newline at end of file diff --git a/src/content/docs/reference/Buffers/shadowtex.mdx b/src/content/docs/reference/Buffers/shadowtex.mdx index 315bef7..1f74ca6 100644 --- a/src/content/docs/reference/Buffers/shadowtex.mdx +++ b/src/content/docs/reference/Buffers/shadowtex.mdx @@ -18,5 +18,10 @@ These buffers are written to by [`shadow`](/reference/programs/shadow) program, These buffers only store information in a single channel, the red component. The shadow buffer precision is hardware/driver dependent, however most hardware uses either 24-bit or 32-bit precision. The resolution of the shadow pass can be controlled with the `shadowMapResolution` constant. +#### Hardware Sampling +[`shadowHardwareFiltering`](/reference/directives/constants/shadowhardwarefiltering) enables support hardware sampling (depth comparison mode) for hardware shadow filtering. This turns the shadowtex samplers into `sampler2DShadow` samplers, which when sampled take the full xyz coordinates of the shadow position. The passed z coordinate is then compared to the values in the buffer around the xy coordinate, and the result is the weighted average of these comparisons. This produces a filtering effect on the shadow with very little to no performance impact. More information can be found in the [Khronos Wiki](https://www.khronos.org/opengl/wiki/Sampler_Object#Comparison_mode). + +When hardware sampling is used, the texture read no longer returns the distance stored in the buffer, but the result of a filtering depth comparison. This prevents its use in algorithms such as PCSS that rely on the actual value stored in the buffer. However Iris enables the use of separate buffers for hardware sampling, `shadowtex0HW` and `shadowtex1HW`, while retaining the original functionality on the base shadowtex buffers. This requires the [`SEPARATE_HARDWARE_SAMPLERS`](/reference/directives/shadersproperties/flags) feature flag as well as setting [`shadowHardwareFiltering`](/reference/directives/constants/shadowhardwarefiltering) to true. + #### Legacy Aliases The alias `waterShadow` points to the same buffer as `shadowtex0`. If `waterShadow` is present anywhere in the code, then the alias `shadow` will point to the same buffer as `shadowtex1`, otherwise it will point to the buffer `shadowtex0`. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/ambientOcclusionLevel.mdx b/src/content/docs/reference/Directives/Constants/ambientOcclusionLevel.mdx new file mode 100644 index 0000000..d006ed6 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/ambientOcclusionLevel.mdx @@ -0,0 +1,13 @@ +--- +title: ambientOcclusionLevel +description: ambientOcclusionLevel +sidebar: + label: ambientOcclusionLevel + order: 3 +--- + +### `const float ambientOcclusionLevel = 1.0;` + +#### Location: any glsl file + +Sets the amount of vanilla ambient occlusion (AO) that is applied through the color vertex attribute. The default value is `1.0` (vanilla level), setting it to `0.0` will disable vanilla AO. Valid range for this value is `[0.0 - 1.0]`. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/centerDepthHalflife.mdx b/src/content/docs/reference/Directives/Constants/centerDepthHalflife.mdx new file mode 100644 index 0000000..538f554 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/centerDepthHalflife.mdx @@ -0,0 +1,13 @@ +--- +title: centerDepthHalflife +description: centerDepthHalflife +sidebar: + label: centerDepthHalflife + order: 3 +--- + +### `const float centerDepthHalflife = 1.0;` + +#### Location: any glsl file + +Sets the half life in ticks for the transition time for the [`centerDepthSmooth`](/reference/uniforms/general/centerdepthsmooth) uniform. The default value is 1 tick. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/drynessHalflife.mdx b/src/content/docs/reference/Directives/Constants/drynessHalflife.mdx new file mode 100644 index 0000000..05e3555 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/drynessHalflife.mdx @@ -0,0 +1,13 @@ +--- +title: drynessHalflife +description: drynessHalflife +sidebar: + label: drynessHalflife + order: 3 +--- + +### `const float drynessHalflife = 200.0;` + +#### Location: any glsl file + +Sets the half life in ticks for the transition from dry to wet weather for the [`wetness`](/reference/uniforms/general/wetness) uniform. The default value is 200 ticks. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/eyeBrightnessHalflife.mdx b/src/content/docs/reference/Directives/Constants/eyeBrightnessHalflife.mdx new file mode 100644 index 0000000..54e8048 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/eyeBrightnessHalflife.mdx @@ -0,0 +1,13 @@ +--- +title: eyeBrightnessHalflife +description: eyeBrightnessHalflife +sidebar: + label: eyeBrightnessHalflife + order: 3 +--- + +### `const float eyeBrightnessHalflife = 10.0;` + +#### Location: any glsl file + +Sets the half life in ticks for the transition time for the [`eyeBrightnessSmooth`](/reference/uniforms/general/eyebrightnesssmooth) uniform. The default value is 10 ticks. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/noiseTextureResolution.mdx b/src/content/docs/reference/Directives/Constants/noiseTextureResolution.mdx new file mode 100644 index 0000000..32b2130 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/noiseTextureResolution.mdx @@ -0,0 +1,13 @@ +--- +title: noiseTextureResolution +description: noiseTextureResolution +sidebar: + label: noiseTextureResolution + order: 3 +--- + +### `const int noiseTextureResolution = 256;` + +#### Location: any glsl file + +Sets the resolution for [`noisetex`](/reference/buffers/noisetex). This texture is always square, so the value applies to both x and y axes. The default value is 256. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/shadowDistance.mdx b/src/content/docs/reference/Directives/Constants/shadowDistance.mdx new file mode 100644 index 0000000..504d104 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/shadowDistance.mdx @@ -0,0 +1,15 @@ +--- +title: shadowDistance +description: shadowDistance +sidebar: + label: shadowDistance + order: 3 +--- + +### `const float shadowDistance = 160.0;` + +#### Location: any glsl file + +Sets the radius of the [shadow pass](/reference/programs/shadow) in blocks. The default value is 160 blocks. + +By default this does not cull geometry outside that distance, only applying a scaling factor to the shadow projection matrix. However setting [`shadowDistanceRenderMul`](/reference/directives/constants/shadowdistancerendermul) to a positive value will apply culling. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/shadowDistanceRenderMul.mdx b/src/content/docs/reference/Directives/Constants/shadowDistanceRenderMul.mdx new file mode 100644 index 0000000..d51d17f --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/shadowDistanceRenderMul.mdx @@ -0,0 +1,15 @@ +--- +title: shadowDistanceRenderMul +description: shadowDistanceRenderMul +sidebar: + label: shadowDistanceRenderMul + order: 3 +--- + +### `const float shadowDistanceRenderMul = -1.0;` + +#### Location: any glsl file + +Sets the culling distance multiplier for the [shadow pass](/reference/programs/shadow). + +By default this value is `-1`, which means geometry outside the [`shadowDistance`](/reference/directives/constants/shadowdistance) are not culled. Setting this to a positive value applies culling to geometry outside `shadowDistance * shadowDistanceRenderMul` blocks from the camera. For example, `1.0` culls outside [`shadowDistance`](/reference/directives/constants/shadowdistance), `0.5` culls outside half of [`shadowDistance`](/reference/directives/constants/shadowdistance), and `2.0` culls outside twice [`shadowDistance`](/reference/directives/constants/shadowdistance). `shadowDistanceRenderMul` has no effect on the scale of geometry in the [shadow pass](/reference/programs/shadow). \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/shadowHardwareFiltering.mdx b/src/content/docs/reference/Directives/Constants/shadowHardwareFiltering.mdx new file mode 100644 index 0000000..85807c1 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/shadowHardwareFiltering.mdx @@ -0,0 +1,13 @@ +--- +title: shadowHardwareFiltering +description: shadowHardwareFiltering +sidebar: + label: shadowHardwareFiltering + order: 3 +--- + +### `const bool shadowHardwareFiltering = true;` + +#### Location: any glsl file + +Enables hardware shadow sampling (depth comparison mode) for [`shadowtex`](/reference/buffers/shadowtex) buffers. See [Hardware Sampling](/reference/buffers/shadowtex) for more info. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/shadowIntervalSize.mdx b/src/content/docs/reference/Directives/Constants/shadowIntervalSize.mdx new file mode 100644 index 0000000..b4e6322 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/shadowIntervalSize.mdx @@ -0,0 +1,15 @@ +--- +title: shadowIntervalSize +description: shadowIntervalSize +sidebar: + label: shadowIntervalSize + order: 3 +--- + +### `const float shadowIntervalSize = 1.0;` + +#### Location: any glsl file + +Sets the snapping interval for the [shadow pass](/reference/programs/shadow) in blocks. + +By default the [shadow pass](/reference/programs/shadow) "snaps" geometry to the block grid, which means at the player moves, the geometry in the shadow pass only shifts when the player crosses the boundary between blocks. This is done to reduce visual jittering/noise in the shadows when moving. This interval can be configured with `shadowIntervalSize` (e.g. `2.0` would snap to every other block, `0.5` snaps to every half block), or disabled outright by setting the value to `0.0`. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/shadowMapFov.mdx b/src/content/docs/reference/Directives/Constants/shadowMapFov.mdx new file mode 100644 index 0000000..8ccf9a2 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/shadowMapFov.mdx @@ -0,0 +1,15 @@ +--- +title: shadowMapFov +description: shadowMapFov +sidebar: + label: shadowMapFov + order: 3 +--- + +### `const float shadowMapFov = 90.0;` + +#### Location: any glsl file + +Sets the FOV (field of view) for the shadow pass. + +By default the shadow map uses orthographic rendering, which produces directional shadows which don't appear to come from a single point but instead a direction. Setting the FOV value however will change the rendering to a projection similar to the primary scene camera. This can be used to produce projected scene-like rendering similar to the [gbuffers](/reference/programs/gbuffers) programs, but from the [shadow pass](/reference/programs/shadow). \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/shadowMapResolution.mdx b/src/content/docs/reference/Directives/Constants/shadowMapResolution.mdx new file mode 100644 index 0000000..03a52dd --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/shadowMapResolution.mdx @@ -0,0 +1,13 @@ +--- +title: shadowMapResolution +description: shadowMapResolution +sidebar: + label: shadowMapResolution + order: 3 +--- + +### `const int shadowMapResolution = 1024;` + +#### Location: any glsl file + +Sets the resolution for [`shadowtex`](/reference/buffers/shadowtex) and [`shadowcolor`](/reference/buffers/shadowcolor) buffers used in the [shadow pass](/reference/programs/shadow). These buffers are always square, so the value applies to both x and y axes. The default value is 1024. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/sunPathRotation.mdx b/src/content/docs/reference/Directives/Constants/sunPathRotation.mdx new file mode 100644 index 0000000..a7f6563 --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/sunPathRotation.mdx @@ -0,0 +1,13 @@ +--- +title: sunPathRotation +description: sunPathRotation +sidebar: + label: sunPathRotation + order: 3 +--- + +### `const float sunPathRotation = 0.0;` + +#### Location: any glsl file + +Sets the angle rotation in degrees of the sun/moon perpendicular to their direction of travel. The default value of `0.0` has the sun/moon travel in the highest arch directly over the top of the sky dome. A larger value (negative or positive) will rotate that path such that it does not cross directly over the top of the sky dome. \ No newline at end of file diff --git a/src/content/docs/reference/Directives/Constants/wetnessHalflife.mdx b/src/content/docs/reference/Directives/Constants/wetnessHalflife.mdx new file mode 100644 index 0000000..116c56f --- /dev/null +++ b/src/content/docs/reference/Directives/Constants/wetnessHalflife.mdx @@ -0,0 +1,13 @@ +--- +title: wetnessHalflife +description: wetnessHalflife +sidebar: + label: wetnessHalflife + order: 3 +--- + +### `const float wetnessHalflife = 600.0;` + +#### Location: any glsl file + +Sets the half life in ticks for the transition from wet to dry weather for the [`wetness`](/reference/uniforms/general/wetness) uniform. The default value is 600 ticks. \ No newline at end of file diff --git a/src/content/docs/reference/Uniforms/General/centerDepthSmooth.mdx b/src/content/docs/reference/Uniforms/General/centerDepthSmooth.mdx index 3130650..2f77653 100644 --- a/src/content/docs/reference/Uniforms/General/centerDepthSmooth.mdx +++ b/src/content/docs/reference/Uniforms/General/centerDepthSmooth.mdx @@ -8,4 +8,4 @@ sidebar: ### `uniform float centerDepthSmooth;` -This uniform stores the value in the depth buffer `depthtex0` at the center of the screen, smoothed over time. The speed of the smoothing can be controlled with `centerDepthSmoothHalflife`, a `const` `float` which stores the transition halflife in ticks. \ No newline at end of file +This uniform stores the value in the depth buffer `depthtex0` at the center of the screen, smoothed over time. The speed of the smoothing can be controlled with [`centerDepthHalflife`](/reference/directives/constants/centerdepthhalflife). \ No newline at end of file diff --git a/src/content/docs/reference/Uniforms/General/wetness.mdx b/src/content/docs/reference/Uniforms/General/wetness.mdx index a83dbde..2d0c55c 100644 --- a/src/content/docs/reference/Uniforms/General/wetness.mdx +++ b/src/content/docs/reference/Uniforms/General/wetness.mdx @@ -9,6 +9,6 @@ sidebar: ### `uniform float wetness;` This uniform outputs the current strength of rain and is non-zero when there is currently a rain storm (e.g. weather set rain). The value ranges between `0` to `1` where `0` means no rain and `1` means rain storm, the value is interpolated between those values during transitions in weather. -The transition is significantly slower, and can be controlled with `wetnessHalfLife`. +The transition is significantly slower, and can be controlled with [`wetnessHalfLife`](/reference/directives/constants/wetnesshalflife). See also - [`rainStrength`](/reference/uniforms/general/rainstrength) \ No newline at end of file