LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Cornix on February 18, 2016, 23:04:48

Title: Porting rendering logic of GUI-toolkit to OpenGL
Post by: Cornix on February 18, 2016, 23:04:48
Hi everyone.

Introduction:
I am currently trying to port the renderer of a GUI-toolkit to OpenGL. It was originally implemented with AWT (abstract windowing toolkit). A naive implementation would be rather simple. I am quite certain however that the naive implementation would have horrible performance. This is why I ask here for some advice.

Problem:
Approach:
Naive Implementation:
Possible Problems:
I appreciate all advice on this. If there are any questions left unanswered please ask.
Thanks in advance.

This topic is cross-posted at: https://www.opengl.org/discussion_boards/showthread.php/198215-Porting-rendering-logic-of-GUI-toolkit-to-OpenGL?p=1281560#post1281560
Title: Re: Porting rendering logic of GUI-toolkit to OpenGL
Post by: abcdef on February 29, 2016, 12:02:18
Looks like the user is a bot of some sorts that responds to links in posts.

** I think some posts have been cleaned up, if a mod reads this then you can delete this too as it doesn't make sense anymore**



Title: Re: Porting rendering logic of GUI-toolkit to OpenGL
Post by: abcdef on February 29, 2016, 19:10:00
@cornix some questions

With your bounding check, do you wish to not draw the whole shape or do you wish to no draw part of a shape outside the boundary box?
Is there a maximum number of components to be drawn?

An alternative is have a VBO per shape, so only upload the data once. And then to use a model matrix to reshape, move the data to the desired spot each time. I am not a performance expert but I don't think having multiple draw calls should be an issue.(obviously depends on the number and if the CPU is going to bottleneck because of this).