Load single byte to texture in LWJGL/LibGDX -



Load single byte to texture in LWJGL/LibGDX -

i have luminance map in libgdx. utilize bytebuffer load pixels, works fine.

gdx.graphics.getgl20().glpixelstorei(gl20.gl_unpack_alignment, 1); gdx.graphics.getgl20().glteximage2d(gl20.gl_texture_2d, 0, gl20.gl_luminance, overviewblock.getwidth(), overviewblock.getheight(), 0, gl20.gl_luminance, gl20.gl_unsigned_byte, overviewbuffer);

however, have problem understanding how bytes translated floats in glsl. color based on integer, writing bytebuffer works charm. not sure how single byte color.

buffer.put((byte)255);

this not result in 1.0 value in glsl/opengl, if i'm not mistaken. right way values in glsl between 0 , 1.0, integer ranged 0 - 255?

i'm using buffer.write((byte)(integer number & 0xff)) write bytes recommended per comments.

libgdx lwjgl

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -