Hello Polycounters,
I'm experimenting with some texturing workflows in UDK and was wondering if I could ask a couple questions as well as get your input on the following:
I have my uvs for a number of objects set up the in the following format(using multi-tile textures):
The closest I have come to figuring it out is using the terraintLayerCoords node in the Material Editor, which allows you to change the Mapping Pan in u and v. In other words it basically lets you slide the uvs in x or y position. The only problem is that uvs seem to tile or wrap outside the 0-1 space, keeping me from accessing the uvs I have set up outside the 0-1 space.
Issue demonstrated here:
values at default
wrapping texture problem
I would like to type in a value of 1,0 in mapping pan u to access my second set of Uvs. However, inputting (1,0) gives me the same image. I did (1.5, 0) to demonstrate the wrapping effect of the texture.
I guess what I'm looking for is a way to turn off the wrap in u and v. To get the multi tile textures to work in maya, there are checkboxes in the 2d placement node to turn this off, and then in the same node you use translate to place each texture over its respective uv layout.
Is there are similar way to do this in UDK, or perhaps an easier method to do this?
As I type this, uv sets are jumping to mind as an alternative. Would that allow me to do the same thing with different steps? If so, is there a limit to the number of uv sets I can have?
If you've read my lengthy inquiry, I thank you:)
tl;dr: Can multi tile textures work in UDK(if so, how?), or should I just use multiple uv sets? If uv sets, how many sets am I limited to? Thanks:)
Replies
There's a field you can set to WRAP, CLAMP, or REPEATEDGEPIXEL, iirc. You want clamp.
Then, it's a matter of offsetting UVs of each texture paths in your material and lerping or adding them together.
Course, you could just apply a second material to those faces in maya and then itll import with two material slots to fill. Costwise, that adds drawcalls, but is the normal pipeline for doing this sort of thing.
Also, wouldnt scaling down my maps to fit all within the 0-1 space crush my resolution when I go to texture them? The reason I have multiple tiles is so I can maintain a decent amount of resolution on multiple objects. I.e. if all my shells were on one map, they would be too small to receive enough pixel resolution.
I didnt know about turning on the clamp option in the texture properties, so thanks for that tip! I will check into it and see if it helps.
And as always, if there is an easier way to do this, I am all ears. blankslatejoe, I think you already mentioned one, but I am just confused as to what you meant exactly.
Thats definitely the easiest--and most common way to add multiple materials to an object. No need to set textures to clamping or anything if you do that, either. If you've got special circumstances (super low spec mobile game or something) then you might consider going down the more complicated route you were talking about.
Even if you DID go down that more complicated route: Scaling your uvs won't crush the resolution in Unreal--so long as you dont resize the textures that go on them. UVs themselves are resolution independent--it's the textures that would be crushed--when you apply those 'texture coordinate' nodes you basically would be scaling the UVs back up...then applying that to the full res texture. I've used this sort of trickery in the past to add some complexity to materials for simple objects that needed low draw calls...but, yeah, it's not standard practice. You also won't be able to easily preview this in maya/max without building a shader network in those aps to match the behavior.
Personally I think you're doing a very odd pipeline. There's no way pixel data will exist outside 0-1 so what are you trying to do by having them outside of that? Make it easier to work with so that they're good in editor? that's fine but it's going to get compressed into 0-1. So you have multiple textures right? well each texture is going to need it's own material or material instance. There's no way around that. This means your going to have to split up which polys get which material. At that point it doesn't matter if the u/vs for the other textures overlap because they're in a different material and not pulling from the same diffuse.
I'm just perplexed by what your trying to do because it doesn't really seem to solve any problems.
essentially I can use 3 textures on an object within 1 material, rather than 3 textures with 3 materials. Am I being silly and making this more complicated than it needs to be, or are there benefits to doing it this way?
Basically I was looking into this method to apply multiple high res maps to a mesh, and it seemed logical because it uses only one material.
Thanks for all your help!
So, that said, the only benefit to this method I can come up with is the drawcall one.
If you're not working for web/mobile, or you don't have a ba-jillion of these objects in the scene, or if you're not planning on making a per-pixel mask instead of using UVs/panners to mask things, then it's almost certainty not worth the effort to go this route. I'd just use multiple materials.
You may be after that. Second thread somewhat the same (I think, didn't read it): http://www.polycount.com/forum/showthread.php?t=91942
Also the built in material function for CroppedEmissive has a setup inside of it that allows you to move and offset a material, without having it tile, in case you are looking for that behaviour instead of the above.
You can also turn off tiling on textures entirely if you double click a texture - and set wrap to clamp. You can however not offset a texture indefinitely in clamp mode, you can only offset it about 5 times or so before it stops working.
The drawcall advantage you can get from this is rather big, though your material complexity goes up. If you can find the balance between the two it can be pretty decent. Does only work on PC/console though.
If you use the first method you will experience problems with seams between the various parts, because of mipmapping. There are some setups that counter that, or you can manually add buffer space in Photoshop.