UV mapping generation.

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

UV mapping generation.

Post by Mel »

I would like to know which are the best algorithms for UV map generation. The point is that i want to integrate a small tool to my editor that was able to generate the mapping coordinates for a lightmapping. Google won't be nice to me, it offers lots of tools, free, cheap, or expensive but i don't want a "tool", i want to generate them on my own.

Anyone knows something about this? :?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Re: UV mapping generation.

Post by nespa »

I found an interesting article here :

http://www.3dkingdoms.com/weekly/weekly.php?a=34
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: UV mapping generation.

Post by hendu »

There's a lot of options, spherical, planar, cubic.. But if you have the (cpu) time, the best results should come from just mapping the surface - think of a sheet placed over it, how it would distribute.
fmx

Re: UV mapping generation.

Post by fmx »

you know, I've been doing the exact same thing for the past few days :P
i need lightmaps for my upcoming game project, and I dont like using irredit so I had a look at generating my own

by far this was the best article i found online
http://www.flipcode.com/archives/Light_ ... tion.shtml

once you understand it, the concept is fairly simple: planar map all polygons onto a new lightmap texture, then use each texel on the surface to determine lighting/radiosity at that point.
the most difficult part is optimally positioning the polygons on the lightmap texture to begin with, the rest is fairly straightforward

Though saying that, I found that Max produces fairly efficient lightmaps, and since it already includes powerful lighting system, I question why I even wasted time creating my own lightmapper...
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: UV mapping generation.

Post by Mel »

Because it is much simpler to generate your own UV charts than merging 2 meshes to have a mesh with 2 sets of mapping coordinates, and because it integrates everything inside a single application.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
fmx

Re: UV mapping generation.

Post by fmx »

@Mel
I was questioning myself :wink:
last week I rushed ahead with adding a lightmapper into my editor and afterwards I realised I didn't have to:
Max (or any other 3D modelling package for that matter) can generate MUCH higher quality lightmaps than even UDK or Unity are capable of, not to mention the level of control over the generated UV maps

I guess the real problem for irrlicht users is dealing with the data exchange: getting the model data out from Max (or whatever tool) with multiple UVsets intact

I wrote my own COLLADA loader from scratch last year and I found the DAE files exported out from Max2010 work perfectly with my loader.
FBX format is also capable of exporting out multiple UV sets (the preferred interchange format from Max to UDK/Unity actually)

I dont know the state of the current DAE loader in irrlicht, but it should be fairly trivial to edit it to allow loading in additional UVsets into irrlicht's S3DVertex2TCoords or into S3DVertexTangents' Binormals or something

To each his own, I just thought it might be worth sharing my experience with the community :)
Last edited by hybrid on Tue Jun 19, 2012 2:03 pm, edited 1 time in total.
Reason: remove spam bot reply
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Re: UV mapping generation.

Post by Virion »

generate own UV is quite important, especially for optimization -- combine all the static objects into 1 single mesh, generate it's UV and use just 1 lightmap for the entire scene. much faster than having to apply a lightmap to each of the object in the scene.
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: UV mapping generation.

Post by ibax »

Virion wrote:generate own UV is quite important, especially for optimization -- combine all the static objects into 1 single mesh, generate it's UV and use just 1 lightmap for the entire scene. much faster than having to apply a lightmap to each of the object in the scene.
Virion: and what if my object is a house with many rooms? and I cannot put everything to one single UV map (walls, furniture, ...)? what is the fastest solution of UV mapping in this case?
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: UV mapping generation.

Post by ibax »

I also have a problem with UV mapping: the UV maps is irrEdit looks good, but when executing the irrLicht project, than the UV mapping is not used (textures are mixing). What can be the reason of this? I have only one UV map (map1). In irrEdit the model looks good, so I think, the generated obj+mtl file contains all the necessary information...
Post Reply