Jump to content
  • Advertisement
Sign in to follow this  
Hew T

OpenGL Impostor Rendering

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

Greetings, all. I am currently getting my head around the use of 'impostors'. There appears to be some confusion about the use of 'impostors' and 'billboards/billboarding'. As I understand it (correct me if I'm wrong), 'billboarding' involves aligning some geometry (generally a quad) to some axis or point - generally used to ensure said quad is 'facing' the screen. 'Impostors', on the other hand, involve replacing rendered geometry with a quad, textured in such a way as to provide the illusion of said rendered geometry. This involves rendering the geometry to a texture (via a Pbuffer or glCopyTex(Sub)Image2D), then positioning a textured quad in place of the geometry. The texture is updated as needed to maintain the illusion. Firstly, is my understanding of the two techniques correct? Secondly, during implementation, I hit the problem of -how- to 'position a textured quad'. I attempted the use of a screen-aligned billboard, but the texture coordinates were problematic - I could not figure out a way to generate the texcoords to maintain the illusion. The results were always warped / skewed, and looked wrong. To get around the problem, I simply resorted to an orthographic projection, and drawing a quad to exactly cover the screen coordinates the object (in this case, a tree) covered. The results are pretty much perfect, in terms of the 'impostor' looking exactly the same as the rendered geometry. My only concern is... is this the right way to go about implementing 'impostors'? Assuming I perform correct depth-sorting (back-to-front) prior to rendering my ortho quads, and turn off / on my depth-testing at the right times... everything should come out looking right - right? If anyone has any insight as to the 'right' way of creating impostors, please let me know. *afterthought* Perhaps this isn't really an OpenGL-forum question. If it belongs somewhere else, please feel free to move / tell me. Since this has taken almost a week of my programming time to get working, and there doesn't seem to be much solid, code-included information on how to create impostors... perhaps after I get everything working (and assuming I'm doing things right) I will write up a tutorial. Impostors are useful enough to warrant one, IMO. Thanks in advance, Hew T.

Share this post


Link to post
Share on other sites
Advertisement
Quote:

Firstly, is my understanding of the two techniques correct?
Pretty much, yeah. There's overlap between the two terms, since impostors are usually implemented _using_ billboarding.
Quote:
Secondly, during implementation, I hit the problem of -how- to 'position a textured quad'. I attempted the use of a screen-aligned billboard, but the texture coordinates were problematic - I could not figure out a way to generate the texcoords to maintain the illusion. The results were always warped / skewed, and looked wrong.
You'll need to explain further what went wrong. Code and screenshots would be essential.
Quote:

To get around the problem, I simply resorted to an orthographic projection, and drawing a quad to exactly cover the screen coordinates the object (in this case, a tree) covered. The results are pretty much perfect, in terms of the 'impostor' looking exactly the same as the rendered geometry.
That way's fine, I suppose, but is likely to have many more caveats than true billboarding. I suggest you spend time getting your texture coordinates right.

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!