Jump to content
  • Advertisement
Sign in to follow this  
Xerion

Tile Rendering and wrong colors ?

This topic is 3492 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

Hello i just wanted to save my viewport to higher resolution(for example 4kx4k pixels) and from what i have been reading tile rendering is the way to go or using Framebuffer object and then saving it. Well i tried both but the quality of the image of the FBo was not the best which i really dont know why :) It had some blurness arround the objects i created e.g. 2 white gluDisk. Anyway , for tile rendering i am using this library http://www.mesa3d.org/brianp/TR.html and everything works good apart from the colors being a bit messed. What i mean by that is that colors are saved differently from what they are displayed :) Red becomes Green Green becomes Blue Blue becomed red So RGB is actually saved as GBR.If i could put R in the front everything would be sweet :P I guess its just some messup thingy of how they are being saved but i cant figure it out ... Any help ? :) Thank you in advance ! PS. i used similar code with the one provided in demo2 to save my image.Even in his demo with some changed to not draw random colors what i am saying can be seen.

Share this post


Link to post
Share on other sites
Advertisement
Hmmm.. In don't know a GBR format, but BGR.
In graphic hardware the BGR format is quite common, so saving this directly from a given colorbuffer will result in a wrong color order. There are a few options to avoid this:
1. If you have control of the render target, use a RGB render target.
2. Use a file format (lib) which supports BGR format (like png).
3. Just copy the color buffer and reorder the byte before saving.

I think 2 is the best solution, as an easy and quick hack I would use 3.

--
Ashaman

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!