I am making a sort of 3D editor where I need 4 viewports.
What is the easyest way to make it? Is there a way to have different viewports in one glControl?
Can they all share textures in some way?
Posted Sunday, 21 December, 2008 - 15:50 by the Fiddler
One approach is to use a single glControl and render your scene four times, each time with a different viewport (check GL.Viewport).
Alternatively, you can create four different glControls (textures will be shared automatically) and go from there.
The first approach will likely yield better performance and will probably be easier to work with, as you won't have to juggle with current contexts and/or threading.
I went with GL.Viewport , it was simpler then I thought it would be.
One more thing I am not sure how to pull it off now... How can I have different background color since .Clear clears everything? Right now I am first drawing quads without texture in ortho mode but it makes it complicated and the final color is not exactly the one I set with GL.Material
Posted Monday, 22 December, 2008 - 23:01 by objarni
Disable any lighting-stuff and use ordinary GL.Color() and Ortho-mode to draw different bg-colors in the different quadrants of you application. Use GL.Clear() to clear the depth-buffer though.
So I guess you are almost there - just skip the lighting stuff while clearing the screen.
Comments
Re: Multiple viewports - Sharing textures?
One approach is to use a single glControl and render your scene four times, each time with a different viewport (check
GL.Viewport).Alternatively, you can create four different glControls (textures will be shared automatically) and go from there.
The first approach will likely yield better performance and will probably be easier to work with, as you won't have to juggle with current contexts and/or threading.
Re: Multiple viewports - Sharing textures?
I went with GL.Viewport , it was simpler then I thought it would be.
One more thing I am not sure how to pull it off now... How can I have different background color since .Clear clears everything? Right now I am first drawing quads without texture in ortho mode but it makes it complicated and the final color is not exactly the one I set with GL.Material
Re: Multiple viewports - Sharing textures?
Disable any lighting-stuff and use ordinary GL.Color() and Ortho-mode to draw different bg-colors in the different quadrants of you application. Use GL.Clear() to clear the depth-buffer though.
So I guess you are almost there - just skip the lighting stuff while clearing the screen.