You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1d123a6
Browse filesBrowse the repository at this point in the historyBrowse files
Most of the plotter-related features are already implemented, the only "math-y" thing missing being a few elementary functions, and some non-elementary functions that are convenient (like Lambert-W and the Zeta function). This means that we steer into the bane of every project's existence: making it usable!
3
+
With 3D rendering complete, all of the essential features of the _plotter_are done. This means that, had we wanted to, we could ship this as a fully-fledged math engine and leave the job of actually turning it into an application to someone else. But we can't be doing that! Therefore, it's time for us to start making way to shipping the project.
4
4
5
-
I plan on shipping this project as a single executable rather than a zipped folder, and later compiling it into web assembly for a demo. In either case, we can't work with files, because browsers don't have file systems in the traditional sense. Virtual file systems _do_ exist, but there is a much simpler solution: turning files into strings!
6
-
Now, this could be done by simply embedding a string like `const std::string vertex_source = R"({our code})"`, but if we wrote code this way, we lose our syntax highlighting and linting! The only solution is to create these strings dynamically at build-time.
5
+
First of all, I wanted this plotter to be complete, meaning that it implements _every_ elementary function (those being, in simple terms, a set of well-behaved functions that mathematicians use). This is simply a manner of writing the already existing real and imaginary components of these functions (and their derivatives), which are well-known and defined.
6
+
Is this essentially just writing boilerplate? Yes! Thankfully, this is not my first rodeo implementing these functions, so I could port a good amount of code from an old project. This is all done now: all elementary functions and their derivatives have been implemented!
7
7
8
-
And that's pretty much it! We just now refactor any file access we wanted to use our `get_source` function, that secretely fetches the built string in compile-time if it's known.
8
+
Now, for the engine-specific things: so far we have been writing shaders into files and reading them at runtime. This works, but adds unnecesary file I/O operations, and makes it impossible to port our entire project as one .exe file. So we had to remove that!
9
+
One way to do this would be by writing our GLSL code in strings, but this removes linting. Instead, I implemented a dynamic source string builder at build time.
10
+
11
+
Attached, the new functions!
12
+
13
+
14
+
**Related Commits**
15
+
16
+
[Commit 7923ee3](https://url.jam06452.uk/1vzsu0m): File conversion to strings at build-time
17
+
[Commit 5ba94c0](https://url.jam06452.uk/7erthk): Complete removal of file reading logic
0 commit comments