Archived

This topic is now archived and is closed to further replies.

accum buffer

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

First, I was reading through the chapter on buffers in "OpenGL Game Programming" by Hawkins and Astle, and got past the part where he talked about the accumulation buffer. He gave a quick example of how to use it for motion blur, and I tried to put this into effect on Nehe Lesson 6. Here''s the code: int DrawGLScene(GLvoid) // Here''s Where We Do All The Drawing { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_ACCUM_BUFFER_BIT); // Clear The Screen And The Depth Buffer glLoadIdentity(); // Reset The View glTranslatef(0.0f,0.0f,-5.0f); DrawCube(); glAccum(GL_LOAD,0.7); for(idx=1;idx<5;idx++) { glRotatef(objectAngle - (float)idx,0.0,1.0,0.0); DrawCube(); glAccum(GL_ACCUM,0.2); } glAccum(GL_RETURN,1.0); return TRUE; // Keep Going } Now, it just creates a slightly blurred, discolored cube that doesn''t move and slows down the program. Any idea on how to get it actually moving with the motion blur? Second, I was compiling some of the programs from the Nvidia OpenGL sdk, and I get this linker error: error LNK2019: unresolved external symbol "void __cdecl std::_Xlen(void)" (?_Xlen@std@@YAXXZ) referenced in function "private: bool __thiscall std::basic_string,class std::allocator >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE_NI_N@Z) What library am I forgetting to link? Thanks

Share this post


Link to post
Share on other sites
I don''t know much about accumulation buffers except that they are software so don''t expect any speed in your app.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
Yeah, I just wanted to see if I could pull off that motion blur with it. There''s probably a faster way to do it, but I just want to get it working with the accum buffer.

Share this post


Link to post
Share on other sites
Where are you moving the cube? Maybe you should render a couple frames into the accumulation buffer in each DrawGLScene. Right now you don''t have any translating or rotating based on user input.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites