16 bit textures #7289
Unanswered
omri-polycam
asked this question in
Q&A
16 bit textures
#7289
Replies: 1 comment 3 replies
-
Filament itself uses an RGB16F texture sampled for every pixel of every lit material:
This works with every backend on every platform. The sampler for it uses |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys,
I'm trying to use 16 bit per component textures and cannot seem to get it to work. I'm using this to encode XYZ coordinates as a
std::uint16_t
unsigned integer in each color component of each texel of an RGB texture and this texture is sampled in a custom vertex shader. The failure mode is that it seems that whenever using thetexture(...).rgb
function in the vertex shader it always evaluates to (0, 0, 0).I've already verified that my shader works when encoding the coordinates as
std::uint8_t
color components in a common 8 bit per component RGB texture (Texture::Format::RGB
,Texture::Type::UBYTE
,Texture::InternalFormat::RGB8
). I've also verified using a debugger that I'm passing in reasonablestd::uint16_t
encoded coordinates into the texture data.I've tried (
Texture::Format::RGB_INTEGER
,Texture::Type::USHORT
,Texture::InternalFormat::RGB16UI
) with no success. I've also tried (Texture::Format::RGB
,Texture::Type::HALF
,Texture::InternalFormat::RGB16F
) with the same texture sampling always evaluating to a 0 vector no matter what data I pass into the texture pixel buffer descriptor.I'm currently running on MacOS with the metal backend but will also need this to work on iOS/Metal, Android/GL and WebAssembly/GL. Does anybody know if I'm passing the wrong texture format, type and internal format enumerations? Is there something special I need to do in my vertex shader? Is there something I need to set for
format
orprecision
in mysampler2d
parameter in my material? Ideallytexture(...).rgb
evaluates to a 3D float vector with components from 0 to 1, but it's easy enough to work around if it evaluates from 0 to 65,535 as an integer. Any help is appreciated!Thanks,
Omri
Beta Was this translation helpful? Give feedback.
All reactions