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:
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
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...
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?