Results 1 to 2 of 2

Thread: Motion blur/swipe trails with accumulation buffer

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2014
    Posts
    10

    Motion blur/swipe trails with accumulation buffer

    Hi, I have a simple animation of a ball bouncing continuously around a 500-500 window and was wondering how do I use the accumulation buffer to make my point look like it has swipe trails/motion blur? I've done some research on accumulation buffers but I didn't fully understand the examples I came across.
    Thank you in advance!

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2014
    Posts
    10

    My code, but I dont know if what I've done it right at all?

    Code :
    void renderScene()
    {
    	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    	glClear(GL_ACCUM_BUFFER_BIT);
     
    	glClearColor(0, 0, 0, 1);
    	glAccum(GL_RETURN, 1.0);
    	glAccum(GL_MULT, 0.5 );
     
     
    		glPointSize(10);
    		glBegin(GL_POINTS);
     
    		glColor3f( 1.0f, 1.0f, 1.0f );
    		glVertex2f( xpos, ypos );
     
    		xpos = xpos + xvel;
    		ypos = ypos + yvel;
     
     
    		if(xpos >= 500)
    		{
    			xvel = -xvel;
    		}
    		if(xpos <= -500)
    		{
    			xvel = -xvel;
    		}
     
    		if(ypos >= 500)
    		{
    			yvel = -yvel;
    		}
    		if(ypos <= -500)
    		{
    			yvel = -yvel;
    		}
     
    		glEnd();
     
    		glAccum(GL_ACCUM, 1.0);
    		glutSwapBuffers();
     
    }

Similar Threads

  1. Glow / blur / trails ?
    By Selfdestroyer in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-14-2007, 03:21 AM
  2. Motion blur using accumulation buffer
    By des in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 07-07-2006, 01:51 AM
  3. Creating motion trails with glCopyTexSubImage2D
    By fast-eric in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 05-05-2006, 05:22 PM
  4. Motion Blur (copying the content of frame buffer to a texture)
    By proof88 in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 02-18-2006, 01:06 AM
  5. Motion Blur Without Accum buffer
    By OgliX in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 09-24-2003, 11:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean