Jump to content
Eternal Lands Official Forums
Sign in to follow this  
Xaphier

frame buffer

Recommended Posts

Hi everyone!

 

I added frame buffer support to the cvs version of the client. Perhaps somebody wants to test it. To enable it, compile the client with -DUSE_FRAMEBUFFER. Every comment is welcome. :D

Share this post


Link to post
Share on other sites

Can't compile it together with -DMEMORY_DEBUG for some reason I can't fathom. When using it on a GF MX 440 Go, it segfaults:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 9165)]
0x0000000000000000 in ?? ()
(gdb) bt full
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x0000000000426683 in make_color_framebuffer (width=1024, height=512,
   FBO=0x70a22c, FBORenderBuffer=0x70a230, FBOTexture=0x70a234)
   at framebuffer.c:32
No locals.
#2  0x000000000044eb8f in make_reflection_framebuffer (width=1, height=7381548)
   at reflection.c:339
No locals.
#3  0x00000000004341ff in init_stuff () at init.c:735
       __FUNCTION__ = "init_stuff"
#4  0x000000000043c6a3 in main (argc=1, argv=0x70a22c) at main.c:223
No locals.

 

EDIT: looks like it's calling a function at NULL, so it's probably because this chipset doesn't provide an extension you're using.

Edited by Grum

Share this post


Link to post
Share on other sites
Can't compile it together with -DMEMORY_DEBUG for some reason I can't fathom. When using it on a GF MX 440 Go, it segfaults:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 9165)]
0x0000000000000000 in ?? ()
(gdb) bt full
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x0000000000426683 in make_color_framebuffer (width=1024, height=512,
   FBO=0x70a22c, FBORenderBuffer=0x70a230, FBOTexture=0x70a234)
   at framebuffer.c:32
No locals.
#2  0x000000000044eb8f in make_reflection_framebuffer (width=1, height=7381548)
   at reflection.c:339
No locals.
#3  0x00000000004341ff in init_stuff () at init.c:735
       __FUNCTION__ = "init_stuff"
#4  0x000000000043c6a3 in main (argc=1, argv=0x70a22c) at main.c:223
No locals.

 

EDIT: looks like it's calling a function at NULL, so it's probably  because this chipset doesn't provide an extension you're using.

205725[/snapback]

Really dumb question, did you remember to do a full recompile after changing the compile options?

Share this post


Link to post
Share on other sites
Really dumb question, did you remember to do a full recompile after changing the compile options?

Yes

Share this post


Link to post
Share on other sites

@Lachesis The scene is mirrored renderd, into a frame buffer and then used as texture for the water tiles. Nothing big.

 

@Grum I found the bug, but can't commit to cvs at the moment. Don't know why :hiya:

Share this post


Link to post
Share on other sites
It's a problem with berlios, I can't update cvs either.

205765[/snapback]

They do that regularly. You just have to wait for it to come back online.

Share this post


Link to post
Share on other sites

Okay, thanks Xaphier, it now properly complains I don't have GL_EXT_framebuffer_object, and continues. Unfortunately, for obvious reasons I can't tell you if the framebuffer code works :w00t:

 

EDIT: but frame rate drops from >= 30 to about 2 when I enable USE_FRAMEBUFFER

Edited by Grum

Share this post


Link to post
Share on other sites

The compile problem with -DMEMORY_DEBUG was subtle but interesting. We have to be careful when the redefine of malloc & co. takes place, as it shall affect our own files yet only our own. stdlib.h defines prototypes for malloc, free and calloc, which causes compile errors when elmemory.h is included before stdlib.h. I modified global.h to get around this, but we still need to be careful.

Share this post


Link to post
Share on other sites
OK, I added the #defines for the frame buffer. Now it should work with old opengl headers. :)

206027[/snapback]

 

THx, compilation OK.

 

I upgraded my drivers because I did'nt have GL_EXT_framebuffer_object.

 

I note an important drop of FPS.

 

With my GeForce FX 5200 (128MB), I was before at 16-17 FPS and now 4-5 FPS.

With my GeForce 6610 XL (12! MB), before 50-60 fps, and now 35-45 FPS.

 

Is it possible to add an option to desactivate using framebuffer?

Share this post


Link to post
Share on other sites
The idea is to use this method and generate waving reflections and such, because otherwise it's not really worth it.

206131[/snapback]

ahh, so that's the goal. nifty. some sort of sine function with adjustable amplitude/strength for normal waves, as well as rings around where raindrops land would be good.

also, if possible to adjust the alpha of the framebuffer itself, we can have partly-see-through water

Share this post


Link to post
Share on other sites

Lhibou, if you miss those defines you have an outdated glext.h. You can get a recent one from the SGI webpage: http://oss.sgi.com/projects/ogl-sample/registry/

 

Though it is probably convenient to put those defines into gl_init.h I have to say I don't like it one bit. Then we can as well ship our own copy of glext.h along with the client sources, which though still not wise at least would be better.

 

P.S. Now after having nagged a bit, can we have reflections of particles? :D

Edited by Lachesis

Share this post


Link to post
Share on other sites

Short answer: Yes, no problem, I can do this. We also can add view dependent refraction and caustics. But before I would like to know if there are problems with the frame buffer or not. :)

 

And yes, I know it is slower than befor, but befor speeding it up I am looking for bugs. :omg:

Share this post


Link to post
Share on other sites
Lhibou, if you miss those defines you have an outdated glext.h. You can get a recent one from the SGI webpage: http://oss.sgi.com/projects/ogl-sample/registry/

 

Though it is probably convenient to put those defines into gl_init.h I have to say I don't like it one bit. Then we can as well ship our own copy of glext.h along with the client sources, which though still not wise at least would be better.

 

P.S. Now after having nagged a bit, can we have reflections of particles? :)

206456[/snapback]

 

Lachesis, thx for the information. Yesterday I did'nt find where to dl the.h.

Share this post


Link to post
Share on other sites
P.S. Now after having nagged a bit, can we have reflections of particles? :(

206456[/snapback]

 

Some particles might look wrong though... Like fountains particles and such.

Share this post


Link to post
Share on other sites

Wrong in what way?

Btw, the particles are far from being perfect, the additive blending obviously doesnt work with fog, and the constant size regardless from distance makes them look odd when very close or very far. :inquisitive:

Share this post


Link to post
Share on other sites
Like waterfall particles flowing up in the reflection.

208423[/snapback]

That's how water droplets look though when falling, since it's a direct reflection. However, you might want to add "splashes" and such to make it more realistic, otherwise it may very well look "wrong." You want to make sure the water surface is clearly noticeable, or it would look like the particles are rushing towards each other in perfect mirror unison. Not sure if that made sense, so don't mind it if it doesn't.

Share this post


Link to post
Share on other sites

Can I have a screenshot? I only have my notebook here, and the graphics is teh sukc!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×