Skip to content

How to load 3D float filterable textures? #1491

Answered by kvark
ifsheldon asked this question in Q&A
Discussion options

You must be logged in to vote

If you are targeting WebGPU proper (i.e. the Web and most portable native configuration), then indeed R32F is not filterable. I don't think it's guaranteed to be filterable in OpenGL either, but this native API has higher tolerance for undefined behavior than we do.

At the same time, we don't have R16Unorm, which would seem appropriate here. Again, the reason here is that it's not portable.

The OpenGL uploading code you posted is guaranteed to be slow: it's not a data copy, it's an actual conversion of each texel to a new format (going from U16 to R32F).

My recommendation is to use R16Float here. It has effective 11 bits of precision, which is one bit short from what you need. If your dat…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ifsheldon
Comment options

@kvark
Comment options

@ifsheldon
Comment options

Answer selected by ifsheldon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants