assurance-tunnel
assurance-tunnel
assurance-tunnel
assurance-tunnel

[ANSWERED] 16-Bit Textures for GLSL?


  • Beta Tester

    Hi-

    Is there a way to use 16-bit textures in Isadora? I'm attempting to make a simple resampling shader, but the output is pixelated because it seems as though the texture I'm using as the UV map is being converted to 8-bit. All I found regarding bit depth in Izzy is an old post (https://community.troikatronix...). Has this changed at all? Is it possible to use higher bit depths for shaders? 

    I believe my code is fine (attached below for reference), because it works in TouchDesigner (with some interface modifications). I can reproduce the pixellation issue in TD by lowering the bit depth of the image.

    UV Map

    Any advice would be appreciated- thanks!

    : j

    // GLSL below //

    uniform sampler2D tex0;
    uniform sampler2D tex1;

    void main(void) {
    vec3 uv = texture2D(tex1, gl_TexCoord[0].xy).rgb;
    vec3 c0 = texture2D(tex0, uv.xy).rgb;

    gl_FragColor = vec4(c0, 1.0);
    }


  • Tech Staff

    @Fred 

    You're much smarter and far more shader-savvy than I am. Any thoughts on this?

    Best wishes,

    Woland



  • @jg said:

    Is there a way to use 16-bit textures in Isadora?

    At the moment, no. All textures in Isadora are 8-bit ARGB. That is something we hope to change in a future release, because having 10 bit textures (at least) would improve the look of fine gradations.

    But what confuses me is that the image you provided above is only 8 bit in the first place. Here's the info for your picture using the macOS command sips:

      pixelWidth: 1024
      pixelHeight: 576
      typeIdentifier: public.png
      format: png
      formatOptions: default
      dpiWidth: 72.000
      dpiHeight: 72.000
      samplesPerPixel: 4
      bitsPerSample: 8
      hasAlpha: yes
      space: RGB

    As you can see there are only 8 bits per pixel. So why would a 16 bit texture solve the problem? It would just be the 8 bit values multiplied by 256.

    Best Wishes,
    Mark


  • Beta Tester

    I believe the forum resizes it on upload or something. It seems to have changed the name as well- I uploaded "uvWarp.png" (dropbox link here: Dropbox), but when I download the file back from the forum, the file name has been changed to "1595643849000-uvwarp-resized.png." It seems like both the resolution and bit depth change in that process.


    : j



  • @jg said:

    I believe the forum resizes it on upload or something.

     Yes, you are correct. It shows your file from dropbox to be 16 bit. It's really good to know that the forum does stuff to these images... I was unaware of that.

    Best Wishes,
    Mark

      pixelWidth: 1280
      pixelHeight: 720
      typeIdentifier: public.png
      format: png
      formatOptions: default
      dpiWidth: 72.000
      dpiHeight: 72.000
      samplesPerPixel: 4
      bitsPerSample: 16
      hasAlpha: yes
      space: RGB
      profile: Generic RGB Profile

    Best Wishes,
    Mark



  • @jg how did you generate the 16bit image? it is static, could you split it into 2 8 bit images and use that inside Isadora with another texture input and then calculate a 16bit value from the 2 8 bit values.


Log in to reply