Skip to content

Add possibility to transfer BufferObjects from Meshes to and from Textures #6

@eikel

Description

@eikel

Initially reported by @ClaudiusJ as #558:

E.g. to have a simple way of modifying particles using a pixel shader:

Texture t( 1000x1000, correctFormat );
initParticlePositions( t )

Mesh m( correctFormat );

loop{

  // update positions using a shader
  Texture t2 = renderFullscreenQuadToTexture( t, animationShader )


  // attach new coordinates to mesh
  swap( m._accessVBOBuffer(), t2._accessBufferObject() )

  // render particles to screen
  ...
  m.display()
  ...

  // move vertexData back into the buffer.
  swap( m._accessVBOBuffer(), t2._accessBufferObject() )
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions