Page 1 of 1

Adding the shadows later...

Posted: Sun Jan 27, 2013 2:48 pm
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...

Re: Adding the shadows later...

Posted: Sun Jan 27, 2013 3:13 pm
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... :/

Re: Adding the shadows later...

Posted: Sun Jan 27, 2013 5:26 pm
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...

Re: Adding the shadows later...

Posted: Sun Jan 27, 2013 11:35 pm
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.

Re: Adding the shadows later...

Posted: Mon Jan 28, 2013 8:59 pm
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...

Re: Adding the shadows later...

Posted: Fri Feb 08, 2013 7:54 pm
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.

Re: Adding the shadows later...

Posted: Fri Feb 08, 2013 8:45 pm
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?

Re: Adding the shadows later...

Posted: Sat Feb 09, 2013 11:51 am
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

Re: Adding the shadows later...

Posted: Sat Feb 09, 2013 11:55 am
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...