Hehe, no idea A wild guess would be that coin does make the VBO setup in the rendering code before encountering the IndexedFaceSet, when it finds the SoCoordinate3 node. So that part would need to be done in BrepFaceSet too as there we don't use coordinate nodes. But from here on you are alone, I have only ver little knoweledge about coin internals and openGL coin general. I looked at your code and did not even really understand itNow how can we re-implement the SoBRepFaceSet::renderShape with it. This is where I am a little bit lost now
STEP reader improvement (Pass 4): Moving to OpenGL 3.2
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
What is great with FreeCAD is that we are learning everyday . I think I found ways to get access to the color from a Material, so I shall be able to finish the VBO rendering as it is without Coin3d support, which I do not know (but I am interested to learn). As soon as I will have finish the OpenGL implementation, and fixed the color and faceselection issue, I will have a look to Coin and check if the implementation might be better. At least if the direct OpenGL works, we will have a made a nice step forward. We need to write a small article on how works the rendering engine of FreeCAD, it took a week to my brain to track everythingickby wrote:Hehe, no idea A wild guess would be that coin does make the VBO setup in the rendering code before encountering the IndexedFaceSet, when it finds the SoCoordinate3 node. So that part would need to be done in BrepFaceSet too as there we don't use coordinate nodes. But from here on you are alone, I have only ver little knoweledge about coin internals and openGL coin general. I looked at your code and did not even really understand itNow how can we re-implement the SoBRepFaceSet::renderShape with it. This is where I am a little bit lost now
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
I know how you feel.ickby wrote:I looked at your code and did not even really understand it
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
Here is a short description how to use VBO in Coin: https://grey.colorado.edu/coin3d/vbo_rendering.html So it's basically a matter of structuring the scene graph accordingly.
However, with custom nodes VBO support is getting a bit harder because all the related classes are internal classes. So one way is to go with SoShape::startVertexArray/SoShape::finishVertexArray or everything is done independent of Coin.
However, with custom nodes VBO support is getting a bit harder because all the related classes are internal classes. So one way is to go with SoShape::startVertexArray/SoShape::finishVertexArray or everything is done independent of Coin.
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
Yep agree this is what I read yesterday night. I am currently finishing the VBO implementation on Coin side. I think I found ways to get the color working with VBO. let's see if it works, this is part of my learning curve. And if yes, how we could replicate that with Coinwmayer wrote:Here is a short description how to use VBO in Coin: https://grey.colorado.edu/coin3d/vbo_rendering.html So it's basically a matter of structuring the scene graph accordingly.
However, with custom nodes VBO support is getting a bit harder because all the related classes are internal classes. So one way is to go with SoShape::startVertexArray/SoShape::finishVertexArray or everything is done independent of Coin.
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
Ok, good news my step branch can now display within the VBO Colors on faces and Solid. So I just need to understand why I can't select a single face anymore, but the FPS is still at the same level aka x3 from standard implementation
For the one who had difficulties to understand the code, good luck with the latest update, this is becoming a complex stuff, but at least it works. I will post probably a Wiki entry on what I have done and how it works if you are interested.
For the one who had difficulties to understand the code, good luck with the latest update, this is becoming a complex stuff, but at least it works. I will post probably a Wiki entry on what I have done and how it works if you are interested.
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
Having it documented would for sure be useful.vejmarie wrote:I will post probably a Wiki entry on what I have done and how it works if you are interested.
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
Agree. I can now select standard surface ! Last step is to update properly the VBO when a part change occurs. I need to find a way to keep track of such event and reload the VBO with the right datas and I'll be done. Don't know yet the ETA, but progress are on tracktriplus wrote:Having it documented would for sure be useful.vejmarie wrote:I will post probably a Wiki entry on what I have done and how it works if you are interested.
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
You can easily trigger that from the viewprovider in the onChanged method. Look out if the changed property is the shape one and call a setup method in your node.vejmarie wrote: Last step is to update properly the VBO when a part change occurs. I need to find a way to keep track of such event and reload the VBO with the right datas and I'll be done. Don't know yet the ETA, but progress are on track
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2
Thanks, you just saved me some times and this is great !. Will try to run the implementation tonight.ickby wrote:You can easily trigger that from the viewprovider in the onChanged method. Look out if the changed property is the shape one and call a setup method in your node.vejmarie wrote: Last step is to update properly the VBO when a part change occurs. I need to find a way to keep track of such event and reload the VBO with the right datas and I'll be done. Don't know yet the ETA, but progress are on track