Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Opengl help
Index -> Programming, C -> C Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: Wed Jan 28, 2009 11:56 pm   Post subject: Opengl help

ok i'm making a space game, I added a cockpit picture to be drawn on top of the background, i used masking with blending but i realized it significantly lowers fps rate.
any alternate ideas on how to render a cockpit on top of the background scene?
Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Thu Jan 29, 2009 2:18 am   Post subject: RE:Opengl help

Did you try using a PNG with an alpha channel?
md




PostPosted: Thu Jan 29, 2009 8:31 am   Post subject: RE:Opengl help

Textured quad with transparency, should be rather fast and easy to do. Positioning it might be a bit more of a challenge though.
Homer_simpson




PostPosted: Thu Jan 29, 2009 11:35 am   Post subject: Re: RE:Opengl help

CodeMonkey2000 @ Thu Jan 29, 2009 2:18 am wrote:
Did you try using a PNG with an alpha channel?
Homer_simpson wrote:

ok i'm making a space game, I added a cockpit picture to be drawn on top of the background, i used masking with blending but i realized it significantly lowers fps rate.
any alternate ideas on how to render a cockpit on top of the background scene?

those 2 are the same thing, and that is what i've done
md




PostPosted: Thu Jan 29, 2009 11:42 am   Post subject: RE:Opengl help

Multiple textured quads without transparency? Razz
Homer_simpson




PostPosted: Thu Jan 29, 2009 1:36 pm   Post subject: Re: Opengl help

never mind, alpha testing took care of it Very Happy

load a transparent tga file and do this when drawing the cockpit:
c++:
        glAlphaFunc(GL_GREATER,0.1f);
        glEnable(GL_ALPHA_TEST);


Mod Edit: Language must be in quotations for the syntax tags, "cpp" not cpp Smile
Display posts from previous:   
   Index -> Programming, C -> C Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: