DrawProcedural / CommandBuffers

I’m working with the new feature from Unity 5.1, Command Buffers & Draw Procedural. The latter command called by the Graphics library does not allow integration with the deferred lighting pipeline. So I wanted to set up a command buffer that put the mesh into the middle of the rendering process, and thus let it still react to lighting.

However, it doesn’t work - I’m getting some odd bugs. If I set the camera event to before lighting, the color of the object gets reset (when I had ambient intensity to max, it was set to the skybox color… when I turned it to 0, it reset to just white), ignoring the texture calls. However, the alpha test clipping still occurs, just the returned color value is incorrect.

If I set it to other points in the rendering process, the lighting doesn’t happen at all, I can’t get shadows to hit the geometry, nor can I get the geometry to actually be lit.

Here’s a test project for this…
https://www.dropbox.com/s/7r56c8odwetz5yk/CmdBufferDrawProcedural.zip?dl=0
(mirrored on dropbox as it didn’t seem to be uploading… guess it did though!)

Wanted to first check to make sure I wasn’t missing any intended functionality before reporting it as a bug!

2162187–142922–CmdBufferDrawProcedural.zip (142 KB)

Bumping this?

As I bump this, I’ve figured out the issue, essentially.

One, shadows are rendered from a camera. That means, draw procedural, attached to a command buffer, actually can’t see those objects. Makes sense there. Two, emission values of 1 or higher (I had it set to 1) cause the object to take on the pure background ambient color. Not entirely sure why on that one, but it works now… I have an object that actually takes on lighting from the scene.

can you explain how you figured it out and/or show some code? that would be nice! right now i have a lot of particles, drawn with drawProcedural (or commandBuffer.drawProcedural), but I am still not able to get any informations into my depthbuffer.