Tuhopuu2 / OSX (2004/05/23) UV LSCM unwrap

User-contributed CVS development builds. Please test and give feedback!

Moderators: jesterKing, stiv

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Mon May 24, 2004 5:04 am

Monkeyboi wrote:So you suggest this would make it harder and more time consuming using several coordinates? Quite the contrary, what now is a huge pain (removing seams) that never looks 100% perfect, can be done extremely effectively and quickly using several UV coordinates. This is how it works:

Image

The example would have worked better on a more complex texture, but you can clearly make out the seam where the arm UVs are sepperated from the body UVs. Instead of having to use loads of time in Photoshop or similar trying to match the colours, veins, bumps, saturation exactly, you just slap different texture on top with an alpha map, and there you go! No seam! The whole point is that it is easier and gives you better results.
Wouldn't it be easier to just paint the transition right on top directly on the 3D model? IHMO, once it's unwrapped correctly for good, painting the transitions right in the 3D view is much easier than having to reunwrap and recreate a new UV map for transitions. What do you think?
Besides, it has more uses than just removing seams. Decals on a car, as has been mentioned could effectively be added using this feature. The same goes for any small detail you might want to add to an object that is UV mapped.
Maybe it's just me, but I really don't see why you would need another set of UV coords to do that, unless your first set isn't done correctly. Just start with a completely transparent texture, slap the logos on top and you're done.
Blender already allows you to assign one texture to Cubic mapping, and a different one to Sphere on the same object. You can also have one texture with 'Refl' and one with 'Glob' coordinates. Blender already recognises that it is very useful to be able to control texture mapping per texture, and therefore it is quite an obvious limitation to only have one UV map per object.
That point is moot. Everytime you choose Refl, Orco, Nor, Glob, Win and other mappings, it's the same mapping coordinates from one texture to the other. All of them represent a different mapping method clearly adapted to different kinds of situations.

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

lukep
Posts: 0
Joined: Sun Apr 04, 2004 1:39 pm

Post by lukep » Mon May 24, 2004 7:23 am

Monkeyboi wrote:So you suggest this would make it harder and more time consuming using several coordinates? Quite the contrary, what now is a huge pain (removing seams) that never looks 100% perfect, can be done extremely effectively and quickly using several UV coordinates.
You still have the problem or creating 2 new seams even if they are blended.

and it would be even easier with any of the technics I mentionned before :

- painting tools making sure that border UVs matches,
- filters in editor doing the same.
- 3D painting tools allowing to do alpha blending

Without solving completly the problem, those are IMHO better alternatives :
- vertex shaders that do Gauss blurr and AA on border vertexs
- alpha blending can be done by a vertex shader too

for decals, gain is marginal once UV mapping is of good quality.

No really, I don't think it's worth the added complexity to render pipeline

JoOngle
Posts: 0
Joined: Sat Jan 24, 2004 4:12 pm
Contact:

Post by JoOngle » Mon May 24, 2004 4:47 pm

theeth wrote: Wouldn't it be easier to just paint the transition right on top directly on the 3D model? IHMO, once it's unwrapped correctly for good, painting the transitions right in the 3D view is much easier than having to reunwrap and recreate a new UV map for transitions. What do you think?
Martin
That is one for my DREAMS! 3D-painting in Blender with
auto-uv-mapping! Ahh..that and some better Armature setups/weighting and
we'll all be in heaven already.

Imagine beeing able to "spraypaint" your model right
after modelling it, not bothering with hour's of
UV-mapping ...plastering & patching nightmare....
It's a dream for now...

cekuhnen
Posts: 0
Joined: Mon Jan 13, 2003 11:04 pm

Post by cekuhnen » Mon May 24, 2004 5:54 pm

i dont know how difficult it is to build in a good painting solution.
i have read something about a plugin that bring gimp into blender for texture painting.

direct painting onto the mesh would be pretty usefull since it eleminates the danger of creases and all the work about fixing this creases.

claas

dmao
Posts: 5
Joined: Wed Apr 07, 2004 3:12 am
Location: New Orleans, LA

Post by dmao » Mon May 24, 2004 6:41 pm

At the risk of jumping into a long debate, I'll say that multiple UV coordinates are EXTREMELY useful. To say otherwise is simply short sighted. Some great examples have been given already and I won't bother repeating those, but the one people seem to have missed is for realtime use.

Multiple UV's are virtually REQUIRED for realtime graphics nowadays.

I'll repeat again, ala theeth :wink:

Multiple UV's are virtually REQUIRED for realtime graphics nowadays.

There's a reason most games in the past 5 years have used multitexturing hardware. Multiple UV's are used for example to apply a medium frequency base texture such as a brick wall, one-off decals decals such as graffiti on that brick wall, a high frequency detail texture like small pitts in the bricks, and a low resolution lightmap, where each polygon must have a unique space in a texture.

Add it all up and you have a very rich surface. It's true that you could combine all 4 into one baked image, but that would be incredibly wasteful in terms of texture resolution, creation time, and performance. Since the textures have different frequencies, you'd have to scale up all the textures to fit the lowest common denominator (in this case the detail texture) and with the lightmap, make a new image with mostly the same texture for every single object!

Or lets say you wanted a huge, 20ft tag on the brick wall, one that would cover say 5 repetitions of the brick texture. Currently, you could tile that brick texture 5 times in your paint program and then paint the grafitti over that, but that's obviously a HUGE waste! What if you want to change the brick texture to something else? What if the new texture doesn't precisely fit the 5 repitions you used? What about the 20mb image you just made? :)

Some people are looking at Multi-UV's as more work. Think of it instead as more freedom.

Say you want to move the graffiti a bit higher on that brick wall or rotate it a few degrees? With Multi-UV's, you can move that one element individually and get instant feedback in the 3d window.

Also, you can easily reuse that grafitti texture on anything now. Want it on the sidwalk? A billboard? A car? the back of someone's head? It's easy to do, just add another UV layer and position it interactively to fit your needs. All this happens while making better use of the hardware, keeping memory usage low, and the base texture rightfully independent.

Now then, I DARE any of you to say multiple uv's aren't useful! :D

Especially with Blender's recent focus on the game engine and the sheer ubiquity of multitexture hardware, there's no excuse to continue ignoring it. Needless to say, this holds the same benefits for the non-realtime portion of blender as well.

Phew, long post! One final example though- if any of you play Quake3, Return to Castle Wolfenstein, or prolly any other game with the Quake3 engine, try changing the lighting from "Lightmap" to "Vertex Colors". You'll see the difference multiple UV's make...

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Mon May 24, 2004 7:03 pm

True, in a realtime engine where you want to minimize texture while keeping quality high, multiple UVs would be useful. For prerender sequence where you'd probably want to minimize the use of repetitive paterns (brick walls), it might look better to slap a complete texture on the whole wall. And memory used for higher resolution textures wouldn't be a bottleneck for rendering.

Frankly, I haven't thought about realtime usage before because I don't care much, but you do have a point.

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

lukep
Posts: 0
Joined: Sun Apr 04, 2004 1:39 pm

Post by lukep » Mon May 24, 2004 7:42 pm

dmao wrote:At the risk of jumping into a long debate, I'll say that multiple UV coordinates are EXTREMELY useful.
And once again for the examples you gave, you dont need multi-UV coords.

You need multiples maps with differents frequencies, which can fit all in ONE SET OF UV COORDINATES !


For the sake of clarity :

- UV coordinates are independant of any map, they are only a coordinate system
- Each UV-map is placed in the UV coordinates space with or without repeat via a transform function.

There is a scaling factor between UV space and map space in any case (from continuous to discrete in the maps) and you only need to alter this factor for each map. the map does not need to be constrained in the full [0..1] ranges of the UV and can repeat if smaller.

Blender does that already BTW.

ilac
Posts: 131
Joined: Mon Oct 14, 2002 8:24 am

Post by ilac » Mon May 24, 2004 8:39 pm

Money_YaY! wrote:I was just restating the need for layers of visable editable UV image maps, not different sets of cords. Sorry.. ^v^ Different cords is just wrong and silly. But layers are smart and useful.
Just change which image is displayed in the UV window. Every image is effectively a different layer.

dmao
Posts: 5
Joined: Wed Apr 07, 2004 3:12 am
Location: New Orleans, LA

Post by dmao » Mon May 24, 2004 10:20 pm

theeth wrote:For prerender sequence where you'd probably want to minimize the use of repetitive paterns (brick walls), it might look better to slap a complete texture on the whole wall.
I agree. Ideally every texture should be unique, but in real life it's just not practical. Some amount of repetition is inevitable and using multiple uv's with multitexturing to add decals, detail textures, and macro textures is a great way to hide it.
lukep wrote:You need multiples maps with differents frequencies, which can fit all in ONE SET OF UV COORDINATES !
Ok, to be fair, you can move and scale a texture with ofsX,Y,Z and sizeX,Y,Z buttons in the Map Input panel, but that means changing a value, doing a test render, and tweaking it again and again in the hopes that it comes out acceptably. Do you honestly think that's faster, easier, and more accurate than placing a texture interactively with the UV editor? And what if you want to rotate the texture? And what about the game engine?

Finally, none of that can help you when you have 2 different mappings you need to blend, which quite honestly is the real purpose of multiple UV coordinates. I'll give another example- Here's a rock formation from a map in Unreal Tournament 2003

Image

The middle of it is cylindrically mapped while the top is planar mapped. No amount of clever mapping in the world can get around the seam that's created when the 2 mappings and textures meet. The result here though is seamless since the objects has 2 sets of uv coordinates and a blend between the 2 textures on the top and the side. The workarounds posted earlier are entirely impractical here. 3d painting over the seam would be exceedingly difficult given Blender's primitive 3d paint and the gradual fade and photographic nature of the textures. And if somehow you did paint over it well, if you later decide the texture on the top of the plateau should be a little smaller or decide to put grass there instead, you're screwed! You're also stuck with a texture that's usable on just that one object where previously you had 2 general purpose textures.

Even if it's as good as it can get with 1 set of UV coordinates, there's still a seam. Period. If your texture resolution is high enough and your paint job meticulous enough, it won't be too noticable, but it's always there.
lukep wrote:Without solving completly the problem, those are IMHO better alternatives :
- vertex shaders that do Gauss blurr and AA on border vertexs
- alpha blending can be done by a vertex shader too
Using vertex shaders (i think you mean pixel shaders?) to try and hide the seam as you suggested is a bad idea. Blender's not ready to use hardware shaders, and using them in conjunction with a software renderer is just asking for trouble. Also, final renderings would be dependent on the user's video card. Above all, anything done would be a visual hack whereas a clear solution exists. And honestly, how can you advocate using shader hardware and not multitexture hardware? :P
lukep wrote:No really, I don't think it's worth the added complexity to render pipeline
Of course. Because adding hardware shaders wouldn't increase the complexity at all, right? :roll:

All that sounds like a lot of extra work versus simply making a quick gradient to blend between the 2 textures with seperate uv coordinates. Think about it. You'd need to do cylindrical and planar mapping anyway and you'll need 2 source textures anyway. What's easier, trying to paint away the seams between 2 photographic textures, or painting a gradient to blend them away entirely?

Money_YaY!, please read the above post very carefully! :wink:
Money_YaY! wrote:Different cords is just wrong and silly.

blendix
Posts: 51
Joined: Wed Oct 16, 2002 1:00 pm

Post by blendix » Mon May 24, 2004 10:55 pm

I think it's clear that multiple uv layouts are useful for some situations.

But the game engine currently doesn't support multitexturing, and painting over seams can be done with texture painting (which, admittedly, has a limited toolset).

To sum up, this feature is on my todo list, but not quite at the top.

Money_YaY!
Posts: 442
Joined: Wed Oct 23, 2002 2:47 pm

Post by Money_YaY! » Tue May 25, 2004 12:06 am

You know, I don't care, :D If it helps and makes the stuff have more power that is all I want. I don't care how it is implemented I just want it. But the biggest problem you will have is getting a coder to think it is good and then convince them to implement it.

As what we have now is really great and getting better but still not there.

I purpose that EVERYONE needs some lessons in C just for Blender...

As for multi UV cords. How everyone speeks of them sounds great

Money_YaY!
Posts: 442
Joined: Wed Oct 23, 2002 2:47 pm

Post by Money_YaY! » Tue May 25, 2004 12:10 am

ilac wrote:
Money_YaY! wrote:I was just restating the need for layers of visable editable UV image maps, not different sets of cords. Sorry.. ^v^ Different cords is just wrong and silly. But layers are smart and useful.
Just change which image is displayed in the UV window. Every image is effectively a different layer.
But you can not comp them. Working then is all in the image editor and jumping back to the 3d program and repeat till it looks right. But comping them on top of each other will give you a much better view of how it will look, and you could readujust them

lukep
Posts: 0
Joined: Sun Apr 04, 2004 1:39 pm

Post by lukep » Tue May 25, 2004 1:15 am

Ok, to be fair, you can move and scale a texture with ofsX,Y,Z and sizeX,Y,Z buttons in the Map Input panel, but that means changing a value, doing a test render, and tweaking it again and again in the hopes that it comes out acceptably. Do you honestly think that's faster, easier, and more accurate than placing a texture interactively with the UV editor? And what if you want to rotate the texture? And what about the game engine?
Actual toolset of mapping options would be enhanced to have rotation (this is not fast, better to rotate texture), I agree, and this should be doable interactively as well, that's all. There is no need for multiple UV here (recall that would consume memory AND rendering time).
The middle of it is cylindrically mapped while the top is planar mapped. No amount of clever mapping in the world can get around the seam that's created when the 2 mappings and textures meet.
first answer, a LSCM map could be entirly seamless (with some distorsion which can be corrected).
Then a vertex boundary filter and paint tool would permit to correct seams. If done cleverly it won't even need to modify the textures themselves. This is for me the true solution to the problem.

Now that this is an elaborate tool which is not so simple to implement as it need to be able to deal with different frequencies on each side of the border.
Using vertex shaders (i think you mean pixel shaders?) to try and hide the seam as you suggested is a bad idea. Blender's not ready to use hardware shaders
I don't speak of hardware nor pixel shader here, and it's something that can be done in scanline pipeline, doing a distance to the border based blend.
All that sounds like a lot of extra work versus simply making a quick gradient to blend between the 2 textures with seperate uv coordinates.
The only real use proven so far of multi-UV is masking the seam. The drawback is unneeded and unwanted complexity in a critical part of the code which will suffer deeply from it when other solutions not having these problems exist and could/should be added.

Remember that in games, it's the graphic card which does the job, here it must be the rendering pipeline, it makes quite a difference.

When dealing with a problem, the most important thing is to find the true one to solve. Here it's masking the seam, so dont request multi-UV but a valid solution for getting rid of seams marks.

And I don't think multi-UV is the most clever approach, vertex texture painting would be superior from my point of view.

Now if someone can do it without affecting rendering speed, OK, but I really doubt it's feasible.

ideasman
Posts: 0
Joined: Tue Feb 25, 2003 2:37 pm

Post by ideasman » Tue May 25, 2004 1:48 am

1. Multiple UV maps would NEVER be supported by the game engine.
(Unless 2 seperate images were rendered to the back buffer and then composited so each UV map was visible)- This would be slow and I cant see any other way for OpenGL to support multiple UV maps.

HOWEVER In the renderer its possible to use multiple UV maps for different texture channels. and it could be usefull in some cases.

Heres my proposal to a quick solution.

Just like the way you can use an object's co-ords for the mapping (where the others are ORCO, WIN, NOR. REF... etc.) - Why not Add UV-MESH so you can use the UV co-ordinates from another mesh.
Of course this would only work for a mesh->mesh material. And theu would need to have the same number of faces (tri's/Quats, in the same order)
But it would mean that would could Duplicate a mesh, edit the uv's, put the copy in a hidden layer, and use 2 or more UV maps.

JA-forreal
Posts: 0
Joined: Sat Mar 22, 2003 10:45 pm

Post by JA-forreal » Tue May 25, 2004 2:35 am

I'm with you guys on the seams issue. But the only way that I have found to really deal with uv seams on a 3d object is to place them in a place where they are not clearly seen or fit into the detail order of the texture pattern. I did another test with the LSCM feature and placed the seams on the back of the head. -

http://www.solarflarestudios.com/forum/ ... php?id=389

Seams are a real problem if you use photo textures of cloth patterns. But then you can get around most issues by using layers in an image editing app. You use a tiled layer, detail layer, etc. It's a crazy non artistic solution but it works eventually. This may be hours and days later depending on the complexity of your uv map. Hehehe. Oh yeah, sometimes BodyPaint and DeepPaint take a back seat to good ole Photoshop etc. in these situations. And in such cases sectional Planar uv mapping from "Window" works best to help lower uv distortion.

LSCM just takes a lot of the uv mapping grunt work out of your workflow. Sweet LSCM.

Blend on!

Post Reply