Skip to content

Commit 9dd8dc4

Browse files
committed
Newsletter 14: OpenGL preprocessor
1 parent bd6dac1 commit 9dd8dc4

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

content/posts/newsletter-014/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,29 @@ If needed, a section can be split into subsections with a "------" delimiter.
6464

6565
## Learning Material Updates
6666

67+
### [An OpenGL preprocessor for Rust]
68+
69+
With the power of cargo build scripts full power of [Tera], you can create advanced
70+
GLSL preprocessor which can generate code conditionally, in loops, and even
71+
inherit code from other templates.
72+
73+
![An OpenGL preprocessor for Rust](opengl_preprocessor.png)
74+
75+
Writing plain GLSL code is uncomfortable, code is quite often is duplicated, libraries
76+
aren't something natural for GLSL (means you can't out of the box do #include "library.glsl").
77+
Last point especially problematic if some constants actually originate in your
78+
game logic (like the number of player types). Updating these values manually in
79+
your shader code is repetitive and prone to both error and simple forgetfulness.
80+
It’s really helpful to build some kind of preprocessor for your GLSL code,
81+
which can include other files, so you can organize your code into manageable chunks.
82+
With the power of [Tera], it's now easy to accomplish.
83+
Because Rust is also often used for web projects, which need a lot of templated
84+
web-pages preprocessing, we can borrow such technology for our needs,
85+
combine it with cargo build scripts and create compile-time preprocessing tool.
86+
87+
[tera]: https://tera.netlify.app
88+
[An OpenGL preprocessor for Rust]: https://codecrash.me/an-opengl-preprocessor-for-rust
89+
6790
## Library & Tooling Updates
6891

6992
## Popular Workgroup Issues in Github
Loading

0 commit comments

Comments
 (0)