Jump to content
  • Advertisement
Sign in to follow this  
catalin1505

Fly3d - bloom implementation in ship game

This topic is 4806 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 everyone, this is my first post here. I tried to implement a bloom effect into fly3d using the existing ship plugin. I've written the code in the draw_status function.Everything is fine and dandy, but i do have a problem.It seems the original viewport isn't resizing. I've called the glViewport function but still doesn't work.The effect appears fine in the background but in the forground i have that little 512x512 viewport. I really hope you guys know what i could do about it. Here is the code: //BLOOM CODE g_flyengine->draw_frame_tex(texture,g_flyengine->cam,flyRender::s_camangle,flyRender::s_aspect); glViewport(0,0,flyRender::s_screensizex,flyRender::s_screensizey); glLoadIdentity(); float alpha=0; float alpha1=0; int x_of=0; int x_of1=0; glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glEnable(GL_BLEND); glBlendFunc(GL_ONE,GL_ONE); g_flytexcache->sel_tex(texture); g_flyrender->begin_draw2d(); for(int steps=1;steps<=24;steps++) { glBegin(GL_QUADS); glColor4f(0.01f,0.01f,0.01f,alpha1); glTexCoord2f(0, 0); glVertex2i(0-x_of,0); glTexCoord2f(1, 0); glVertex2i(flyRender::s_screensizex+x_of,0); glTexCoord2f(1, 1); glVertex2i(flyRender::s_screensizex+x_of,flyRender::s_screensizey); glTexCoord2f(0, 1); glVertex2i(0-x_of,flyRender::s_screensizey); glEnd(); glPopMatrix(); x_of+=12; alpha=alpha+0.02f; } glEnable(GL_BLEND); glBlendFunc(GL_ONE,GL_ONE); g_flytexcache->sel_tex(texture); g_flyrender->begin_draw2d(); for(steps=1;steps<=24;steps++) { glBegin(GL_QUADS); glColor4f(0.01f,0.01f,0.01f,alpha); glTexCoord2f(0, 0); glVertex2i(0,0-x_of1); glTexCoord2f(1, 0); glVertex2i(flyRender::s_screensizex,0-x_of1); glTexCoord2f(1, 1); glVertex2i(flyRender::s_screensizex,flyRender::s_screensizey+x_of1); glTexCoord2f(0, 1); glVertex2i(0,flyRender::s_screensizey+x_of1); glEnd(); glPopMatrix(); x_of1+=12; alpha1=alpha+0.02f; } g_flyrender->end_draw2d(); glDisable(GL_DEPTH_TEST); glViewport(0,0,flyRender::s_screensizex,flyRender::s_screensizey); glLoadIdentity(); Here is the screenshot with the problem, i've marked the little 512x512 viewport with red: http://www.cgdreams.net/problem.JPG I really hope you guys can help me, thx in advance and cheers!

Share this post


Link to post
Share on other sites
Advertisement
Ok guys, nvm , i manage to solve the problem myself, here are some screenshots

http://www.cgdreams.net/tfg/padgarden1.jpg

http://www.cgdreams.net/tfg/padgarden2.jpg

http://www.cgdreams.net/tfg/padgarden3.jpg

http://www.cgdreams.net/tfg/padgarden4.jpg

http://www.cgdreams.net/tfg/padgarden5.jpg

http://www.cgdreams.net/tfg/padgarden6.jpg

http://www.cgdreams.net/tfg/padgarden7.jpg

Share this post


Link to post
Share on other sites
Yes,i'm using the padgarden map for testing :) , it's a really great map, also i'm planning a project with backyards levels , so i guess the padgarden is the choice, i've tested out the bloom on other maps too, like natedm3 and some other quake3 maps.

Here is a link to a small clip showing water :

www.cgdreams.net/engine/water.rar

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!