Commit graph

296 commits

Author SHA1 Message Date
Andrei Alexeyev
44ef44e24f
stage3: remake wriggle's spellbg as a shader (and fix it)
Old version broke when we started using a floating point framebuffer for
the background.
2022-02-13 01:21:36 +02:00
Andrei Alexeyev
85d5f10161
shader/mainmenubg: work around nvidia shader compiler bug 2022-02-06 19:35:56 +02:00
Lukas Weber
1260dcc0c3
credits: new background 2022-01-28 18:06:45 +02:00
laochailan
a157b88f92
stage6: new PBR background 2022-01-28 18:06:45 +02:00
Andrei Alexeyev
9f19a66328
stage2: update background 2022-01-03 07:35:49 +02:00
Andrei Alexeyev
417471b784
stage4: update background
* Add parallax mapping for pebbles
* Optimize meshes
* Add bevels to bridge and stone path
* Misc shading adjustments
* Enable anisotropic filtering
* Revamp corridor lighting + add torches
* Improve water
2022-01-03 07:31:09 +02:00
Andrei Alexeyev
dc52836af7
gl33: enable sRGB conversion when rendering to sRGB textures
This matches the gles30 behavior, which can not be changed without
relying on extensions. It also lets us simplify the texture_post_load
shader.
2021-12-22 22:46:59 +02:00
Andrei Alexeyev
0c22d53bb0
shaders/pbr: refactor PBR shaders for modularity 2021-12-17 14:42:14 +02:00
Andrei Alexeyev
b0578cad61
stagedraw: experimental boss zoom shader tweak 2021-12-17 14:40:25 +02:00
Andrei Alexeyev
e969bc1306
shaders/zbuf_fog: use proper alpha composition 2021-12-17 14:40:17 +02:00
Andrei Alexeyev
a55355be0d
shaders: cleanup zbuf_fog; add combined fog+tonemap shader 2021-12-17 14:40:04 +02:00
Andrei Alexeyev
296ca4dd4e
pbr: Uchimura tonemapping by default 2021-10-29 16:13:17 +03:00
Andrei Alexeyev
2fa61654d1
pbr: make the BRDF more "PB"
With reference to https://docs.google.com/document/d/1ZLT1-fIek2JkErN9ZPByeac02nWipMbO89oCW2jxzXo
2021-10-29 16:13:12 +03:00
Andrei Alexeyev
fa3d63b9e2
shaders: add a library of hashing functions 2021-10-29 16:13:09 +03:00
Andrei Alexeyev
dafcd7606e
shaders: add standalone tonemapping shader
This currently uses Uchimura tonemapping, rather than Reinhard as in the
standard PBR shader. We may switch the PBR shader to Uchimura as well
later.
2021-10-29 16:13:05 +03:00
Andrei Alexeyev
29adfb0b71
pbr: allow disabling internal tonemapping via PBREnvironment 2021-10-29 16:12:19 +03:00
Andrei Alexeyev
0c267935ed
pbr: add a few tonemapping functions 2021-10-29 16:12:09 +03:00
Lukas Weber
4e55d445f8
stage5: new PBR background
Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>
2021-09-19 10:42:59 +03:00
Andrei Alexeyev
e471837d4e
pbr: support ambient occlusion maps
AO maps modulate environment light
2021-09-01 00:48:59 +03:00
Andrei Alexeyev
ecbf95ae31
pbr: optimize shader, mainly point lights 2021-09-01 00:48:59 +03:00
Andrei Alexeyev
fce0f97fe1
pbr: parallax occlusion mapping & better env lighting 2021-09-01 00:48:57 +03:00
Lukas Weber
8bb376cbd5
shaders: add envmap_reflect
Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>
2021-09-01 00:47:14 +03:00
Andrei Alexeyev
78266ace3f
pbr: refactor material management and shader
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.
2021-09-01 00:21:50 +03:00
Lukas Weber
b3cd590673
shaders: remove duplicate color conv functions from texture_post_load 2021-09-01 00:08:14 +03:00
Andrei Alexeyev
4d1b4eb72a
lasers: new renderer based on signed distance fields (#317)
* 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
2021-08-22 01:27:12 +03:00
Andrei Alexeyev
a6bb29529b
stage3: delete redundant textures 2021-07-18 10:41:13 +03:00
Andrei Alexeyev
087f1ab0d9
renderer,texture_loader: Add support for cubemap textures
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.
2021-07-11 18:08:00 +03:00
Alice D
7955529bfd
build,ci: Bump emsdk to 2.0.25, rework separate check for tot (#304) 2021-07-02 14:03:28 +03:00
laochailan
2e5000299f
stage4: SSR water effect
Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>
2021-06-19 02:28:24 +03:00
Andrei Alexeyev
5a51842401
shader/cutscene: don't initialize distort_strength uniform
Apparently GLSL ES does not allow this. We set this uniform explicitly
in the code, so this is redundant anyway.
2021-04-18 16:33:09 +03:00
Andrei Alexeyev
6c4473b4a1
build/emscripten: include *.basis.zst in gfx bundle 2021-03-28 14:59:19 +03:00
Andrei Alexeyev
764c6caeb3
build: prevent pack script stdout buffering 2021-03-28 14:58:26 +03:00
Andrei Alexeyev
551d2c4f61
build: exclude a few more file types from compression 2021-03-28 14:57:36 +03:00
Andrei Alexeyev
fe71cf30bf
sprite_pbr: add missing vertex shader output
also remove unused ones
2021-02-27 06:24:20 +02:00
Andrei Alexeyev
5c43f75807
pbr: transform light pos on CPU w/ helper function
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).
2021-02-26 10:31:25 +02:00
Andrei Alexeyev
4580673839
add a PBR sprite shader 2021-02-18 21:39:14 +02:00
Andrei Alexeyev
25b7862a9d
pbr: refactor and modularize shader 2021-02-18 20:57:39 +02:00
Andrei Alexeyev
a5d0deec0f
renderer,gl33: expose new magic uniforms; see render_context.glslh
Also optimize access to all magic uniforms slightly.
2021-02-04 01:50:10 +02:00
laochailan
bc6f41244d
fix spell toe, wriggle and kurumi spell bg 2021-01-31 21:32:49 +01:00
Andrei Alexeyev
1d1dd59b80
pbr: transform light pos to camera space in vert shader; prepare to modularize 2021-01-24 22:00:09 +02:00
laochailan
60cbdd818f stage2: new PBR background 2021-01-21 05:20:15 +02:00
Andrei Alexeyev
a19ac828eb stage1: fix background
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.
2021-01-21 05:20:15 +02:00
laochailan
b89145eac1 stage1_water: make wave_offset a vec2 2021-01-21 05:20:15 +02:00
laochailan
7953bcb0ec stage1_water: get the derivatives right for the waves 2021-01-21 05:20:15 +02:00
Lukas Weber
caa6e46045 stage3: new PBR background 2021-01-21 05:20:15 +02:00
Andrei Alexeyev
df82f27559 pbr: various shader optimizations 2021-01-21 05:20:15 +02:00
laochailan
1d639acd54 pbr: discard fragments with low alpha 2021-01-21 05:20:15 +02:00
laochailan
7590996826 pbr: normalize the bitangent in the vertex shader 2021-01-21 05:20:15 +02:00
Lukas Weber
b4a870e660
stage4: new PBR background, modernize structure 2020-12-26 02:18:19 +02:00
Lukas Weber
46b53db3cd
stage3d: add a basic shader for PBR backgrounds 2020-12-26 02:11:16 +02:00