I want to render an object (a knob) and its shadows only, and for this purpose i place this knob in a room(a simple box) with the use background shader on the room. GI and Final gather seem not to work with this shader, so i made anotehr room(another simple box) around this room, to catch and generate Global Illum.(GI) and Final Gather(FG). after tweaking some render flags and mental ray settings for the rooms, the rendered image has GI and FG and the shadows are catched by the use background room.
I forgot to mention that the alpha channel should only catch the knob and its shadows, wich i was able to archive using my method too.
Since the rooms have different distaces from the knob, so there is an (of course as slightly as possible) offset between the illumaning and gathering walls and the shadow catching walls. although this offset is not noticable in the actual render, it may be in future, as i want to make close up renders.
The point is , that there must be another solution. maybe i can make a shader network to make the "use background" shader cast and recive GI anf FG? or is there a mantal ray shader that does it?
I can not give the rooms the same size, as the GI and FG walls have to be inside to preserve the alpha channel.