Review Request 122702: Fix compiling with BUILD_MESH_LOADING enabled

Arjen Hiemstra ahiemstra at heimr.nl
Tue Feb 24 20:28:08 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122702/#review76565
-----------------------------------------------------------



graphics/filemesh.cpp
<https://git.reviewboard.kde.org/r/122702/#comment52735>

    The "primitive count" is a term from the OpenGL documentation and refers to the number of vertices per element, which depends on the rendering type. For meshes loaded from files, we always assume they need to be rendered as triangles, which means the total primitive count is triangle (or face) count * 3.
    
    Since several of the other properties depend on later loops it is harder to pre-allocate the buffer unless you account for those too. For example, the number of indices depends on the number of indices per face. On the other hand, since the mesh is loaded with aiProcess_Triangulate we can assume that each face has 3 indices. On the other hand, while not perfectly clear, the documentation states that the second argument is the total size of the vertex data. What the documentation /does/ fail to mention is that that is an amount in bytes. :)
    
    For the file mesh, since the formula to calculate the total size of the vertex data gets rather ridiculous, I opted to just have the buffer resizing take care of it instead, which means you only need to specify primitive count.


- Arjen Hiemstra


On Feb. 24, 2015, 2:04 p.m., Felix Rohrbach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122702/
> -----------------------------------------------------------
> 
> (Updated Feb. 24, 2015, 2:04 p.m.)
> 
> 
> Review request for Gluon and Arjen Hiemstra.
> 
> 
> Repository: gluon
> 
> 
> Description
> -------
> 
> I'm really not sure about setPrimitiveCount, as I changed the first argument. Was it wrong before, did "count" mean something else before, or did I just misunderstand the documentation?
> 
> 
> Diffs
> -----
> 
>   graphics/cmake/FindAssImp.cmake 4f1563f 
>   graphics/filemesh.cpp 65e82b6 
> 
> Diff: https://git.reviewboard.kde.org/r/122702/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Felix Rohrbach
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/gluon/attachments/20150224/0098c5aa/attachment.html>


More information about the Gluon mailing list