Elektrine lite

← Feed

@mcc@mastodon.social

2026-10-23 18:04 UTC

@cwebber@social.coop It's reading from a texture by pixel offset instead of using a sampler!! It's only available in WebGPU and Vulkan (presumably equivalent apis such as metal and DX13) https://www.w3.org/TR/WGSL/#textureload and is probably an inherently poor fit for inclusion in blender I'm drawing sprites!! Why am I converting my coordinates to a dang float and back again!! All that does is introduce rounding errors when I write my multiplications and divisions in the wrong order!!

Replies (4)

  • @cwebber@social.coop 2026-10-23 18:28

    @mcc@mastodon.social are you telling me that IEEE floating point isn't your preferred way to make integers

    Open ##5216749

  • @mcc@mastodon.social @cwebber@social.coop What do you mean by "only available in WebGPU and Vulkan"? It's been part of OpenGL (well, of GLSL) for ages as well: https://registry.khronos.org/OpenGL-Refpages/gl4/html/texelFetch.xhtml

    Open ##5261423

  • @mcc@mastodon.social @cwebber@social.coop A storage image has never surprised me and that's a good thing

    Open ##5261425

  • @mcc@mastodon.social @cwebber@social.coop texelFetch() with direct integer coordinates works fine in WebGL2 and GLES3 btw, e.g. you don't need a modern API for that. Technically it's still associated with a sampler (because of GL's combined-image-samplers) but I guess the sampler properties are ignored. I use that in various sokol samples (e.g. here loading data from a texture in a vertex shader: https://floooh.github.io/sokol-html5/ozz-skin-sapp.html

    Open ##5261428