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.