Fly3d - bloom implementation in ship game

Started by
2 comments, last by catalin1505 18 years, 6 months ago
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!
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
Hey these are from the q3 map pad garden... damn it doesnt look this good in game. Very nice!!
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

This topic is closed to new replies.

Advertisement