Manupulating displayRegions

Hello all,

1- How to properly hide/remove a displayRegion ?
The temp solution I’m currently using is detaching the camera from render which ‘hide’ the displayRegion. It’s working but I don’t know if it’s a good solution!

2- Is it possible to put a direct object between two display regions ?

3- Is there a way to have a round DisplayRegion (circle instead of square/rectangle) ?

4- This is more a general question:
Are the maps we see on most FPS screens (usualy on top-right of window) built with display regions or directEntry ?

Regs,

  1. That’s a fine solution. But you can also use displayRegion.setActive().

  2. No, but you can create a third DisplayRegion to host your DirectGui object and put it between the first two.

  3. No, but you don’t have to draw to the entire DisplayRegion. If you don’t set clear active, you can draw your contents just in the circular center part of your DisplayRegion.

  4. I couldn’t say which solution is “most” popular. Either approach will work, and there are different trade-offs for each one.

David

Thanks David,

Do you mean creating somekind of a new scene, reparent it to it’s proper node and the render will be circular ?
(This may look silly but to me, rendering a 3d scene appear to be easier that rendering a 2d scene).

Also, are setClearColorActive(True) and setClearDepthActive(True) asking the graphicOutput to automatcly clear the scene each frame or do I have to specify it each frame ?

Is there any exemple anywhere for that ?
In fact, I already have few guesses of how it should work but don’t know from where to start to design this! I’m sure there might be an exemple or two somewhere and I would have find them if, at least, I knew how that “map” is being named!
Any link or advice is the very welcome.

The render will be circular if you only draw to a circular part of the screen. Forget about DisplayRegions for the moment, and think about drawing to the whole window. If your entire scene fits within a circular frame, then you are drawing a circular scene.

Of course, if you also want objects to be clipped by a circular clipping bounds, so that objects can move in and out of the frame without you having to think about whether they’re entirely within the circular scene or not, then you have to do more work, for instance with the use of a stencil buffer.

setClearColorActive(True) sets the clear mode so that the DisplayRegion is filled with the indicated color at the start of each frame. If you set this, then your DisplayRegion will always be visually rectangular. If you don’t set this, then your DisplayRegion will still cover a rectangular area, but it will be transparent in the parts where you don’t draw anything. (If you still want a solid colored background, you will have to provide it yourself, for instance by putting a big solid-colored polygon in the background.)

David