Commit Graph

28 Commits

Author SHA1 Message Date
Lephenixnoir f13096dd6e
gl: switch to bind-attribute style + option for debug output 2023-10-29 12:14:06 +01:00
Lephenixnoir a755c28113
gl: cache attribute locations in ShaderProgram 2023-10-28 21:16:08 +02:00
Lephenixnoir caff84753a
azur: use flexible C++ functions for main loop 2023-10-28 19:58:13 +02:00
Lephenixnoir 1cd3702dfa
gl: simpler interface to specifying vertex attribute layouts 2023-10-28 17:25:44 +02:00
Lephenixnoir a61e07bd54
gl: WIP shader abstraction 2023-10-28 13:38:13 +02:00
Lephenixnoir 44f20d9b5c
azrp: add azrp_print() and azrp_print_opt() shader functions 2023-06-15 15:41:57 +02:00
Lephenixnoir f3a1e90788
azrp: in-place command generation + variadic commands
This commit changes the command generation mechanism. Instead of
creating a command on the stack then calling azrp_queue_command() which
does a needless copy, the new function azrp_new_command() allocates
directly inside the command buffer, avoiding the copy.

This concept is pushed further with the introduction of finer-grained
functions azrp_alloc_command(), azrp_finalize_command() and
azrp_instantiate_command(), which split this process in three steps.
This allows generating commands of variadic size in-place in the
command buffer as well as using non-interval fragment sets.
2023-06-15 15:08:45 +02:00
Lephenixnoir 0cd9acc12f
azur: configure azrp resolution based on azur_init() in gint 2023-06-12 20:39:44 +02:00
Lephenixnoir 2f185a36d7
azrp: first version of text shader (slow!), based on topti-cg 2023-06-12 20:39:43 +02:00
Lephenixnoir 2e7c076e60
azrp: add rectangle shader (azrp_rect): flat, invert, darken, whiten
Flat is optimized but invert, darken and whiten are not.
2023-05-31 23:29:26 +02:00
Lephenixnoir fe4b339327
azrp: configure shaders automatically 2023-05-29 12:49:29 +02:00
Lephenixnoir f3bd29fb32
azrp: allow any point order in triangle shader 2023-05-29 09:50:06 +02:00
Lephenixnoir 6eeef0fce9
libnum: add optimized num16 division for SH4AL-DSP 2023-04-29 12:14:09 +02:00
Lephenixnoir e86a95f6d6
azrp: update image shader to use dwindow settings 2022-11-19 17:47:21 +01:00
Lephenixnoir 8448467cd4
azrp: bump command limit to 1024
It used to be 256 due to XYRAM limits but it's easy to hit.
2022-08-20 20:54:52 +02:00
Lephenixnoir 8badb9f9cc
azrp: add very basic triangle shader 2022-08-20 11:49:21 +02:00
Lephenixnoir c74e8fcf13
azur: restructure to adhere to a more consistent C++ style 2022-07-18 23:02:13 +01:00
Lephenixnoir 2e63daa59a
meta: new build system (and emscripten fullscreen)
* Update the build system to support intermediate installs (instead of
  exposing CMake targets that were only usable from within the main
  CMakeLists.txt).
* Finish the emscripten build and add detailed instructions in
  README.md.
* Get rid of runtime GLSL files by embedding them into a C file. This
  solves the annoying problem of where to install them and how to find
  them at runtime.
* Provide FindAzur.cmake to access the library. At the moment the module
  still needs to be found which requires a set(CMAKE_MODULE_PATH) in
  user applications. I consider this an acceptable compromise.
* Automatically go soft-fullscreen in the emscripten application.
2022-06-05 14:08:49 +01:00
Lephe 8ac9ac747a
azur: image shader with dynamic effects, and 16-row fragment 2022-05-27 20:55:44 +01:00
Lephe e124719de3
azur: share command data between fragments (with updates) 2022-05-27 20:55:44 +01:00
Lephe 911cc8e5ac
azur: documentation and optimization on rendering 2022-05-27 20:55:44 +01:00
Lephe c5cdb2b885
azur: rename tex2d shader to image 2022-05-27 20:55:44 +01:00
Lephe c16b1a85c6
azur: implement support for P4_RGB565A (P4) 2022-05-27 20:55:44 +01:00
Lephe 0fec6da1c4
azur: progress on tex2d as bopti, custom command sorter 2022-05-27 20:55:33 +01:00
Lephe 33e6a44578
azur: add shader uniforms, clear shader, super-scaling 2022-05-27 20:55:33 +01:00
Lephe 0005249f71
azur: implement all parity cases of the tex2d shader 2022-05-27 20:55:33 +01:00
Lephe 31da1c0998
meta: build system for Dear ImGui + GL3W + FreeType2
* Add build instructions for Dear ImGui that build the SDL +
  OpenGL 3 / OpenGL ES 2 backend.
* Use Dear ImGui's bundled GL3W as a loader (including in azur itself,
  which has not been using a loader until now).
* Properly select headers for OpenGL ES 2.0 (with the VAO extension) and
  attributes for WebGL; clear up OpenGL 4 error codes.
* If FreeType2 is available through pkg-config, or if empscripten is
  used (since it has a FreeType port), use FreeType to render fonts in
  Dear ImGui for much-appreciated hinting quality.

Minor changes:
* Add window title to azur_init().
* Use emscripten's infinite loop simulation to make sure everything
  stays in the same thread. This is needed for Dear ImGui to work.
2022-05-27 20:55:24 +01:00
Lephe 3a3f607303 azur: basic gint/SDL/emscripten setup with rendering
This basic model supports a couple of options, but mostly designed for
three targets:

* gint on fx-CG 50, with a custom XRAM-streaming rendering engine that
  is (to my knowledge) more powerful than all other existing options;

* The standard SDL/OpenGL combo for desktop platforms, using modern
  OpenGL 3.3 and some basic shaders.

* The web platform with emscripten and its OpenGL ES 2.0 API that maps
  to WebGL 1.0. OpenGL ES 2.0 code could also be used for mobile
  platforms if this ever comes up.

The current code only includes setting up the program's main loop
(update/render) as well as basic rendering.

The framework of gint's rendering engine is drawn ("shader"-based
rendering in XRAM). On the OpenGL side, some utilities are defined,
including a primitive layer of shader code compatibility for OpenGL 3.3
vs. OpenGL ES 2.0. Actual rendering is still at prototype stage.
2021-07-04 14:46:36 +02:00