You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
result = mix(textureCoordinate1, textureCoordinate2, fract(logDepth))
59
-
```
53
+
In the vertex shader, where $worldPosition$ is the vertex position in world coordinates and $eyeSpace$ is the vertex position in camera coordinates:
54
+
55
+
$$customUvCoords = worldPosition + offset$$
56
+
$$\text{if }isPerspectiveProjection \text{:}$$
57
+
$$customUvCoords.z = -eyeSpace.z$$
58
+
$$\text{if }isOrthographicProjection \text{:}$$
59
+
$$customUvCoords.z = frustumWidth$$
60
+
61
+
The resulting $customUvCoords.xy$ should contain the vertex's X and Y position in world coordinates. $customUvCoords.z$ is the negative eye-space depth (z-coordinate) from the camera to the fragment when using perspective projection. Since all points are equidistant to the camera when using orthographic projection, this value should be set to the frustum width as a proxy for zoom level.
>Note: the addition of $\lfloor logDepth \rfloor + 1$ when calculating $textureCoordinates_2$ allows the result of the $mix$ function to blend between two adjacent mipmap levels.
71
+
72
+
Where $clamp(x, minVal, maxVal)$ constrains the value of $x$ to the range of $minVal$ to $maxVal$, defined by the [GLSL definition](https://registry.khronos.org/OpenGL-Refpages/gl4/html/clamp.xhtml) of:
73
+
74
+
$$\min(\max(x, minVal), maxVal)$$
75
+
76
+
$fract(x)$ returns the fractional part of $x$, defined by the [GLSL definition](https://registry.khronos.org/OpenGL-Refpages/gl4/html/fract.xhtml) of:
77
+
78
+
$$x - \lfloor x \rfloor$$
79
+
80
+
and $mix(x, y, a)$ performs a linear interpolation between $x$ and $y$ using $a$ to weight between them, using the [GLSL definition](https://registry.khronos.org/OpenGL-Refpages/gl4/html/mix.xhtml) of:
Copy file name to clipboardExpand all lines: extensions/2.0/Vendor/EXT_textureInfo_constant_lod/schema/textureInfo.EXT_textureInfo_constant_lod.schema.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
},
16
16
"offset": {
17
17
"type": "array",
18
-
"description": "The offset of the UV coordinate origin as a factor of the texture dimensions.",
18
+
"description": "The offset in meters used to shift the texture.",
0 commit comments