QtPyHammer-devs / QtPyHammer

python alternative to Valve's "Hammer World Editor"
GNU General Public License v3.0
35 stars 2 forks source link

Rebuild renderer #8

Closed snake-biscuits closed 4 years ago

snake-biscuits commented 4 years ago

Setting up OpenGL, adding a object to renderbuffers and changing shaders & vertex formats is very manual

most of the work of adding renderable objects to a viewport happens in render.py with plenty of other code in ui.core doing setup, which it shouldn't have to

creating a viewport should be a simple as .setWidget(viewport())

viewport should have a "addBrush(...)" method also we need tweakable GL settings and possibly even a system benchmark

create more specialised classes if nessecary we do want to recycle viewports for the model browser at least

snake-biscuits commented 4 years ago

Maybe even work on snake-biscuits/PyOpenGL3 and release it as a pypi package Could add methods for simplifying work with buffers (not to mention passing raw bytes to functions rather than numpy arrays)

compile(*shaders, use=True, uniforms=True) -> program, [uniform locations]

could greatly simplify working with GL and add a bunch of much needed docstrings

snake-biscuits commented 4 years ago

Didn't get finished in 0.0.4 Still need a simple way of adding a brush to buffers Which means a restructure of solid.__init__ And 2D view(s) for creating brushes

snake-biscuits commented 4 years ago

Now experimenting with Vulkan, considering ditching fbs as it's back on python3.6

snake-biscuits commented 4 years ago

Vulkan is not supported on the "min-spec" testing / dev machine (Lenovo Ideapad 110S running Ubuntu) So back to focusing on getting glBufferSubData to present correctly

snake-biscuits commented 4 years ago

now have a working prototype in tests/qt_gl_render_manager.py working on implementation just need to rework the systems for modifying the Vertex & Index Buffers

snake-biscuits commented 4 years ago

protype was broken, I didn't look at it hard enough. Now I can move onto the buffer allocation parts of the render manager

snake-biscuits commented 4 years ago

progress! the render manager now does the rendering and presents what is in the buffers. however, the index buffer appears garbled. So, next step is finding if the vertex buffer is also garbled, possibly debugging shaders, and analyzing the index buffer contents & draw calls in general. Still, besides not rendering the clear shapes I want this is very very promising.

snake-biscuits commented 4 years ago

fixed the index buffer issues I was using the vertex buffer (always miss something when I copy & paste code) I was also incorrectly calculating the offset for indices for each brush

both these bugs are now resolved, the test code has been commented out and 0.0.5 is ready to ship!