Introduced a new PBRMaterial resource type. Materials are now fully
described with .material files instead of being hardcoded. Added some
functions to abstract away and simplify set up of PBR shaders.
* lasers: new SDF-based renderer (WIP)
* lasers: tweak sdf_apply shader
* lasers: fix incorrect rendering at 'unlucky' resolutions
* lasers: optimize rendering of multiple lasers
Try to coalesce render passes as much as possible
* lasers: fix warning
* lasers: move rendering into a new file
* lasers: correct "time" coordinate mapping for texturing
* lasers: wrote a novel about laser rendering [skip ci]
* lasers: fux tpyo
* remove references to old laser shape shaders
* lasers: fix some rendering edge cases
On the renderer side, the concept of a "texture class" has been
introduced. There are currently two texture classes: 2D and Cubemap.
These map to `sampler2D` and `samplerCube` in shaders, respectively.
Textures now also have an additional `layers` property. Its meaning
depends on the texture class. For simple 2D textures, there is always
only 1 layer. Cubemaps always have 6 layers, one for each face. In the
future, layers could be used to represent depth in 3D textures and
individual images in array textures.
Much of the texture loading code has been refactored, as it wasn't
adequate for loading multiple images for a single texture. Both Basis
Universal cubemaps and traditional image-based cubemaps are supported,
although no runtime preprocessing is implemented for cubemaps. The Basis
Universal format is strongly recommended.
The mkbasis utility can now convert 2:1 equirectangular panoramas into
`.basis` cubemaps with the --equirect-cubemap map.
A `vec3 fixCubeCoord(vec3 v)` function has been added to `utils.glslh`,
to convert a vector into the suitable coordinate system for sampling a
cubemap. The vector doesn't need to be normalized.
Doing it in the vertex shader isn't very efficient.
This also cleans up light setup code and avoids compatibility problems
with arrays of varying structs in shaders, which SPIRV-cross can't
translate for 'legacy' targets yet (KhronosGroup/SPIRV-Cross#1604).
Remove 45 degree uv rotation from the shader as it's not needed anymore.
Bring back the stretched perspective, because the background was
designed with it in mind, and looks wrong otherwise.
* WIP cutscenes
* cutscene tweaks
* cutscene: erase background drawing under text
* Make text outlines thicker
* Prepare an interface for adding new cutscenes
* Basic progress tracking for cutscenes
* cutscene: support specifying scene name and BGM
* cutscene: exit with transition after scene ends
* Implement --cutscene ID and --list-cutscenes CLI flags
* fix progress_write_cmd_unlock_cutscenes
* Play intro cutscene before entering main menu for the first time
Also added --intro parameter in dev builds to force playing the intro
cutscene
* Add intro cutscene
* cutscenes: update opening/01 scene
* add Reimu Good End
* remove Bonus Data
* split up a bit of dialogue, revert an image change in intro
* small typo
* most cutscenes complete
* smartquotify
* finish Extra intros
* new cutscenes routed into main game
* fix ENDING_ID
* rough 'mediaroom' menu
* fix cutscene menu crash
* derp
* PR changes
* fixing imports
* more PR fixes
* PR fixes, including updating the script to #255
* add in newlines for readability
Co-authored-by: Alice D <alice@starwitch.productions>
The SPIR-V optimizer tends to transform early function returns into
awful switch/break abominations. ANGLE's D3D backend mistranslates such
code, leading to a bad case of blackscreenitis.
This commit fixes a few known affected shaders (reimu_gap, fxaa,
boss_zoom), but I expect there to be more undiscovered cases.
Fixes #241
Fixes #242