I did a little snippet allowing to motion-blur the overall scene.

here is the result :
http://cedric.brun.free.fr/Tortoose/screenBlurGoingFront.png
and 
http://cedric.brun.free.fr/Tortoose/screenBlurTurningAround.png

Hum, it need a trivial patch to soya :
in opengl.pyx add

def glAccum(int value,float coef):
  global c_opengl
  c_opengl.glAccum(value,coef)


Here is the code :

class BlurringCamera(soya.TravelingCamera):
   def __init__(self,scene,attenuation=0.3):
     """ attenuation should be between 0 and 1, but 0.85 is a good value"""
     soya.TravelingCamera.__init__(self,scene)
     self.attenuation = attenuation

   def render(self):
      #keep back the scene before
      soya.opengl.glAccum(soya.opengl.GL_LOAD,1.0)
      # here comes the new one
      soya.TravelingCamera.render(self)
      # and now mixing the two      
      soya.opengl.glAccum(soya.opengl.GL_MULT, self.attenuation)
      soya.opengl.glAccum(soya.opengl.GL_ACCUM, 1-self.attenuation)
      # and giving it back
      soya.opengl.glAccum(soya.opengl.GL_RETURN, 1.0)

Reply via email to