Problems with Scissor

I have two cameras/display regions which are rendered one after another, and second one uses Z-buffer from the first pass. I want to limit all drawing of the second display region to a portion of the screen, but Scissor seems to have different result than I expected.

First, I was trying to apply ScissorEffect / ScissorAttrib to camera node, and that done nothing (everything renders full-screen).
Applying ScissorEffect / ScissorAttrib to render.node() does limit rendering to the specified portion of the screen, but clear operation still clears the whole screen.
If I try to set display region dimensions, it renders whole view of camera to the region instead of just clipping.

Of course, since I need to clear only colorbuffer, I can just render colored quad of the necessary size, but I’d like to know what I am doing wrong (or is it a bug in Panda?) ^_^[/list]

There is no bug; what you describe is the intended design. The ScissorEffect is meant to be applied to the node to be rendered, not to the camera itself; and it affects drawing commands, but not the clear command (which is a property of the DisplayRegion).

The clear region is always the full size of the DisplayRegion. However, if you want to clear a smaller region, you can create a smaller DisplayRegion for this purpose. If you also want to draw just into that smaller DisplayRegion, you can either (a) set up your lens so that it draws only the portion of the view you wish into the smaller DisplayRegion, using setFilmSize() and setFilmOffset(), or (b) don’t use that smaller DisplayRegion for drawing at all, but create an additional DisplayRegion that covers the whole area, and use the ScissorEffect with that one.

David

Thanks, that answered more questions than I even had :slight_smile: