Git Product home page Git Product logo

Comments (8)

panzergame avatar panzergame commented on May 29, 2024

It's interesting, But, how to detect which vertices are modified ? Set a modification flag per vertices ?
If this is the only case we need first to optimize data send to the VBO.

from upbge.

BluePrintRandom avatar BluePrintRandom commented on May 29, 2024

how about when we move a vert or change the vertex color , add it to the list?

from upbge.

panzergame avatar panzergame commented on May 29, 2024

So just a list of index of vertices ? maybe the index + a modifiaction flag like the current one in RAS_MeshObject.
e.g:

struct VertexModified
{
unsigned int index;
char flag;
}

So it will be :

RAS_MeshObject::SetVeterxModified(array, VertexModified(index, RAS_MeshObject::POSITION_MODIFIED)

from upbge.

panzergame avatar panzergame commented on May 29, 2024

To reduce the glBufferSubData call i have an idea:
We store all vertex index in a list, we sort the index and iterate on all indices.
If an index = next_index - 1 we remove the index (if it's not the first one). By doing this we will get a list of continuous modified vertexes, e.g:
0:9, 16:18, 150:201

After this sort stage, we use glMapBufferRange to update these part of the buffer (iirc we can multi thread these call) and finally a glUnmapBuffer.

from upbge.

youle31 avatar youle31 commented on May 29, 2024

Would this be compatible with GLSL shaders already compiled (gpu_material.c and gpu_shader_material.glsl) that use gl_Vertex?

from upbge.

BluePrintRandom avatar BluePrintRandom commented on May 29, 2024

Why did you close this?

On Sun, Jul 24, 2016 at 8:37 AM, Diego Lopes [email protected]
wrote:

Closed #42 #42.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#42 (comment), or mute the
thread
https://github.com/notifications/unsubscribe-auth/AG25WScXkGPIacl5ldW0j1-p_vjkKbiyks5qY4aogaJpZM4HhKtR
.

from upbge.

DCubix avatar DCubix commented on May 29, 2024

I have a better approach. Whenever the user calls the method to change a vertex or the vertex data, switch a boolean isChanged to true, then before rendering check if it has been changed. Then switch the isChanged variable back to false and update the vertex data in the VBO.

from upbge.

panzergame avatar panzergame commented on May 29, 2024

This is already done by the RAS_MeshObject::m_modifiedFlag and RAS_IStorageInfo::SetMeshModified.

from upbge.

Related Issues (20)

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.