Multi-tile UV mapping

Started by TheBadger, March 30, 2013, 03:54:42 AM

Previous topic - Next topic

TheBadger

Hey guys,


I just want to know if TG supports .obj(s) that were made with multiple uv tiles. Does it?


A search only turned up one thread from a long time ago. I am currently trying to identify where some problems I am getting with some models I made are coming from, and there is a reason to believe that it is a uv issue. But the problem is likely in other software, so I would really like to cross out TG as the problem.


Should there be any issue with TG accepting a .obj that was made with multi tile uv mapping, assuming that the object and all aspects of it were done correctly?



It has been eaten.

Dune

You mean one area of an object is textured by more than one image file? Like semi-transparent layers in photoshop? You could merge the default shaders assigned to that texture.... if I understand you correctly.

TheBadger

No, it is one image file for a given object (the texture is hand painted) but the uv for the object is broken up over several tiles. So that rather than cramming all UVs for an object into one texture tile, the UVs are spread out so that each can get a larger portion of the resolution per face. I think I said this right but its new to me too.


Here is something I found quick that explains what it is,  I not read it, but the images alone show what this is http://www.disopolis.com/wordpress/2011/multi-tile-uv-mapping-part-1/


Ulco, it sounds to me like you may be describing "multi UV sets". But I have not learned those yet, and have no idea at all how they could relate to TG, but it sounds similar to something I remember a little about reading some time ago. Actually, if some one who knows about Multi UV sets in relation to TG could also talk about that, that would be real nice too! It would give me a place to start to understand them from :)
It has been eaten.

j meyer

Never tried it,but as long as every uv tile has it's own shader(inTG) it should work,hopefully.
I would try it with a simple model like a sphere that's set up the way you described.


Matt

#4
If you look at this part of the tutorial you'll see that it takes a specific setup in your renderer to make this work. You would have to do something similar in Terragen.


http://www.disopolis.com/wordpress/2011/part-3-muli-tile-shader-setuprendering-in-maya/


It might be a good way of working if you know what you're doing, but you can't simply bring one of these objects into Terragen and expect it to know what textures to assign to different tiles. You would have to tell Terragen what to do with those out-of-bounds UV values. You'd have to create an Image Map Shader for each tile, uncheck "Repeat X" and "Repeat Y" so that it doesn't wrap the UV values when they go outside 0 to 1, set the offsets/positions for each image map shader (e.g. make an image start at 1,0 instead of 0,0), and stack all the shaders together. I have never tried it, but I expect it could work.


Matt
Just because milk is white doesn't mean that clouds are made of milk.

TheBadger

#5
Hi matt, thanks for thinking on this.


So I have been playing around with this and have some interesting (to me anyway) stuff to add. But You or someone else is going to have to explain what it means.


So I made a new cube polygon object (nothing special about it) and then mapped the object. Then I assigned each equal section to a UV tile. 6 sides, six tiles. One tile is the normal uv tile.
After that I assigned a texture that I found online. The texture repeats in each of the UVs in exactly the same way. THis was all done in the simplest possible way.


The object imported in to TG and rendered perfectly. I did not do anything other than open place and render.


Now its important to understand that the object that was giving me problems was much more complex than this new test object I used for this post.
You can see all the details of the the successful object test below.
In the original problem object I had many parts to the object, and really now that I have been thinking about this, many of the parts should probably have been their own .obj object. I would post all the details on it, but I trashed everything in frustration and started over from scratch.


I will now do a slightly more complex version of the cube so we can try to see where exactly the multi tiles become a problem.
It has been eaten.

j meyer

Now you have another sort of tiling similar to stacking the six tiles(so that they take the
same space).
After my post from yesterday I've tested it with a cube and the first set up you were talking
about,so 6 different images,1 on each side and I got it to work.Tried it with Wings3d,though.
I had to split the cube into 6 planes and recombine them after uv-ing to an unwelded cube.
Maybe there's a way to have unwelded uvs on a welded object,but I don't of it.
Every side got it's own material assigned(which,with W3d,is the way to tell TG to use 6
shaders),->then exported as one .obj file.
Unwelded polys might cause problems with normal-smoothing under certain circumstances.

While this is an interesting technique form a technical point of view I really wonder why
someone would like use this technique in TG,extreme zoom ins on a model is the only reason
I can think of.

TheBadger

#7
Hi
here is a more complex cube.


It has 10,000,000 sides, and the displacement you see is sculpted (albeit with relatively low resolution stencils) I simply placed the 6 UV sides of the cube, in 6 UV tiles. Then sent to mudbox, sculpted , and exported back to Maya as FBX, and here you see the render.


What remains in this test is to see if I can use both the multi million poly object in TG as is, and also if I can use it in the same way as  the last cube (Low polly -open-place-render), but with bump and displacement. And all in the multi-tile UV layout.

I will try that next.

@ Matt
The Tut I posted and that you refer to is a maya/mud for Vray instructional. I do not have Vray. The maya copy I have came with mental ray, and it at least appears for now, that the process in the tut is not necessary for me to render multi-tile UVs *in maya*. The process appears automated (if thats the right word).
My hypothesis is that because TG2 imports .OBJ, and because .OBJ was created by the same people who created Maya, that the multi tile UV object will open correctly in TG2, *if* the .obj is made correctly. If so, .FBX will eventually be a better way to do this in TG *when working from Maya to TG*.

For now I think the original problem that started this thread, was that I had to many UVs assigned to the same tile from several different objects. That is, I had several objects that I used to make one .obj and this created texture problems.

I guess eventually I will prove one way or the other what will work and will not work.

@ J meyer
I do not think that I will have to do the exact same things as you because we are using different software, but it may be that it turns out to be similar.

"While this is an interesting technique form a technical point of view I really wonder whysomeone would like use this technique in TG,extreme zoom ins on a model is the only reason
I can think of."


I am no expert as anyone can clearly see. But I suppose that this way of doing things would be used for hero object. And for high resolutiondisplacement maps. My intentions were very much for objects that are to be placed in the extreme foreground, and so called Hero objects.

One example that comes to mind right now (that may or not be valid) is the idea of working at 2* film resolution 4000px wide where the objects in the foreground would need to be of the same resolution as the composition. The resolution of the objects falling off with natural visibility into the distance, this would be for still images and images for print and still images meant to be used as matte paintings where working a 4k and then sizing down is standard practice (according to Dylan cole: [size=78%]http://www.thegnomonworkshop.com/store/product/59/The-Techniques-of-Dylan-Cole-3[/size])

But I don't know. Im just trying to figure all of this out at the same time




The new cube test object




[Edit] J Meyer,
Now I think I am not expressing things right.  Let me put it this way and you or someone can have a say.
What sense does it make to have a composition at 5000px wide (just for example) And have in that composition an immediate foreground where the                  objects are at a 2000pix res? Does that make more sense or no?! I don't know right now.
If thats not a good argument let me know and give me a day to respond and I will track down the correct response. In general though, this method is used in film.
It has been eaten.

j meyer

As far as I am concerned your example (hero object etc.) clearly falls
into the "extreme zoom in" category,so it's fine with me.

TheBadger

#9
Ok, Found the fault. It looks just like what matt was explaining in his post above.


I transfered the FBX sculpt from Mudbox to Maya (send to feature does not work at highest sculpt level on OSX) I then saved out an .OBJ and then imported to Terragen.
Everything imported as it should. The sculpt work is clearly visible and displays correctly. The textures also came in, or at least the shaders are listed in the object node within Terragen. However, The textures do not render.

It appears that what Matt said is exactly right (I knew you were right Matt, its your soft, but I needed to be able to see it for my self :) )
In the image below I again posted screen caps of the elements.


In the "Errors/warnings" window I get this message for each of the texture shaders "trimage : Cannot locate file /Path/TestcubeOBJ/ -o
What is "trimage" and what is "-o" ??? ?


Matt, if I do the things you said to get TG to place the textures, is it that simple only for a cube object? Or for example, would it be a real burden to do this with a building with 20 tiles, or a figure with as many?
Would it be possible for you or jo to make TG except the multi tiles in a more automated way? And, When plunging in the image map, do I do that to the texture node in the object node?





What I really don't understand, is why did TG know to place the extra tiles correctly in example cube1, but not in example cube2? ??? ?
It seams the architecture is already there to make this work, but perhaps just not optimised for it?


Lastly, I have said in another post that no other software I have played with can deal with raw sculpted objects like TG2, and that includes the software I made the sculpts with! TG2 *is* a great potential way of displaying sculpts just as they were made, without the need for maps. And using the information provided in this thread I will be doing that. But at this point it is not clear if multi-tiles is going to be practical, although it does at least look possible.


Eagerly awaiting some feed back on this from more knowledgeable community members or staff!!!
It has been eaten.

TheBadger

Oh yeah, I forgot to mention that the primary tile of the UV does render correctly.


[attachimg=1]
It has been eaten.

Matt

#11
I don't know how the automated multi-tile UVs are stored in an OBJ, so Terragen doesn't read them. I didn't even know that the OBJ format could supports this. It is absolutely impossible that your first cube read into Terragen correctly and rendered multi-tile UVs automatically if it was using multi-tile UVs on the same material, because we don't handle that. I guess that each tile was turned into a separate material at some point in your pipeline, before (or during) saving as an OBJ. Separate materials with standard UV mapping should then read properly into Terragen.

About the "-o" error, perhaps this is some attribute that Terragen doesn't know about it. Maybe it means "offset", but I am just guessing. Terragen doesn't know about this, so it thinks you're trying to read a texture called "-o" which it can't find. "trImage" is a component of Terragen and tells us what part of Terragen's code is reporting the error. trImage stores images and handles some loading and saving of image files. The rest of the error literally says that it can't locate a file and it tells you what file it's looking for. Perhaps the OBJ just says "-o" and the rest of the path is inferred by Terragen from the OBJ location, or perhaps the full path is spelled out in the OBJ. If you're doing advanced things with OBJs it's often helpful to load them in a text editor so you can see what Terragen sees, and it might help you understand where things are going wrong and maybe how to fix them.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

TheBadger

#12
Thank you  :)  But one thing is for sure. At least I can get sculpts in now, and just use the more traditional single UV tile. And that makes me pretty happy.
It has been eaten.

bobbystahr

Quote from: TheBadger on April 01, 2013, 08:50:40 PM
Oh yeah, I forgot to mention that the primary tile of the UV does render correctly.


[attachimg=1]
have you tried running your sculpt through PoseRay and reassigning the texture tiles in that app?
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist