@warrenm Hey! - mind a quick q ? I am encoding depth 16 images (half float) as 2 8 bit unsigned chars (high/low for encoding), & want use in a metal shader. Is this doable? Can I make a half float from 2 8 bit values?
Sorry if obvious / dumb but hey thats where Im @ :D
-
-
Replying to @_vade
If you have the depth image data in that format, you can copy it to a texture of r16Float format and sample it in a shader by binding it as a texture2d<half, access::sample>. Feel free to DM for further detail, or if I'm misunderstanding.
1 reply 0 retweets 0 likes -
Replying to @warrenm
My depth texture is encoded as two channels of a BGRA unorm HEVC stream - I take the half float high and low bits to 8 bit r & g channels. Was curious how to re mix the two 8 but values in a shader post sample of the texture.
1 reply 0 retweets 0 likes -
Replying to @_vade
Maybe something like this? ushort d = (depthSample.r << 8) | depthSample.g; half depth = *reinterpret_cast<thread half *>(&d);
2 replies 0 retweets 1 like -
Replying to @warrenm
Oh interesting. Had no idea you could reinterpret cast in a shader. Shit. Ha. Thanks!
1 reply 0 retweets 1 like -
-
cursed fact
1 reply 0 retweets 2 likes -
Replying to @omershapira @_vade
There are darker timelines. Imagine doing bit hacks in a quasi-Swift MSL.
1 reply 0 retweets 2 likes -
ask DOOM to paint red channel in gl_FragCoord.xy I'm sorry I'm gonna quit before committing to this joke
1 reply 0 retweets 2 likes
Gimme a shading language based on SHRDLU > Does the ray [0 0 -1] hit anything? YES TWO THINGS THE BLUE PYRAMID AND THE BLUE BLOCK (obv called SHDRLU)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
