sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Resolution of pre-distorted textures

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 212 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • OricAtmosO Offline
      OricAtmos
      last edited by

      Hi,

      I'm working on a model exporter plugin (to AC3D format) and I'm wondering whether there is a way to increase the resolution of pre-distorted texture files that are written by the TextureWriter for faces which have their texture distorted in such a way that the distortion can't be represented simply by UV coordinates. The problem is that the pre-distorted textures have very low resolution and look very grainy.

      Update: the problem is mostly with small tilable textures, because the TextureWriter apparently uses the original texture size when writing the pre-distorted texture. So when there's a small texture that has been tiled and distorted the written texture is pre-distorted and also pre-tiled but has the same pixel size as the original small texture.
      I think it would make more sense to increase the written texture size by the same factor with which the original texture has been tiled on a face.

      Here is an example:
      This is the original texture
      This is how it looks in SketchUp
      This is what was written by the TextureWriter
      This is how it looks in a 3D viewer

      Thanks
      Ralf

      1 Reply Last reply Reply Quote 0
      • A Offline
        Aerilius
        last edited by

        The API does not provide any controls for this.

        What you can do (if your application supports distorted texture coordinates) is to export the original texture image (create a temporary group, apply the material and write it through TextureWriter).

        Or you export the original texture image and apply the distortion with an external image processing library (like imagemagick), according to settings of your choice )like double the image resolution).

        The problem is not trivial. I once tried to do a better "Make texture unique", but it's hard to determine the best texture size because the resolution of a distorted texture in the model varies a lot. For example one could sample the texture resolution in the center of the face, but then the upper right corner in your example would have too high resolution whereas the lower left corner would still be blurry.

        1 Reply Last reply Reply Quote 0
        • OricAtmosO Offline
          OricAtmos
          last edited by

          Thanks for the suggestions! You're right, there's no single "tiling factor" in a distorted texture. I think I'll ignore this problem for now and solve more important issues first.

          By the way, is there perhaps some kind of exporter plugin template that does all the complicated stuff of getting the needed model information out of SketchUp? Something that's only missing the actual writing of the target file format.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement