GithubHelp home page GithubHelp logo

pogl's People

Watchers

 avatar  avatar

pogl's Issues

glGetError() returns GL_INVALID_OPERATION on glDrawArrays

When drawing a vertex buffer onto the screen, glDrawArrays results into an GL_INVALID_OPERATION error if the same vertex buffer has been bound on another (shared) context.

The result, when running in Release Mode, looks like it's flimmering (Works at random times).

Add support for mapping different types of resources at the same time

The specification allows mapping of different types at the same time. Example:

void* vertexBufferPtr = glMapBuffer(GL_ARRAY_BUFFER);
void* indexBufferPtr = glMapBuffer(GL_ELEMENT_ARRAY_BUFFER);

glUnmap(GL_ELEMENT_ARRAY_BUFFER);
glUnmap(GL_ARRAY_BUFFER);

This also measn that the current deferred solution will not work with this solution a.t.m.

One interesting idea would be to allow the developer to manually specify the binding point of the resource.

Decide what to do regarding binding buffers

Decide what to do regarding binding buffers.

Example (psuedo code):

BindVertexBuffer();
BindIndexBuffer();
Draw();

BindVertexBuffer();
Draw();

Show the index buffer from the first draw command still be bound?

Add suport for framebuffers

Add support for framebuffers:

class IPOGLFramebuffer;

Create framebuffer usage:

// Create a framebuffer that renders to the following textures. The index in the 
// textures array defines the color location used in the fragment shader
IPOGLTexture* textures[] = { texture0, texture1 }

// Create a framebuffer with the two textures above and a depth texture
IPOGLFrameBuffer* fb = context->CreateFramebuffer(textures, 2, depth);

// Release the textures if you do not need them anymore
texture0->Release(); texture1->Release(); depth->Release(); 

Render to the framebuffer:

// Set framebuffer
renderState->SetFramebuffer(fb);

// Unset framebuffer
renderState->SetFramebuffer(nullptr);

Use framebuffer textures inside the fragment shader:

// Retrieve the texture at the given index
IPOGLTexture* texture = fb->GetTexture(0);

// Set the uniform
renderState->GetUniformByName("texture")->SetTexture(texture);

// Release the texture reference counter
texture->Release();

Enforce uniform values set directly on the POGLProgram on apply only

Changes made on Uniforms retrieved from the POGLProgram instance is supplied to OpenGL directly if the program is applied. This is not the expected behaviour.

Changing uniform values and applying them in OpenGL directly should only be possible from the POGLRenderState.

Possible solutions are:

  1. Remove IsProgramApplied method and wrap the returned uniform in a POGLRenderState specific uniform for the currently applied program.
  2. Have two methods. FindUniformByName and FindDefaultUniformByName

Safe vs Unsafe buffer mapping

All buffer mapping is "unsafe" at the moment, i.e. GL_MAP_UNSYNCHRONIZED_BIT is used for glMapBufferRange and GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD is used for buffers on AMD-chipset.

All OpenGL calls are always made from the main thread (where the immediately render context lives). So I'm not sure if this approach is necessary for the GL_MAP_UNSYNCHRONIZED_BIT since the mapping is not made until the command been processed by the OpenGL command queue.

The GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD requires it however, since we don't put the new data onto the OpenGL command queue to be transferred.

Add basic mathematical functions for the built-in types

Add a simplified mathematical library for POGL. Example:

POGL_MAT4F viewMatrix;
POGLXPerspective(near, far, fov, ratio, &viewMatrix);

The following features should be available:

POGLXLookAt(const POGL_VEC3F& eye, const POGL_VEC3F& center, const POGL_VEC3F& up, POGL_MAT4F* matrix)

Prevent unnecessary commands in the command queue when possible

It's impossible to completely prevent unneccessary commands (state changes) in the command queue. But we can make an assumptions that prevents some of them:

We know that all the commands in the command queue for the same deferred render context will be called in the same order as they are generated

Memory leak when releasing the IPOGLDeferredDeviceContext

Although quite unusual, but the IPOGLDeferredDeviceContext increase the reference counter of the IPOGLVertexBuffer instances more than releases them when the thread closing down and the IPOGLDeferredDeviceContext being released, but still has commands on the queue.

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.