How to tile textures for 3dmodels in Jitter?

    May 21 2013 | 6:48 pm
    Can anymody tell me how to tile textures for 3d models? I am able to get a texture onto a 3d model, but the texture needs to be scaled. Obviously I could create a tiled texture, but thats not very efficient, right?

    • May 21 2013 | 7:04 pm
      You could do this using a pretty simple custom shader, but I don't know of a built-in way to apply scaled/tiled textures without manipulating the UVs of the model.
    • May 21 2013 | 7:12 pm
      "pretty simple" sounds fantastic, "shader" not so - more lake serious head scratching.
      But thanks, I will dive into it, then...I guess I will start with td.kaleido.jxs
    • May 21 2013 | 7:42 pm
      you can override the model's uv coordinates by enabling @tex_map on the model.
      tiling is achieved by setting the @wrap attribute of a non-rectangular texture (@rectangle 0) to repeat, or mirroredrepeat.
      not sure if that's what you're looking for.
    • May 21 2013 | 8:18 pm
      Hmm, close, but its not really what I need. I do have UV's, and dont want to have them generated, and I would like to do it with, because I also would like to use the hightmap_texture. Usually 3d animation programms (I am using blender) have in their texture settings the ability to repeat (or tile) the image and it is possible to say how many times to repeat in each axis before the newly generated texture it is applied to the models UV's.
      Maybe I have to do it the same way, loading the texture, then repeating it, and then apply it to the material. but this gives in my case a very large texture (if I wanna keep the details).
    • May 21 2013 | 11:02 pm
      For reference, here's a shader that does texture tiling. It obviously doesn't do all the cool stuff that does, but if you wanted to go this way, it's not super complicated. In a lot of 3D apps, this sort of thing is part of the default material shaders that are applied when rendering.
    • May 22 2013 | 9:03 am
      Thank you for your patch. I adapted it to how I understand how to approach texture tiling with
      I am using the td.kaleido.jxs shader with a object to tile the texture bevor sending it to the
    • May 22 2013 | 6:28 pm
      nice solution. for the record, you can do the same thing with drawgroup materials (overriding the diffuse-texture for a single material)
    • May 22 2013 | 8:02 pm
      excellent. now I also understand the function of "sendmaterial": it allows to access the imported materials with collada files and the likes. is it possible to send a complete material (defined with a object) to a drawgroup aswell? or even reference it?
    • May 22 2013 | 9:00 pm
      sure thing. send the "export_material" and "import_material" messages as args to the "sendmaterial" message.