Home Technical Talk

Convert Tiled Texture collection to Single Textures salvaging UV Data

I am using maps ripped from Tomb Raider 4 in unity(not commercially), and I ran into a problem. Because of the nature of TR4's texture properties, I cannot apply singular shaders per texture property because of the way my room rips handle their textures.
TR4 maps apply their textures by collecting different texture sections in 256x256 tiles, like so:
VxSSgft.png?1
the texture png contains SEVERAL different texture sections, and the uvs pull from each image to the corrosponding square to texture each section of the room.
Because i need different shaders for each texture section (such as water, or light), i need a way to seperate each texture section into different pngs, therefore, having unique materials for each.
I could do it manually, and then manually reapply the UV information by hand, but it would take FOREVER because of the nature and size of the rooms.
is there anyway to seperate tiled texture collections in any modeling software while still maintaining UV information?
I am using Blender 3d, 3ds Max, Autocad, Metasequioia, and Maya.

Replies

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    I would be surprised it there would be a way for this. You don't need to separate them by the way. You can simply use this texture in every shader, even if usually each will use just a little part of the texture.
  • buddygz
    the problem is though, i need different shaders for different sections. I need a shader that makes magenta transparent for some, and i also need a shader that makes the water transparent. If i use a shader to make the water transparent, it effects all textures in that tile collection.
    is there a shader method i can use in unity to solve this?
    is there a way to set a shader per object rather than material?
  • arrangemonk
    Offline / Send Message
    arrangemonk polycounter lvl 17
    you can alter the textures so you only need one shader
  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    buddygz wrote: »
    the problem is though, i need different shaders for different sections. I need a shader that makes magenta transparent for some, and i also need a shader that makes the water transparent. If i use a shader to make the water transparent, it effects all textures in that tile collection.
    is there a shader method i can use in unity to solve this?
    is there a way to set a shader per object rather than material?

    I don't remember the exact nomenclature for unity, but you would use the same texture in a few different shaders ie: So one for transparent magenta parts, one for water transparency and one regular shader with no transparency, and apply those to the corresponding parts.

    The only issue I could see is if the mesh only has 1 material id, then you would have to go and assign different ones to work.

    If you want to split the textures off into individual tiles for each section (which wouldn't be very efficient) you would need to set the UV tiling in the shader or texture (not sure where unity has it) to 4x4 and 4x8 for the non square ones.

    Again, splitting these up is not the way to go, keep the texture atlas as is, and have different shaders for opaque, transparent etc...
  • buddygz
    m4dcow wrote: »
    I don't remember the exact nomenclature for unity, but you would use the same texture in a few different shaders ie: So one for transparent magenta parts, one for water transparency and one regular shader with no transparency, and apply those to the corresponding parts.

    The only issue I could see is if the mesh only has 1 material id, then you would have to go and assign different ones to work.

    If you want to split the textures off into individual tiles for each section (which wouldn't be very efficient) you would need to set the UV tiling in the shader or texture (not sure where unity has it) to 4x4 and 4x8 for the non square ones.

    Again, splitting these up is not the way to go, keep the texture atlas as is, and have different shaders for opaque, transparent etc...

    so i've decided to write a shader(with multiple elements) to support all of that, but i am having a problem writing a shader that makes magenta (FF00FF) the alpha channel, i can't seem to find the right method.
    i know this is the wrong forum section for this, but can anyone help me out?
    and is there a way to write a shader with TWO alpha channels, one for the water, and one for the magenta?
  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    It would probably require a custom shader. The easiest way might be to edit the texture to have one version with the alpha for the water, and another version with the alpha for everything else.
Sign In or Register to comment.