Shadow map - object map generation?

Hi. I am quite new with MEL-scripting and have just started to work on a GUI. I need to make a script that creates a white and black map (image), it should take only the selected objects only in a scene (from example a list) and produce a map where the selected objects become white (projection) and the background black.

Does anyone have suggestions of how to solve this problem? Any ideas of how to do this projection/selection? I was thinking that the shadow map does something similar but contains all objects in the scene and their shadows?

I also have a general question since I cannot decide if I should use the GUI completely in MEL or as a C++ plugin. If I later on would like to do some image processing operation on my images and want it to be pretty fast is C++ API a better solution?

Cheers,

vern

A new idea is to use the alpha channel, but then there are some problems:

  1. Is it possible to only render the alpha channel using MEL, glRender?

  2. I do not want any objects to be other then white colour, for example now transparent objects would be grey?

  3. How can I only get the selected objects in the alpha channel, can I with a MEL command ser render visibility off in some way?

Cheers,

vern

Iterate thru all objects and set them to a alpha mottte of black and then set the selected object to white render and undo the changes!

Hi,

Thanks for answering. I will try to do that. Should I use glRender with some flags to render only the alpha channel, since I do not want to render in RGB mode?

And will it automatically step to the next frame if I have an animation?

Cheers,

vern

Well I dont think its possible... Altough you ccan go and discard rest of the channels as a post operation!

What are the MEL-code for running a hardware rendering (or software rendering)?

Does anyone know where I can find examples?

I do want to render only the alpha channel, but this might be impossible?

Still cannot find out which command to use for hardware rendering and how?

Ideas from you posters would be much appreciated.

/vern