Forum Discussion
waynecochran
9 months agoProtege
Using RGBA_F16 for textures not quite right.
I have no problem creating SceneTexture objects using ARGB_8888 bitmaps, but when I try to use RGBA_F16 the resulting textures are stretched like it is only reading 8-bit data. Here is an example of how I am trying to create an RGBA_F16 bitmap from a W*H buffer (named sdf) of Float's (I am treating these a "gray" values -- i.e. using the same value for RGB and using 1 for alpha):
val sdfBitmap = Bitmap.createBitmap(W, H, Bitmap.Config.RGBA_F16)
val buffer = ByteBuffer.allocate(W*H * 8).order(ByteOrder.nativeOrder())
for (i in sdf.indices) {
var g16 : Short = Half.toHalf(sdf[i])
var a16 : Short = Half.toHalf(1.0f)
buffer.putShort(g16)
buffer.putShort(g16)
buffer.putShort(g16)
buffer.putShort(a16)
}
buffer.rewind()
sdfBitmap.copyPixelsFromBuffer(buffer)I am create the texture as follows
val sdfTexture = SceneTexture(sdfBitmap, samplerConfig)which is later used for SceneMaterial with a custom shader.
Are RGBA_F16 textures supported or am I doing something wrong? Maybe byte order is different?
1 Reply
Replies have been turned off for this discussion
- dav-sMeta Employee
Hi!
We only support ARGB_8888 bitmaps in the current version.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 months ago
- 10 months ago
- 9 months ago
- 14 days ago