jit.gl.texture @dim broken?


    Jun 20 2006 | 12:05 pm
    Hi, I really need to know the size of the texture loaded into the jit.gl.texture object, but no matter what file I load, I always get dim 255 255 0 returned.
    Please tell me I'm missing something.
    (windows xp, jitter1.5.2, max4.5.7)
    -thijs

    • Jun 20 2006 | 2:18 pm
      What do you see that's wrong here? Everything looks good to me. I would expect to get 256 256 0 which is what I get with jitter 1.5.2 on osx.
      wes
    • Jun 20 2006 | 2:33 pm
      Ah sorry I meant to write 256 256 0 instead of 255 255 0 :-
      What I hoped to see was the dimensions of the file that is loaded. Otherwise how can you know how big your texture is? And what does 256 256 0 stand for if it's not the texture size?
      -thijs
    • Jun 20 2006 | 2:44 pm
      Fair enough. It actually does work....just not right away. The texture has to be bound before its adapt attribute will kick in a resize the texture and change the dim attribute. This is because Jitter is a very harsh environment for opengl and textures are sensitive creatures that need a proper home in a living opengl context. So, jit.gl.texture exhibits some delayed behavior that only kciks in when you actually use the thing. This patch shows that it works.
      best, wes
    • Jun 20 2006 | 3:17 pm
      Can I post that to cuteoverload.com? That made my heart warm and fuzzy! I kid I kid!
      v a d e //
      www.vade.info abstrakt.vade.info
    • Jun 20 2006 | 3:36 pm
      aha! thanks a lot wes. I was getting really nervous about my deadline in 2 days:-)
      In case anyone cares, I use this to do relative blurring of the texture. If you project a large texture onto an object, and then scale it down, the texture looks really ugly because the downsampling doesn't do interpolation. Joshua suggested to use a blurring shader. This looks really nice, but you have to set the width attribute of the shader relative to downsampling factor. To calculate the downsampling factor I needed the texture dimensions and the object scaling.
      I guess it's going to work now. Thanks again.
      best, -thijs