Update README with shader optimization note

Add note on shader improvement for block position calculation.
This commit is contained in:
Rich Geldreich
2026-02-26 23:06:37 -05:00
committed by GitHub
parent 72bdebdeb9
commit 0f3fbcd886

View File

@@ -48,6 +48,8 @@ Many variations and optimizations of this basic idea are possible. *Now shader e
A simpler, [faster 5 tap filter variant is here](https://pastebin.com/jsF6nUZg). (This shader isn't quite compatible with the currently checked in Python sample, as it uses a new `maxLod` uniform to limit the max fetched mipmap level.) In practice, this simple shader usually looks just as good on most textures/images. ` textureQueryLod()` and `textureSize()` could also be used (with some API's) to simplify the shader further. A simpler, [faster 5 tap filter variant is here](https://pastebin.com/jsF6nUZg). (This shader isn't quite compatible with the currently checked in Python sample, as it uses a new `maxLod` uniform to limit the max fetched mipmap level.) In practice, this simple shader usually looks just as good on most textures/images. ` textureQueryLod()` and `textureSize()` could also be used (with some API's) to simplify the shader further.
*Note: both of these shaders can be slightly improved by subtracting a half texel offset before computing `blockPos`: `vec2 blockPos = mod(texelPos - vec2(.5, .5), blockSize);`. The next version of this sample will have this improvement.*
--- ---
## Performance ## Performance