PDA

View Full Version : Baking Lighting into model for Visual effect


thrasherstudios
12-18-2003, 12:54 PM
Hello

I am trying to recreate the effect over at Gnomon Online, where an object gets blown into thin air...here is the link

http://www.thegnomonworkshop.com/tutorials/gravity_vs_uniform/gravity_vs_uniform.html

um...I understand everthing I need to know...i think, except for baking in the lighting into the model. This is my first time baking textures into a model, so I am a little lost here.

I think what Gnomon ment by "baking lighting into the textures on an object" is to go to the Hypershade-Edit and choose Convert to File texture. So I did this and here are the settings I used

http://www.geocities.com/thrasherstudios77/tutorials/tutorials.html

after maya finished baking the texture, my model turned green, which I think means it lost its connection to the shader. I rendered the scene again after baking and my model looked like this

http://www.geocities.com/thrasherstudios77/tutorials/tutorials.html

I seemed to of lost my luminous on part of the teapot, not sure why... here is the original rendering before baking the textures

http://www.geocities.com/thrasherstudios77/tutorials/tutorials.html

So anyways...you bake your model and then you get a bunch of texture files that represent your lighting on your model...correct?

heres a shot of the baked textures I got

http://www.geocities.com/thrasherstudios77/tutorials/tutorials.html

What I don't understand is how the relationship between the model and the baked textures works. Do I have to reapply these baked textures back onto the model. And also later on when I want to color my particles with these baked textures how do I make a complete image of them with the right placement so the particle color will match the lighting on the model.

Don't know if that last part made sense, but if you check the gnomon link and read the tutorial and have some knowledge of giving particles color through a texture maybe you will understand better why I so lost.

I am probably missing something crucial and easy..just don't know what it is. In the past when I colored particles with a texture, I was only dealing with one image. But now I have all of these texture images that represent my model that need to be placed into the particle color of the texture emission attributes and I don't know how to do it

If throughout this thread you have been thinkin WTF then let me know and I will try and explain better

BTW the teapot is made up of multiple pieces or objects..don't knwo if that matters

Thanks in advance :thumbsup:

thrasherstudios
12-20-2003, 07:58 AM
come on people need some help here...just some understanding of baking lights into models would help out alot :hmm:

stallion151
12-20-2003, 08:19 AM
don't know what going on there, haven't had much experience with either. But just an alternative would be to try mental ray baking aswell.
disect the help file for this too, it has a bit of info on this.

Necropolis
12-20-2003, 08:34 AM
I'll try and go over this this piece by piece since it is late and I am half asleep.

First thing is that when a model "turns green" in your viewport it doesn't always mean that its lost connection with its shader. It can also mean that Maya has no way of representing what ever shading system is present in a real time view. So everything can be fine and you will get that "Green object". It is usually a good thing to double check it though to make sure there isn't an error.

Second. The baked textures should be automatically applied to the surfaces. You should not need to reapply them.

Third. If you send me the file I will take a look at it, but I think the illumination problem you are seeing might be from light linking. My suggestion would be to double check your light links, or if no light linking is used go through it and link the lights to the objects. It is hard to say what might be going on with out having the file in front of me.

Fourth. What you have to remember is that each surface gets its own baked texture. Thus each surface is going to need its own particle object and its own transparency map in order to get this effect you are after. Unfortunately it is just the way things work. With multiple surfaces you have to do multiple maps and particles.

Hope that makes sense! If anyone knows off hand what is wrong with the baked textures please interject.

Necropolis

thrasherstudios
12-20-2003, 09:22 AM
thanks you guys for the posts

I think i am understanding how this works more...I guess if I make the teapot into one solid mesh then this whole effect will be alot easier...

however if I did want to keep the pieces seperate i think it would be better to use...whats it called...baked sets to make sure I know which texture goes with which piece of the model..is that a good theory?

One thing i don't understand when i baked my model is that i got 11 differnet textures and i only had 4 pieces that made up the teapot model...and of course i don't know why when i baked my models lighting that some parts of the tea pot were less luminous then before...

stallion151-
hey I actually read the part about mental rays baking features and what I understand is they work basically the same as the regualr convert texture in maya renderer. So doing it with mental ray would only give me better lighting or a GI lighting so I would still have the same problem I am having now...could be wrong about this though...maybe atleast baking my model in mental ray I wont lose some of my luminous on my model....but that was probably just a mistake I made with the convert to texture in the first place

I will try and keep at this and if I figure it out will provide a scene file for you guys..

Sorry Necropolis i would provide i scene file but it comes from a gnomon DVD and i don't think it would fly to well with them. I will try again with a different scene and maybe post that if I have the same problems, or if I figure it out.

Damn I just wish Gnomon was more forth coming with content and that pertains to all aspects of the Gnomon universe. Don't get me wrong the knowledge they are injecting into my mind is top notch but with Gnomon online, the DVDs, and of course the online HTML pages they always I mean always leave some scene file out that you really want to get your hands on. Especially with Gnomon online, there is usually like 15+ movies for each section but only like 3 scene files, I mean how easy would it be to provide all the scene files for Gnomon online and the DVD's...ah well rant over.

Necropolis
12-20-2003, 08:38 PM
Ah, I didn't realize it was a provided scene file. Is it from a DVD or online. I have some of their stuff. So if I have it I will pop open the scene file and see if I can help you out.

Necropolis

thrasherstudios
12-21-2003, 01:48 AM
it is from a DVD, but it was on lighting not what I am trying to do. I just happen to have that scene file open, liked the lighting so I thought I would use that scene to try the disinegrate effect with.

The DVD is Rendering I- Light Fundamentals...if you are interested. BTW I am still having that problem with the luminousity of my model after it has been baked..any ideas

Ben

Jackdeth
12-21-2003, 02:54 AM
heres a crazy idea....

Render a frame out of your object just before it it's suppose to turn into particles.... Then take that rendered frame (it will have all of your textures and lighting "baked" into it via a rendering) and camera project that back onto your model using a surface shader. viloa! baked in lighting with no bullshit and one shader in the hypershade.

There is alway exactly 46 different ways to skin a cat....

Necropolis
12-21-2003, 05:15 AM
Unfortunately I am fairly certain that will not work Jackdeth because the baked texture files are being used to color the particles to match the point that is emitting them on the surface. The method you suggest will not provide the maps necessary.

I really think it probably has to do with the lightning for the shading group that is attached to the teapot. I don't have that DVD so I can't look into the scene file. I will see if I can duplicate your problem and then fix it.

Necropolis

Jackdeth
12-21-2003, 06:43 AM
Ummm it works quite well. What could give the particles the EXACT color from the object better than to use an actual render of that object with all of the bump maps, spec, shadows, etc, etc?? Just render the frame before the particle emit, then camera project it on to the surface. And you could bake that if you had to. I recommend this trick because baking, sometime due to wierd crap and bugs, won't match the render perfectly and there will be a jump.

A camera projection of a render back onto the exact objects that made the render can also be used for many other tricks. Its the same if you had a picture of a persons face that you wanted to breakup into particles....you project it, maybe convert it, and then use it on a surface shader so that you don't add any unwanted shading. Viola! I've used this on many features, from X-Files to Looney Toons. The day they added camera projects in PA was the greatest day ever...next to the day they added warp light....hmmmmmm I miss thoses.......

./me crawls back to work.....

Necropolis
12-21-2003, 09:16 AM
Wow, I didn't think it would work because the particles coming from the geometry self occluding in the render view would not have the proper color information from the texture file. And since there is a pretty good chance that particles from those occluded areas would drift into view it wouldn't work. What would the work around for that be? If it works its definatly a good way to get this effect, but for something like the teapot how do you account for the backside. Also how do you handle animation? Wouldn't you have to essentially take each frame as a camera projection? Or atleast some number of frames to account for the different angles you would see of the object?

That’s why I didn't think a camera projection would work for most cases. Really interested if what I thought were problems with camera projection in this case actually are problems.

Necropolis

Jackdeth
12-21-2003, 06:22 PM
Look, it all depends on the shot of course. Will you even need to worry about the back side? There is a good chance that by the time the front side has dissovled into particles the back side would already be gone, makeing it a mute point. Rendering it from a second camera to get the back side, then convert that projection and combine it with the front projection in photoshop if you need to. There is always a way to make it work.

We have done the animated projection sequence before. It works fine if you need it for that effect. This isn't about being easy, but what will do the job. It might horribly time consuming, but when the other choice is "not getting it done," then I choose the hard way.

And if this effect has lots of self occluding geometry, then render that frame with the objects broken into layers based off of occlusion. So maybe you end up with 2-6 shaders now,,, thats not so bad.

Heres another advantge to this. Sharpness of the textures. A 1024x1024 camera projection could be sharper than a 4000x4000 texture bake, becasue of how much surface area your object has, and how much bad streching you have from un-envenly spaced uv's.

Necropolis
12-21-2003, 09:25 PM
Whelp I was wrong then. I just thought there were problems so I was curious as to how you got around them. I figured that in most cases the correct color for the back side would be a non issue because you wouldn't see if it matched exactly. But in the cases where it was an issue I was just curious as to how you would do that.

It sounds like you don't even consider baking an option in this case? That because of the many issues with getting the baking done correctly you always would use camera projections. Makes sense to me. You know that they will provide you with the correct information. Even if you have to use multiple projections, or stitch in PS.

Thanks for the info Jackdeth!

Necropolis

CGTalk Moderation
01-17-2006, 12:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.