Material shader for Texture


    Feb 24 2010 | 11:50 am
    Hi, I would like to apply to a gl.mesh's texture (it could be a videoplane texture too !) materials shader (mat.glass,…)
    I've tried to bind the texture and set sampler2DRect… But I'm pretty newbie in gl.shader…
    Any help would be pretty appreciated.
    Thx.
    Ad.

    • Feb 24 2010 | 5:51 pm
      something like this?
    • Feb 25 2010 | 7:47 am
      Thank you for your response; If i use your code as a single shader, it gives nothing else than a back sea !
      Is this more like a program that I would have to bind in the futures shaders ?
      Ad.
    • Feb 25 2010 | 6:23 pm
      a few issues with the shader. a single texture parameter should be bound to int 0, not int 1 (assuming you only have one texture bound). second, for rectangular textures you're going to want to multiply the texcoord by the gl_TextureMatrix before sending to the fragment shade.
      here's modified shader code and a simple test patch:
      save as simple.jxs:
      test patch
    • Feb 25 2010 | 6:29 pm
      Good one rob!
    • Feb 28 2010 | 7:26 am
      Is the previous example working with sampler2D?