Sign in to follow this  
dmatter

Unity Multi-Adapter/Monitor/Window Renderer Design

Recommended Posts

In an attempt to play around with better multiple adapter/monitor/windowing support I've been thinking about what sort of (C++) API would be needed to provide such functionality in a nice and flexible way. Ideally an application (comprised of models and updated by controllers) should just describe itself and have the renderer (view) handle all the actual presentation. The implication of this is that hopefully the renderer would somehow manage to display the game across multiple monitors, if at all supported by the hardware, but without much concerning the app/game itself. Naturally the renderer cannot be expected 'just know' the most appropriate way to present any given application across multiple monitors, so it would need to be configured through some interface at startup. I don't have a fat lot of experience with this so I've been looking at the DXGI layer for ideas about how this is done at a lower level. For an obvious, API agnostic, solution one could just wrap the DXGI (D3D) and equivalent wgl-functions (for Win32 OGL) into Adapter, Output (the monitor) and DisplayBuffers (swapchain) classes. It doesn't seem awfully friendly though and I'm not sure how best to then use those to configure rendering options, for example: - Stretch and split horizontally across all screens - Draw the scene in one screen and have the stats in another - In multi-player mode give each player a screen. - Use adapter 2 (it's better at CAD). - etc Clearly there may also need to be some manual configuration by the user. In the case of rendering different application specific segments to different screens (like rendering player stats to a separate monitor from the main scene) the renderer needs someway to discern what's what (whereas previously there was no distinction, everything is just vertices and materials). Perhaps the application might register different entities with different 'Scenes', like a MainScene, a StatsScene, a Player2Scene, and so on. Then the renderer can then manage scenes in whatever way it's been configured to, like render the StatsScene to monitor 2 or render all the scenes to the one monitor if there is only one. I'm also reminded of the old "Don't use singletons because you might want multiple renderers for multiple adapters". I'm not convinced that having multiple renderers is the best option? - A single renderer managing multiple devices though? Hmmm. So that's my current train of thinking but I thought I'd both run what I have past the community and gather some market research by asking what kind of API you would like to, or do, use to setup rendering to multiple monitors and fallback to a single monitor otherwise? Any thoughts, links or feedback?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this