Rendering issue with different computers

前端 未结 2 1097
小蘑菇
小蘑菇 2021-01-07 14:02

So i am making a short of tower defense game. I shared a build with them so i can check if everything performs as it should on another host.

And what actually happe

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-07 14:40

    After further debugging sessions with my friends and much tryouts i managed to find the problem. This took me two solid days to figure out and really it was just a silly mistake.

    glDrawArrays(GL_TRIANGLES, 0, aVBO.GetVerticesSize());
    

    The above code does not get the vertices size (as points) but as a total number of floats stored there. So everything is multiplied by 3. Adding a /3 solved it.

    So i assume since the total points where multiplied by 3 times the vbo "stole" data from other vbos stored on the gpu. (Hence the tree model stack to my tower).

    What i can't figure out yet though, and would like an answer on that, is why on my computer everything rendered fine but not on other computers. As i state in my original question a hint would be that my computer is actually a developer station while my friend's not. Anyone who is kind enough to explain why this effect doesn't reproduce on me i will gladly accept his answer as a solution to my problem.

    Thank you

提交回复
热议问题