Jump to content
  • Advertisement
Sign in to follow this  
dimensionX

OpenGL Creating a window bigger than the screen size (resolution)

This topic is 4975 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

1) Is it possible to create an OpenGL window bigger than the size of the monitor resolution ? If so how and using what ? 2) Using Cg / GLSL how can I write to multiple color buffers from inside the fragment shader in one pass ? In a single pass inside the fragment shader I will be processing a fragments color in 4 different ways. So essentially I will be getting four different color values. Now I want to write each color value to its corresponding color buffer. What extensions will I need for this ? I can think of MRT extensions like ATI_draw_buffer. It would be good if I could use more than 4 rendering targets. 3) To make it more interesting, I would also like to make the above rendering targets (multiple color buffers) to be render-to-texture targets. So instead of rendering to multiple color buffers inside the frame buffer, I could render to multiple targets but now the targets would be color textures. Also I want to use floating point textures/render targets. Lot of crazy ideas but I really would appreciate some feedback on this. Thank you! I am using NVIDIA QuadroFX 3000.

Share this post


Link to post
Share on other sites
Advertisement
currently the state of play is :
1) pbuffers is one way todo it
2) gl_FragColor[n] where n is the buffer you want to use should work in GLSL/Cg. You'll need a pbuffer with multiple colour buffers and then bind the correct buffers using the draw_buffer extension. If you can use more than 4 or not will depend on the card/drive.
3) if the buffers are pbuffers then you can bind each colour buffer as a texture. It should work for floating point targets/buffers as well.

the framebuffer_object will also allow you to do all this and remove the need for pbuffers, but currently there is a lack of driver support. (I'd be tempted to wait coz frankly pbuffers are a pita to use [wink])

Share this post


Link to post
Share on other sites
Phantom:

1) pbuffers is one way todo it.

- My knowledge on pbuffers is minimal.
- To create an initial window I need to query the windowing system (Win32) with some width and height. Will it create a window larger than the size of the screen resolution ? If so, I should be able to change the rendering pixel format, render-to-texture and all that. Am I correct ?

2) I think is it gl_FragData[n] not gl_FragColor[n].

Share this post


Link to post
Share on other sites
yes, you can create a window bigger than the screen res, set its pixel format etc, however anything rendered which isnt on screen is probably going to be undefined and thus of no use.

Share this post


Link to post
Share on other sites
So as long as I am not writing to the frame buffer to render it on the screen I should be fine. If I have my render target set to render-to-texture, conceptually the pixels that fall out of the screen will still be processed inside the fragment shader and written to texture memory. From there if I readback into the processing memory and write it out to an image file, it should work.

Have you tried this ? Is it possible using GLUT ?

Share this post


Link to post
Share on other sites
If you try to render to an offscreen point on the normal framebuffer yes, it will travel down the pixel pipelines however it will be discarded due to clipping and thus even if you did a copy from the framebuffer to a texture you'll probably get garbage if you get anything at all.

pbuffer dont have this issue however, so they are the only way todo what you want.

Share this post


Link to post
Share on other sites
1.Couldn't you just render your scene to a texture, then in Orthomode, make a quad that fills the screen and adjust your texture coordinates for that quad according to what the actual visible portion of the texture(scene) would be?

That way you wouldn't lose any data or get junk data as others have suggested when pixels are clipped.

J

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!