Adding the shadows later...

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Adding the shadows later...

Post by ibax »

Hello,

I have the following problem:

Maya model -> done
Texturing, UV mapping -> done (big house, many objects, the objects were textured separately!, textures are in jpg format)

But there are no lights and shadows at the moment. I need them also. So I decided to add occlusion, global illumination, final gathering and also light to my scenes. But this type of shadowing is adding to the whole model (not to objects, walls, furnitures separately)... Occlusion, FG, GI, shadowing to different pass, saved as TIF format, then make a composition of these different TIF shaders in Photoshop and assign the result to the whole model. The texture is the output, not the input (when I made the texturing, the jpg texture files were my input).

I export the whoel model to OBJ format. There is an obj file, an mtl file, and many jpg files (uv mapping stored in the mtl file).

The question is: how to add this extra shadowing (GI, FG, lights) material (TIF) to the texured model/building? Will this overwrite all the existing textures? Or can I 'multiply' somehow the textures (approx. 100 jpg files) and the shadows (1 TIF file)?

How to continue?

Thanks for the answers...
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Adding the shadows later...

Post by Mel »

You have to export to a mesh file format that supports 2 sets of texture coordinates, so your baked lighting goes to one set and the textures properly go to the other. The .OBJ format don't support multiple texture coordinates, but MS3D, B3D and X file formats allow them

Irrlicht needs custom exporters for each 3D package to support all the features needed, i think... :/
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Adding the shadows later...

Post by ibax »

What does this exactly mean: 2 sets of texture coordinates? Do you mean two sets for the same object? Because in my case, I use only one obj file, one mtl file, and many jpg files.
What happens, if I add an another file reference (TIF with the shadows) to the MTL file?


Or maybe this could work (?) :

In the model there are many objects, each textured separately -> OK
When I combine all the objects/polygons, then the textures are still the same -> OK
But if I would like to create a new UV map to the combined object, the UV editor does not recognizes all the textures, so the UV map is useless in case of combined objects (like in my case)...
Can I somehow create a UV map, where the textures and their position/map remains the same? Because if Yes, what I need only to 'multiply' the texture map in PhotoShop with the shadowed one...
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Adding the shadows later...

Post by Mel »

Not exactly. In maya there must be an option to add more texture coordinates to an object, in 3DSMAX the texture coordinates go into something called "channels" (channel 1, channel 2... and so on), i can't tell what is that in Maya, but the point is loading your regular textures into one channel, and loading the baked lighting into the other channel, and using an EMT_LIGHTMAP material to multiply the textures inside the application.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Adding the shadows later...

Post by ibax »

Hello,

I found what I was looking for:

http://davegoosem.net/blog/maya/texturi ... e-in-maya/

This is exactly, what I need. Now I can bake shadows 'into' textures. I hope this thread will help also others...
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Re: Adding the shadows later...

Post by christianclavet »

Hi,

Yes, baking will solve the problem and you will have lightmapping applied on the model.
But there is one constraint:
Your model should not use tiled textures. If you bake then your shadowing will also tile with the texture.

Since your model is a "big house", I prefer to warn you because theses type of models usually contain tiled textures (walls, floors, etc)

The other method is to use 2 UV's channels per model. The first channel is used the main texture, and the other UV is used for the Lightmapping. Si if you have tiled texture, since the other UV is separate the lightmapping will still work properly even if you used a tiled texture on the model. Your model should not have more than 2 UV's since Irrlicht will not support more than 2 channels.
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Adding the shadows later...

Post by ibax »

Thank you for this very important info...
Yes, my model contains tiled textures, so I will need a solution for this also. I will try yours...
Just one question, maybe you can answer it quickly: I'm using obj format... Is it also supports 2 UV channels? Or how/when to mixture these two UV channels?
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Adding the shadows later...

Post by randomMesh »

ibax wrote:Just one question, maybe you can answer it quickly: I'm using obj format... Is it also supports 2 UV channels?
Mel wrote:The .OBJ format don't support multiple texture coordinates, but MS3D, B3D and X file formats allow them
"Whoops..."
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Adding the shadows later...

Post by ibax »

Ok, this is OK...
I just thought, that the solution is in Irrlicht, and I can do it independently from the file format...
Post Reply