PDA

View Full Version : Bake occlusion sequence in MR


mattswilson
03-27-2005, 04:42 PM
how do you bake a sequence of lightmaps using batch bake with mr? I want to bake out an occlusion sequence using dirtmap or one of the other nodes to use in maya's renderer.

please please, I know this is out there somewhere!

thanks!

chrisWhite
03-27-2005, 07:06 PM
Good question, I'm really interested in the answer as well.

Ze PilOt
03-27-2005, 08:35 PM
how do you bake a sequence of lightmaps using batch bake with mr? I want to bake out an occlusion sequence using dirtmap or one of the other nodes to use in maya's renderer.

please please, I know this is out there somewhere!

thanks!

use the lightmap_write shader. Plug the occlusion in the input, a file node with write on for the destination (always .map) and a texture vector in the coord (look at the doc for the right mode). Then use a pre-mel scrit to change the filename of the texture node with a frame number.

(in 6.0x, you must change the base.mi declaration for lightmap, there is a error from alias)

jupiterjazz
03-27-2005, 08:50 PM
(in 6.0x, you must change the base.mi declaration for lightmap, there is a error from alias)

specifically you need to set the param type from "color texture" to "shader".


p

floze
03-27-2005, 09:34 PM
specifically you need to set the param type from "color texture" to "shader".


p
To illustrate it a bit, that's how it should look like after editing:
declare shader
struct {
vector "point",
vector "normal",
vector "tex"
}
"mib_lightmap_write" (
color texture "texture", #output texture
# [<name of the ouput texture>]
shader "coord", # texture coords to use
# to evaluate the texture output
# [<shader like mib_texture remap>]
shader "input" # [<shader like mib_lightmap_sample>]
)
version 1
apply lightmap
end declare
Hope I didnt mess it up.. ;)

mattswilson
03-27-2005, 11:34 PM
so then after this, whats the most efficient way to render. Is ther a string within maya that will let me render out only my lightmaps, or is that feature reserved for the MR standalone? Also, I what would that pre-render mel script look like? how would you specify the padding in the lightmap write node?

the first part helped a lot though, so thankyou, I am just a doofus.

thanks again.

neutronic
03-27-2005, 11:40 PM
well to be honest, you'll be already lucky if you're able to setup the very basic scene...
lightmaps in maya are really unfriendly. and crash most of the time.
btw in mr34 you can render only lightmaps. not sure in maya too.

Ze PilOt
03-28-2005, 08:52 AM
well to be honest, you'll be already lucky if you're able to setup the very basic scene...
lightmaps in maya are really unfriendly. and crash most of the time.
btw in mr34 you can render only lightmaps. not sure in maya too.

Just set the frame padding via a pre-mel script that set the texture name :)

You can render your lightmap in batch. They are rendered BEFORE the ... rendering :) So you must put a miMaterial shader on your object, but you can actually just put a black surface shader, or better, the image rendered with the lightmap, so you can check easily if it's done right :)

neutronic
03-28-2005, 11:44 AM
ze pilot your kind of posts give me the feel that you're just
good to speak but seriuosly never tried what you're proposing.
instead of so much smiles post a simple scene. or better shut up.
lightmaps in hypershade cannot work with maya uvsets, and that's a
thing, your vaunt pre-mel script let me think if it is not better to
make a custom lightmap to accomplish this thing, not last
mattswilson is asking for a solution to work then in maya and
you're proposing .map files. what's up with you, dude ??!

Ze PilOt
03-28-2005, 11:53 AM
ze pilot your kind of posts give me the feel that you're just
good to speak but seriuosly never tried what you're proposing.
instead of so much smiles post a simple scene. or better shut up.
lightmaps in hypershade cannot work with maya uvsets, and that's a
thing, your vaunt pre-mel script let me think if it is not better to
make a custom lightmap to accomplish this thing, not last
mattswilson is asking for a solution to work then in maya and
you're proposing .map files. what's up with you, dude ??!

I used what I'm proposing every day. It's not because you can't do it that it's impossible.

You can work with map files in maya. What's your point ?

It's not with a comment like that that I'll post a scene to help anyone. I will do it, but in private only for mattswilson and anybody else that want the scene. I really dont want to help people that react like you.

neutronic
03-28-2005, 12:00 PM
ronf ronf...

Ze PilOt
03-28-2005, 12:18 PM
ronf ronf...

So a mature and usefull reaction.
Not that I've something to prove you but :

http://zepilot.3dvf.net/lightmapExample.ma

Plug whatever you want instead of the checker node, and render. Once it's finished, you will find a c:\lightmap.frame.map file in c:\. And the UV are correct as you see :)

You can always convert that sequence in tga with imf_copy, but .map is better :)

So now you see you are wrong and dumb, so I can just say my turn "shut up."

Ze PilOt
03-28-2005, 12:40 PM
Oh yes, before you say it :

Try to render the .map file with maya software. It works.

"Dont talk about what you dont know" as you said :)

halfknight
03-28-2005, 05:09 PM
Hi Ze Pilot,

well thatīs an interesting way to bake, but the mr lightmap write shader doesn't support "sand" pixels, so if you have more than one UV Shell, you'll get black lines (seams) on your object. I think, it would be better to use the convertLightmap MEL command in a MEL script or expression..

Ze PilOt
03-28-2005, 05:42 PM
Hi Ze Pilot,

well thatīs an interesting way to bake, but the mr lightmap write shader doesn't support "sand" pixels, so if you have more than one UV Shell, you'll get black lines (seams) on your object. I think, it would be better to use the convertLightmap MEL command in a MEL script or expression..

actually the bake system from maya is a lightmap shader. It's just not by default in the hypershade interface. You have to re-write the file declaration in a phenom (look at mayabase.mi at "maya_lightmap")

jupiterjazz
03-29-2005, 04:35 PM
so then after this, whats the most efficient way to render. Is ther a string within maya that will let me render out only my lightmaps, or is that feature reserved for the MR standalone?

MEL: select mentalrayGlobals
in the AE you will find a switch with render lightmaps only.
or use standalone.


Also, I what would that pre-render mel script look like? how would you specify the padding in the lightmap write node?
the first part helped a lot though, so thankyou, I am just a doofus.
thanks again.

no probs.

We often release tips trough LAmrUG.org, including the following one: for frame padding the at-sign (@) character for frame numbers are also supported for custom file texture nodes for both readable and writable (ie lightmap) textures. It also supports image plane image file name when 'Use Frame Extension' has been enabled. Frame padding can be indicated using multiple at-sign (@@@@...) characters.
Note that only one such sequence is supported in the file name.
So export to .mi and edit your writable texture filename. You might try trough pre-render MEL, can't guarantee though since I did not test this particular one.


best,
p

mattswilson
03-29-2005, 07:05 PM
Thankyou very much everyone, that was exactly what I was looking for. I will, time permitting, make a simple UI to speed this up and share it with everyone.


thankyou again! (especially that last part jupiter jazz!)
Matt

techmage
01-22-2006, 01:03 AM
Hi Ze Pilot,

well thatīs an interesting way to bake, but the mr lightmap write shader doesn't support "sand" pixels, so if you have more than one UV Shell, you'll get black lines (seams) on your object. I think, it would be better to use the convertLightmap MEL command in a MEL script or expression..

I must ressurect this old thread to say.

Yeah I have this prob too, real bad, is there a workaround?

Puppet|
01-22-2006, 09:53 AM
If you have mr stand alone you may try my mel script for baking animation.

http://www.puppet.cgtalk.ru/download/images/b2mr_screen1.gif

http://www.puppet.cgtalk.ru/download/b2mr_e.shtml

If you don't have it you may view my code and edit it for maya.


Does anyone know why convertLightmap command don't support export texture pathes for mr stand alone?
Command mayatomr have -xp flag but convertLightmap don't have it and result mi file always without any texture pathes (it work's fine in Maya 6.0 and broken in 6.5 and 7.0)
I suppose it's maya bug.

shine77
01-22-2006, 07:36 PM
ke So a mature and usefull reaction.
Not that I've something to prove you but :

http://zepilot.3dvf.net/lightmapExample.ma

Plug whatever you want instead of the checker node, and render. Once it's finished, you will find a c:\lightmap.frame.map file in c:\. And the UV are correct as you see :)

You can always convert that sequence in tga with imf_copy, but .map is better :)

So now you see you are wrong and dumb, so I can just say my turn "shut up."

Is it possible to use this way to bake finalgather and or gi with this method?

CGTalk Moderation
01-22-2006, 07:36 PM
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.