Giter VIP home page Giter VIP logo

rendering's People

Contributors

claudiusj avatar eikel avatar meisteryeti avatar murrani avatar oatflake avatar romanmeusch avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rendering's Issues

Add possibility to transfer BufferObjects from Meshes to and from Textures

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() )
}

Reduce the number of OpenGL calls when displaying a mesh

Initially reported by Benjamin as #581:

At the moment, there are many calls to ​glEnableClientState/​glDisableClientState when not using a shader, or to ​glEnableVertexAttribArray/​glDisableVertexAttribArray when using a shader. This is because we do not cache the previous value, enable all states/arrays in MeshVertexData::bind and disable them again in MeshVertexData::unbind.
A low-level caching of every array might be too tedious, but maybe one could only change the enabled states/arrays when changing the VertexDescription.

Trace of rendering three meshes
The trace shows that maybe even the calls to glBindBuffer(..., 0) are superfluous.

Splitting of Meshes / GeometryNodes

Initially reported by @rpetring as #83:

Splitting triangles till max size of Triangle < threshold
Splitting meshes into two parts
Splitting meshes till size of mesh < threshold
Splitting meshes till #polys in mesh < threshold

Splitting GeometryNodes till ...

Improve create... functions in MeshBuilder

Initially reported by Benjamin as #534:

If the MeshBuilder::create... functions get a MeshBuilder instance, things like combining or transforming meshes would be much easier.

New data classes

This is part of the redesign (see #10).
To have a base for discussion, I created a first draft, how the new classes might look like:
newdataclasses

Add a pushable LightingContext to the RenderingContext

Initially reported by @ClaudiusJ as #514:

Something like this:

rc.pushAndResetLightingContext() // all lights are off
rc.pushLight( someLightParameter ) // one light is on
...
// do something with this one light
...
rc.popLightingContext() // restore the old lighting

Separate rc.setTexture( unit, Texture) and rc.markTextureUnitEnabled( unit, bool )

Initially reported by @ClaudiusJ as #704:

"setTexture(...)" binds the given Texture to the texture unit.

"markTextureUnitEnabled(...)" sets the given texture-enabled-uniform to true and enables the gl texture state (glEnable(GL_TEXTURE_??) for the fixed function pipeline.

This is needed for setting (=binding) textures that should not be used for normal rendering. (Problem: reflection textures, fixed function pipeline and AMD-graphics card...).

Implement AFTER Diss-related measurements are finished!

BufferObject - move assignment operator may cause memory leak

Initially reported by Ralf as #600:

if this->bufferId was not 0 before, the memory gets never freed...

BufferObject & BufferObject::operator=(BufferObject && other) {

    Handle self-assignment.
    if(this == &other) {

        return *this;

    }
    bufferId = other.bufferId;
    Make sure the other buffer object does not free the handle.
    other.bufferId = 0;
    return *this;
}

Ideas for a redesign

While looking at some classes in Rendering, I got some ideas for a redesign. I collect them here. When you want to implement parts that are mentioned here, please create a new issue to track the progress and mention it here.

  • The RenderingContext should be passed to all functions that call gl* functions.
  • Functions that are marked as deprecated as of OpenGL 3.3 should be removed completely.
  • Something like an MemoryObject should be added as a representation of an array in memory (see #11). There should be two main manifestations of it: A MainMemoryObject (something like std::vector or Util::Bitmap) and a GraphicsMemoryObject (a BufferObject or Texture). Functions like upload and download could convert between the two types (maybe using specialized template instantiations). They can be used in Texture and Mesh (see also #6).
  • The previously mentioned MemoryObjects should be used inside a Mesh to allow different Mesh configurations (no or single IndexData, single or multiple VertexData).
  • Keep track of Meshes and reduce the number of state changes required during rendering (see #3).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.