ShadowUtil.updateShadowCamera with an Off-screen ViewPort

More than likely I am missing something, but when using the ShadowUtil class with an off-screen ViewPort, the occluders and receivers GeometryLists are not being populated.

There are only 2 objects in the scene.
Both are set to CastAndReceive
Both reside in the Opaque render queue bucket

Here is what I am using to update the two geometry lists: (osr being the ViewPort)

[java]
occluders = osr.getQueue().getShadowQueueContent(RenderQueue.ShadowMode.Cast);
receivers = osr.getQueue().getShadowQueueContent(RenderQueue.ShadowMode.Receive);
[/java]

Is there some step I am missing to ensure there geometries end up in the proper queue? Is this just not possible with a viewport that is not using the main scene? Or?

When looking through the getShadowQueueContent method of RenderQueue, I realized that the is no entry in the switch statement for CastAndReceive… how does this work? When are the Geometries added to the queues? And through what means? Both the above statements return a GeometryList with a size of 0.

Where are you calling this from?, and when ? … render queues may have been flushed or the shadow queues may not have even been populated.

My understanding is the RenderManager.renderScene method fills the shadow queues, so if that has not been called, they will probably empty.

“When looking through the getShadowQueueContent method of RenderQueue, I realized that the is no entry in the switch statement for CastAndReceive… how does this work?” - RenderManager adds geometries to two lists, cast and recieve, getShadowQueueContent is only looking at those two lists, geoms flagged as CastAndRecive will have been put in both lists.

“When are the Geometries added to the queues?” - during the RenderManager.renderScene call.

“And through what means?” - While the scene is being recursively rendered by RenderManager.renderSubScene, if a geometry has a shadowMode other than Off, it gets placed into the renderqueue shadow lists.

I can’t get to the code.google jme source right now, to link to the correct parts of the code sorry, but if you poke around the source in SDK, a few "Find Usage"s on some of the relevant methods will quicky start pointing you to the important bits of code.