UV texture coordinates

Features you'd like to see in future versions, gripes, ideas..
booman
Posts: 10
Joined: Wed Jan 05, 2011 1:03 pm
Location: US
Contact:

UV texture coordinates

Post by booman » Wed Jan 05, 2011 1:34 pm

Thanks Adam for all of your hard work making LightUp a fully integrated lighting tool for Sketchup.

I was wondering... since LightUp already UV unwraps the lightmaps to one single image, how hard could it be to unwrap the textures (materials) to one image?

For example: If I use more than on 512x512 textures (materials) on my model in Sketchup, I would like to have one exported .tga image for use in a game engine (UDK).
Then I could use this feature for diffuse, normals, lightmaps, specular and pretty much any other textures for the game engine and these textures would already match the model UV coordinates.

Currently, the textures (materials) export as multiple images like the KMZ (Google Earth) export. I also use an ASE export plugin that works from sketchup to UDK, but no lightmaps or UV unwrap.
But I like the FBX capabilities too.
Thanks
CONSUMED BY CHRIST,
† Brian McCracken †
In The Red

User avatar
AdamB
Site Admin
Posts: 2294
Joined: Wed Apr 16, 2008 10:11 am
Location: Brighton, UK
Contact:

Re: UV texture coordinates

Post by AdamB » Thu Jan 06, 2011 9:33 am

Interesting.

So there are a couple of ways you can approach this and I'm not clear which you're proposing.

1. During the export process, perform an optimization of the materials by finding non-tiled materials and create a single texture atlas for them all - thus merging many materials into a single material. This reduces drawcalls and increases runtime performance. We can also apply my Goldilocks plugin to texture dimensions to ensure you have just enough texture resolution based on any Scenes you have setup.

2. Create a texture with the same layout as lightmapping which contains the albedo info. The problem with this is that lighting is often a low frequency function at a lower resolution that you'll normally have for your base textures. Retaining the crispness of the base texture (which may be tiled) is going to require a texture with much higher resolution (albeit with the same unwrap layout). In some ways, doing this runs completely against the advantages of splitting out light effects from the base textures.

Adam
Developer of LightUp http://www.light-up.co.uk

booman
Posts: 10
Joined: Wed Jan 05, 2011 1:03 pm
Location: US
Contact:

Re: UV texture coordinates

Post by booman » Thu Jan 06, 2011 12:59 pm

You have a lot more programming knowledge than I do, but I think you understand what I am talking about.
The main goal is to have one .TGA for each exported diffuse, lightmap, specular, etc. while retaining the UV coordinates.
Obviously LIghtUp already does this with lightmap, so I thought it would be cool to have the same option with other textures.
You are right about the "crispness" of the texture, because apparently lightmaps can get away with low resolution.
But can it export say a diffuse texture and just match the original resolution the was imported? Also, it probably doesn't matter if the texture is tiled or non-tiled because if it looks good in sketchup, the exported UV coordinates should automatically match the textures on the model. Which means it should look identical in the game engine, but now you can import a lightmap, specular, normals, etc that also have the same UV coordinates.
Here is my workflow (to further explain my issues):
1. create lowpoly model in sketchup
2. import textures (tiled or non-tiled at 512x512)
3. add textures to model (also known as UV mapping)
4. export as .ASE (HardPCM-sketchup plugin for Unreal Tournament 3)
5. import textures into UDK (same 512x512 with exact names)
6. create materials (diffuse, specular, normals via nodes) in UDK
7. import .ASE model into UDK (known as a static mesh)

This works very well because since I have materials in UDK with the same names as the skechup textures, all the textures automatically appear on the static mesh in UDK. Saves a lot of time, but you notice there is no step for lightmapping. That is where LightUp comes in and I am currently playing with the demo version to get lightmaps into UDK. I found that my static meshes have strange shadows and artifacts without lightmaps.
After using LightUp, I found that when exporting lighting it automatically unwraps the model as one .TGA
So I thought it would be cool AT LEAST have the mutiple 512x512 textures in SketchUp export the same way. Then I can use Photoshop to create my normals and speculars and import all of it directly into UDK. This would be more optimized than the way I am currently doing it.
Maybe I'm over analyzing the process or doing too much work, but the only other way to get the same result is to use Blender or 3D Max... which require learning everything from scratch and spending TWICE as much time modeling/UV mapping.
Let me know if this helps...
CONSUMED BY CHRIST,
† Brian McCracken †
In The Red

Pixero
Posts: 99
Joined: Thu Nov 19, 2009 8:18 am

Re: UV texture coordinates

Post by Pixero » Thu Jan 06, 2011 1:03 pm

I would be satisfied if we had an option to choose the size and how many images the lighting should be exported to.
Like 1024x1024, max 4 images. Maybe the program could even suggest a resolution and number based on quality settings?

booman
Posts: 10
Joined: Wed Jan 05, 2011 1:03 pm
Location: US
Contact:

Re: UV texture coordinates

Post by booman » Thu Jan 06, 2011 1:24 pm

yeah that would be cool too because it would help our models to look more photo realistic or more optimized for game engines.
I just wanted to minimize how many textures I use and how they are imported into UDK.
Right now I can make a simple box with say 3 512x512 textures, but after doing my UV mapping in sketchup I still have to import the same 3 textures into UDK. Even if I didn't use the entire texture on the model.
So it would be cool to have one UV unwrapped texture that combines the UV coordinates from Sketchup. I know most professional 3D programs already do this, but it is twice as complex and requires a lot more time.
You can tell I'm pretty determined to use SketchUp for my game models
CONSUMED BY CHRIST,
† Brian McCracken †
In The Red

booman
Posts: 10
Joined: Wed Jan 05, 2011 1:03 pm
Location: US
Contact:

Re: UV texture coordinates

Post by booman » Mon Jan 10, 2011 6:52 pm

I have successfully imported the FBX file into Unreal Development Kit (UDK)
And it looks great with the lightmaps. Every UV coordinate of the lightmap displayed exactly like the lightmaps in LightUp.
Of course I still have some problems, but at least there is some success.
Here are my issues:
1. UV coordinates - For some reason the UV coordinates for the materials do not import correctly. The materials do export and show up in the same folder, but they do not appear on the model in UDK. I have checked the options in the import dialog too. I can drag-n-drop my own materials onto the model but the UV coordinates on the model still do not reflect the coordinates from sketchup.
2. model scale - After importing the FBX model it appears about 3 times as large in scale than the ASE or T3D models. I know that could be tweaked in Sketchup and preset, but I already made a template that works great with the UDK scale. I also wonder if the scaling is affecting the UV coordinates too.

If LightUp could unwrap the UV coordinates for diffuse and/or specular, normal maps then I could easily just import those separately into UDK, but since the lightmap UV coordinates import perfectly... there should be a way to get diffuse/specular/normal to import exactly the same.
I read a few forum posts about UDK changing the UV channel of the FBX file. something like UDK uses UV channels 0 & 1, but FBX uses channels 1 & 2
Let me know what you think
CONSUMED BY CHRIST,
† Brian McCracken †
In The Red

Pixero
Posts: 99
Joined: Thu Nov 19, 2009 8:18 am

Re: UV texture coordinates

Post by Pixero » Mon Jan 10, 2011 8:02 pm

About your point 2.
Is it, to be more precise, 2.54 times larger? An inch is 2.54 cm.
Check what units you are using in SketchUp.

booman
Posts: 10
Joined: Wed Jan 05, 2011 1:03 pm
Location: US
Contact:

Re: UV texture coordinates

Post by booman » Tue Jan 11, 2011 1:26 pm

Format: Decimal, Inches
Precision: 0.00"

If I export an ASE character model at 140 units, it imports into UDK at exactly the size I want.
But if I export as FBX the models is way too large. I havn't figured out the difference, but it would be pretty easy to do trial-n-error to shrink it down in Sketchup.
CONSUMED BY CHRIST,
† Brian McCracken †
In The Red

User avatar
AdamB
Site Admin
Posts: 2294
Joined: Wed Apr 16, 2008 10:11 am
Location: Brighton, UK
Contact:

Re: UV texture coordinates

Post by AdamB » Wed Jan 12, 2011 10:07 am

LightUp exports in "Model units", ie the values stored in SketchUp are the values exported. SketchUp operates internally in inches so 1.0 in SketchUp = 1 inch.

It appears from the link here (http://forums.epicgames.com/showthread.php?t=740641) that UDK FBX importer likes spitting out in centimetres.

So as Pixero suggested, your model is being imported - identified as being in inches - and being scaled by 2.54 to convert to centimetres. Perhaps there are some importer settings you can set so you use 1 set of units for everything.

Adam
Developer of LightUp http://www.light-up.co.uk

booman
Posts: 10
Joined: Wed Jan 05, 2011 1:03 pm
Location: US
Contact:

Re: UV texture coordinates

Post by booman » Wed Jan 12, 2011 11:18 pm

Ok, you are saying LighUp is exporting the scale correctly but UDK is converting the scale incorrectly.
This is strange because the ASE export works fine and imports fine.

Any chance at a Texture exporting from LightUp?
I now realize what you were saying in the first response. For presenting models in LightUp it wouldn't make any sense because it may slow down your frame rate, but as an export capability (just like lightmaps) this would be invaluable. Specially if it matched the resolution of current materials in Sketchup.

Until I can combine the ASE and FBX with diffuse & lightmaps... this is the only other way I can think of getting a professional result in UDK.
I'm sure there is a way in UDK, but I don't know how.
CONSUMED BY CHRIST,
† Brian McCracken †
In The Red

Post Reply