Commit graph

293 commits

Author SHA1 Message Date
Andrei Alexeyev
a27e0a5339
emscripten: remove legacy --no-heap-copy packer flag 2020-11-10 08:13:24 +02:00
Andrei Alexeyev
8e9363cbca
Dither, downscale, and merge atlas/gray16 into atlas/common 2020-11-05 16:41:54 +02:00
Andrei Alexeyev
3f550e75c5
Sexier bullet flares 2020-11-05 10:18:19 +02:00
Andrei Alexeyev
7e61f5dbb9
resources: Convert most textures into Basis Universal format
Some textures that have been replaced in the pbr_bg branch are untouched
for now.
2020-11-01 01:40:57 +02:00
Andrei Alexeyev
40425c346b
Enemy system extensions (#256)
* Add red fairies; tweaks to blue fairies and circles

* Add more fairies and a simple enemy archetype system

Note that existing stages not utilizing the new enemy spawning system
will have a visual regression - fairies will not have their magic
circles and particle effects visible. These are no longer implemented by
the enemy visual rules and require additional setup from the new spawner
wrappers. All stages should be converted to the new system.

Also improved old fairy sprites

* enemy_classes: rebalance HP

* enemy_classes: add EnemySpawner typedef

* items: add ITEMS() shortcut macro for use with enemy spawners
2020-10-08 05:00:52 +03:00
Samuel P
5238f4080d
Switch port fixes (#251)
* switch: fix es-shaders being packed before transpilation

* switch: build fixes and glsl debug logs

* switch: fix crash on shutdown

shutdown is now done before __libc_fini_array is called, which avoids
freeing the gl context resources twice (in __libc_fini_array, and in SDL_GL_DeleteContext)
2020-09-01 16:31:35 +03:00
Andrei Alexeyev
2ae5e25b00
Workaround a visual glitch in boss_zoom.frag on some systems
Fixes #239
2020-08-31 13:18:00 +03:00
Andrei Alexeyev
db792ebdc0
prune dead spritedef 2020-08-22 10:03:02 +03:00
Andrei Alexeyev
a5fd6fe5d9
Texturing overhaul: GPU compression, sRGB sampling, swizzles, etc. (#240)
* WIP compressed textures, swizzles, sRGB sampling, ...

* refactor texture type info & fix random bugs

* fix preprocessing of sRGB textures

* handle y-flipped basis textures

* glcommon: better WebGL compat for compressed format detection

* missed WEBGL_compressed_texture_pvrtc

* implement compressed texture xcoding and uploading

* Add basis_universal submodule

* Reorganize texture loader code

Clean up some code
Isolate Basis Universal loader into a separate module

* Add wrapper script for encoding .basis textures

* basisu: honor custom metadata written by the mkbasis.py script

* mkbasis.py: add --incredibly-slow and --dry-run

* Move pixmap code from util/ to pixmap/

* Add an on-disk transcode cache for basis textures to speed up loads

* Compress texture cache with zlib

* Use readable format names for basisu cache filenames

* basisu: mip bias test code

* basisu: small caching cleanup

* add TAISEI_BASISU_MIP_BIAS env variable

* Improve OpenGL format matching heuristics

* Document considerations for compressed format priority

* Remove dead code

* Enable two forgotten formats, BC3_RGBA and ATC_RGBA

Also prefer BC7 over BC1/BC3

* Recognize GL_ANGLE_compressed_texture_etc for ETC2 textures

* Default depth buffers to 24-bit; remove ANGLE hack

* Fix glcommon_check_extension for GLES2/legacy gl

* Add renderer feature bit for texture swizzle masks

* glcommon: Fixup internal formats for GLES2

Sized internal formats are not allowed in GLES2

* Fix emscripten compile errors

* Update basis_universal

* remove more dead code

* revert irrelevant stage4 change

* shut up UBSan

* basisu: shut up some debug spam

* Add normalmap sampling helper to util.glslh

* basisu: add a gray-alpha mode

* mkbasis.py: Abort if image dimansions aren't multiples of 4

* Add basic Basis Universal encoding documentation (WIP)

* doc/basisu: Add paragraph about modes; minor tweaks

* basisu: workarounds for GL texture size requirements

* gles20: fix uncompressed sRGB formats

* Partial workaround for missing swizzles in gles2 and webgl

* remove invalid assertion

* New renderer API to expose glDrawBuffers-like functionality

* stagedraw: disable all color outputs for copy_depth pass

required for WebGL compatibility

* support GL_ANGLE_request_extension

* emscripten: include *.basis in gfx package

Also fix a potential problem when more than one .pkgdir is used to
construct emscripten packages

* Don't rely on emscripten runtime to enable webgl extensions
2020-08-15 14:51:12 +03:00
Andrei Alexeyev
324dccb79a
emscripten build fixes 2020-08-11 13:22:36 +03:00
Andrei Alexeyev
3edab92ede
oops typo 2020-08-05 04:34:19 +03:00
Andrei Alexeyev
059f9f4991
Expose transpiling info to shaders via macros
Fixes legacy GLSL compatibility code
2020-08-04 02:46:15 +03:00
Andrei Alexeyev
4e98dcc030
lasers: dedicated fragment shader, simplify vertex shader 2020-08-01 19:02:05 +03:00
Andrei Alexeyev
28c4f345c3
Make laser shaders use a separate interface header 2020-08-01 18:42:33 +03:00
Andrei Alexeyev
40a3f6ead2
Add gameover BGM by RickyRister 2020-06-24 20:51:00 +03:00
Andrei Alexeyev
8480d41b7b
Audio rewrite (#236)
This replaces SDL_mixer with an internal streaming and mixing system,
relying only on basic SDL audio support. It's also a partial refactor of
the audio API, most notably BGM-related. The BGM metadata resource type
is gone, as well as the `.bgm` files. The metadata is now stored inside
the `.opus` files directly, using standard Opus tags.
2020-06-22 17:41:03 +03:00
Andrei Alexeyev
ee3bec1c22
Replace .obj models with .iqm (#232)
http://sauerbraten.org/iqm/

The iqms were converted from the objs with the official iqm "compiler",
but can be also exported directly from Blender with a script from the
SDK.

In addition, indexed rendering was fixed (it's not useless anymore), and
the winding order convention changed from counter-clockwise to clockwise
to facilitate faster model loading.

A limited subset of IQM functionality is currently supported:
	- One mesh per model.
	- Only floating point data in vertex arrays.
	- Only standard vertex arrays: positions, UVs, normals,
	tangents.
	- No animations etc.

The "standard" shader interface now receives an additional vec4 tangent
attribute. This attribute is currently ignored by shaders. The bitangent
vector can be computed in a vertex shader as:
	vec3 bitangent = cross(normal, tangent.xyz) * tangent.w;

* iqm: remove axis scrambling and re-export models

* remove debug stuff
2020-06-06 18:27:08 +03:00
Andrei Alexeyev
1408904b1a
Add option to convert texture into linear color space on load
If "linearize = true" is specified in the .tex file, colors will be
converted from the sRGB color space into the linear RGB color space on
load. Ideally this should be the default, and we should be doing all
color manipulations in linear space, but there's too many things to fix
to make that a reality.

Additionally, "multiply_alpha = false" to prevent colors from being
multiplied by the alpha channel on load.

The texture_post_load shader will no longer be applied when the
preprocessing operation is a no-op.
2020-05-19 05:24:59 +03:00
Andrei Alexeyev
b22aac5207
update portraits 2020-05-10 18:40:19 +03:00
Andrei Alexeyev
d9a84e083d
Some texture loading optimizations 2020-05-09 13:45:29 +03:00
Andrei Alexeyev
3b217fd015
update portraits 2020-05-07 03:46:25 +03:00
Andrei Alexeyev
9deea31f06
Update portraits 2020-05-04 05:21:46 +03:00
Andrei Alexeyev
174a6f582e
remove bogus UV clamping from boss_zoom shader 2020-04-28 04:58:33 +03:00
Andrei Alexeyev
9bcaa36634
Revamp boss distortion effect 2020-04-28 03:53:27 +03:00
Andrei Alexeyev
8e6d2ff71e
implement vecX versions of tanh for legacy glsl 2020-04-28 02:25:24 +03:00
Andrei Alexeyev
21e9b0cbbe
Fix broken logic in GLSL_ATLEAST and ESSL_ATLEAST macros 2020-04-28 02:25:21 +03:00
Alice D
c734967d69
Delete .swp 2020-04-26 20:32:38 -04:00
Andrei Alexeyev
7d7f1b157f
Migrate OpenGL loader to glad2 (#217)
* Migrate to glad2

* basic OpenGL 2.1+ fallback support
2020-04-26 04:10:00 +03:00
Andrei Alexeyev
a9775c065b
Store sprite texture coords in normalized form 2020-04-25 05:36:48 +03:00
Andrei Alexeyev
fb353f24a9
Update portraits and regen atlases 2020-04-25 03:52:26 +03:00
Andrei Alexeyev
d259ffe074
Merge coroutines_temp atlas into common 2020-03-05 21:14:31 +02:00
Andrei Alexeyev
c7572d8e32
better sound effects for common_charge 2020-03-04 22:26:55 +02:00
Alice
297a1c4a15
New (themed) difficulty/shot mode descriptions (#192)
* new difficult mode suggestions (more within the theme of 'knowledge')

* cleaning up new difficulty descriptions, also changing character select titles to match the STORY.txt

* better transparency mask on Easy

* ran optimize-all-img.sh script

* consistency

* (hopefully) got rid of some half-transparent pixels, especially on Normal.webp

* playermode descriptions! (for real this time)

* Reimu shot description changes (as per PR)

* modify ReimuB description
2020-03-04 22:26:53 +02:00
Andrei Alexeyev
b49e518a27
Various laser changes
* More lenient collision detection
* More rounded corners
* Add a task for laser charging (not used yet)
* Make snow halation lasers not use the logic rule
  - Logic rules to be removed in favor of tasks
2020-03-04 22:26:53 +02:00
Andrei Alexeyev
60741cc5b0
Add forgotten tower_alt_uv model for extra stage bg 2020-03-04 22:26:53 +02:00
Andrei Alexeyev
4aa6ba5b3f
Extra stage background prototype 2020-03-04 22:26:50 +02:00
Andrei Alexeyev
3259a844fa
new bullet clear effect 2020-03-04 22:26:45 +02:00
Andrei Alexeyev
3d1c0eee4e
WIP proj draw rule revamp; YoumuB revamp; misc changes; giant mess
cursed commit
2020-03-04 22:26:45 +02:00
Andrei Alexeyev
23636c4ace
pimp up stage1 background 2020-03-04 22:26:44 +02:00
Alice
00cd15af21
fix Stage 1 water effect on Intel UHD (#189) 2020-02-18 05:06:21 +02:00
Andrei Alexeyev
7474ff3a25
OpenGL ES 2.0 support (#187)
* WIP gles2 compat

* More gles2 compat. Playable with ANGLE now, with some rendering bugs.

* fix matrix mult. order in generic laser shader

* gles20: fix indexed rendering

* Update docs about gles20 status

* fix formatting
2020-02-15 19:45:09 +02:00
Andrei Alexeyev
ebd0742a62
fix glslc and spirv-cross CLI tools being required 2019-11-27 17:50:02 +02:00
Andrei Alexeyev
0a559da5fe
build: don't override glsl version, if possible 2019-11-27 17:49:15 +02:00
Andrei Alexeyev
8ccc472e27
build: support building shaderc and spirv-cross CLI from subprojects 2019-11-27 17:18:50 +02:00
Andrei Alexeyev
cfbb35e874
optimize spell intro and outro shaders 2019-09-14 19:59:06 +03:00
Andrei Alexeyev
0890da1f0f
optimize healthbar shaders 2019-09-14 19:36:52 +03:00
Andrei Alexeyev
6fc14c6c2a
Make most bullets smaller; add red channel for glow effects 2019-08-30 21:24:34 +03:00
Andrei Alexeyev
5d535bb93c
fix broken interaction of ReimuB gaps with powersurge effect (visual) 2019-08-23 18:29:40 +03:00
Andrei Alexeyev
a6d0327e49
optimize/simplify powersurge effect 2019-08-23 18:29:05 +03:00
Andrei Alexeyev
673df39f7f
optimize Reimu bomb bg 2019-08-23 16:27:16 +03:00
Andrei Alexeyev
31ea0d409c
replace Yukkuri Reimu with Yukkuri Kyouko 2019-08-22 23:00:13 +03:00
Andrei Alexeyev
80fda75ffb
Dialogue updates with dynamic facial expressions and defeated character portraits (#175)
* WIP portrait faces

* character expressions for dialogue in first 3 stages (wip)

* dialog: simplified face system, new faces, script revisions (wip)

* fix wrong face name in reimu script

* cirno angry face; elly beaten variant

* render_character_portrait(): fix garbage bg and filter-bleeding

* workaround for incorrect face blending on dialog fade

* render_character_portrait(): fix bogus debug labels

* Replace sprite offsets with the more powerful paddings

* new faces for youmu, wriggle, kurumi; dialogue updates

* fix release build

* Update portraits; add Iku faces and Elly shouting face

* Add Reimu sigh face and Marisa sweat_smile face

* Add Kurumi dissatisfied face

* update Hina
2019-08-22 22:43:34 +03:00
Andrei Alexeyev
78bfbec122
increase coolness of spellcard_walloftext.frag.glsl 2019-08-15 16:08:51 +03:00
Andrei Alexeyev
7aec3fd56d
optimize spellcard_walloftext.frag.glsl a bit 2019-08-15 16:07:53 +03:00
Samuel P
469d6e2f48 Switch homebrew port (#173)
* Initial port

* Switch specific video modes

* Handle clean exit

* Hide option to disable gamepads, force it enabled

* Match buttons layout with Switch controllers

* Hide player name setting (to avoid getting stuck)

* Switch specific VFS setup instead of env bootstrap

* Clean up, get rid of warnings and a few ifdefs

* Add Switch specific build script and assets

* Make vfs setup mount packages

* Re-enable packaging on Switch

* Transpile shaders to es and install them

* Add applet warning and shader deps to README

* Remove script; instead using meson build scripts

* Strict prototypes

* Build script compat with project minimum meson ver

Refactor of pack.py exclude option

* Uniformise header inclusion on arch_switch.c

* Allow input for any dev; hide the option on Switch

* Silence unsused function warnings
2019-08-02 21:38:33 +03:00
Andrei Alexeyev
cf1ab225cb
basic support for portrait faces; make charselect menu more fun 2019-07-08 03:51:15 +03:00
Andrei Alexeyev
c2cd91463c
New character art by Afensorm + other visual tweaks (#170)
* implement player spellcard declarations on bomb

* stagedraw: move "bottom text" to a separate (higher) layer

* update boss spell declaration effect

* import afensorm's character portrait art

* improve dialog visuals

* acknowledge afensorm in credits and COPYING

* 'alphamap' functionality; effects for wriggle and youmu portraits

* update afens art

* add cirno alphamap

* dialog: draw active speaker above other other

* charselect: use r_draw_sprite
2019-07-03 20:50:43 +03:00
laochailan
5f6ada9e7e Item indicators (#172)
* indicators indicate indication

* optimize

* preload the right resource

* integrate point indicators into atlas
2019-06-25 07:27:57 +03:00
Andrei Alexeyev
0a797096ce
emscripten: don't package gamecontrollerdb, it's useless 2019-05-19 20:25:05 +03:00
Andrei Alexeyev
bfb3941cf3
renderer: *slightly* more consistent coordinate system; it's still a god-damn mess though 2019-05-12 10:38:31 +03:00
Andrei Alexeyev
b0856ce07d
Switch audio assets to Opus (#167)
* Switch BGMs to Opus

* Switch SFX to Opus; use floating-point mixing

* opus sfx: support resampling via SDL_AudioStream

* bump SDL2 version requirement to 2.0.6

2.0.5 doesn't have the SDL_AudioStream API, and is ancient anyway.
2019-05-11 09:46:26 +03:00
Andrei Alexeyev
4e4922ad02
fix typo in stage 3 theme title 2019-05-06 13:10:15 +03:00
Andrei Alexeyev
8047ca18ce
improve lossless webp compression 2019-05-06 11:19:03 +03:00
Andrei Alexeyev
b4081c6550
manually optimize some heavy textures w/ lossy compression 2019-05-06 10:04:12 +03:00
laochailan
c4252c434a
kick out abstract_blue (and raise the warmly waiting text) 2019-04-25 18:22:30 +02:00
Andrei Alexeyev
337cc978e7
optimize images 2019-04-25 03:50:58 +03:00
Andrei Alexeyev
e6cd0ccba1
import Reimu's hair tubes; regenerate atlases 2019-04-23 23:51:15 +03:00
Andrei Alexeyev
e02098f0d5
run upkeep 2019-04-22 19:26:07 +03:00
Andrei Alexeyev
e30a2f636b
attempt to give Reimu a more appropriate texture; savereplay menu tweak 2019-04-22 15:29:44 +03:00
Andrei Alexeyev
4e08af4824
fix black hole shader resolution dependency 2019-04-22 10:28:40 +03:00
Andrei Alexeyev
72d638e168
some WIP bikeshedding and fixes 2019-04-22 03:07:14 +03:00
laochailan
23a3c2f206 next iteration, better charselect 2019-04-21 10:37:50 +02:00
laochailan
8c4811f8bd cool new black hole menus 2019-04-20 18:06:27 +02:00
Andrei Alexeyev
c7a4bb9094
make binary dist. targets depends on stuff they'll be packaging 2019-04-19 23:40:39 +03:00
laochailan
5b389336f7
add power surge sfx 2019-04-16 21:06:10 +02:00
Andrei Alexeyev
2d6b41d759
optimize sprite rendering by discarding invisible fragments 2019-04-16 08:08:00 +03:00
Andrei Alexeyev
40a04cb217
use the same vertex shader for both healthbar styles
they previously used two separate, identical shaders
2019-04-14 18:15:08 +03:00
laochailan
29aabc9c4f
fix animations 2019-04-14 16:55:27 +02:00
Andrei Alexeyev
ac6998fc8f
add new maristar sprite to the atlas 2019-04-14 17:45:40 +03:00
Andrei Alexeyev
fd37ccd84d
powersurge_effect: fix alpha culling
we use premultiplied alpha, so all channels have to be tested
2019-04-14 17:22:02 +03:00
laochailan
59fcc086f6
new idea for marisa b design 2019-04-14 16:52:53 +03:00
Andrei Alexeyev
bc7991b627
revamp scuttle's glitch shader 2019-04-14 16:27:26 +03:00
Andrei Alexeyev
f554768cfc
fix rendering of lasers and a few effects during view shake
this is a regression introduced in eea6aa09
2019-04-14 16:15:40 +03:00
Andrei Alexeyev
43ed2dcde2
update glsl source list 2019-04-12 05:16:12 +03:00
Andrei Alexeyev
ce1eecaf49
add distortion effect for powersurge discharge 2019-04-08 19:57:41 +03:00
Andrei Alexeyev
c5011b0caf
spellcard_intro: use builtin smoothstep instead of custom sigmoid 2019-04-03 16:31:50 +03:00
Andrei Alexeyev
cc6514151a
Implement seeking in zip files without reading everything to memory
In particular, this greatly reduces memory usage for music tracks.
2019-03-16 22:11:37 +02:00
Andrei Alexeyev
a63e8f4a69
Add a basic music room 2019-03-11 01:21:43 +02:00
Andrei Alexeyev
180f9e3856
Emscripten compatibility (#161)
* Major refactoring of the main loop(s) and control flow (WIP)

run_at_fps() is gone 🦀

Instead of nested blocking event loops, there is now an eventloop API
that manages an explicit stack of scenes. This makes Taisei a lot more
portable to async environments where spinning a loop forever without
yielding control simply is not an option, and that is the entire point
of this change.

A prime example of such an environment is the Web (via emscripten).
Taisei was able to run there through a terrible hack: inserting
emscripten_sleep calls into the loop, which would yield to the browser.
This has several major drawbacks: first of all, every function that
could possibly call emscripten_sleep must be compiled into a special
kind of bytecode, which then has to be interpreted at runtime, *much*
slower than JITed WebAssembly. And that includes *everything* down the
call stack, too! For more information, see
https://emscripten.org/docs/porting/emterpreter.html

Even though that method worked well enough for experimenting, despite
suboptimal performance, there is another obvious drawback:
emscripten_sleep is implemented via setTimeout(), which can be very
imprecise and is generally not reliable for fluid animation. Browsers
actually have an API specifically for that use case:
window.requestAnimationFrame(), but Taisei's original blocking control
flow style is simply not compatible with it. Emscripten exposes this API
with its emscripten_set_main_loop(), which the eventloop backend now
uses on that platform.

Unfortunately, C is still C, with no fancy closures or coroutines.
With blocking calls into menu/scene loops gone, the control flow is
reimplemented via so-called (pun intended) "call chains". That is
basically an euphemism for callback hell. With manual memory management
and zero type-safety. Not that the menu system wasn't shitty enough
already. I'll just keep telling myself that this is all temporary and
will be replaced with scripts in v1.4.

* improve build system for emscripten + various fixes

* squish menu bugs

* improve emscripten event loop; disable EMULATE_FUNCTION_POINTER_CASTS

Note that stock freetype does not work without
EMULATE_FUNCTION_POINTER_CASTS; use a patched version from the
"emscripten" branch here:

    https://github.com/taisei-project/freetype2/tree/emscripten

* Enable -Wcast-function-type

Calling functions through incompatible pointers is nasal demons and
doesn't work in WASM.

* webgl: workaround a crash on some browsers

* emscripten improvements:

    * Persist state (config, progress, replays, ...) in local IndexDB
    * Simpler HTML shell (temporary)
    * Enable more optimizations

* fix build if validate_glsl=false

* emscripten: improve asset packaging, with local cache

Note that even though there are rules to build audio bundles, audio
does *not* work yet. It looks like SDL2_mixer can not work without
threads, which is a problem. Yet another reason to write an OpenAL
backend - emscripten supports that natively.

* emscripten: customize the html shell

* emscripten: force "show log" checkbox unchecked initially

* emscripten: remove quit shortcut from main menu (since there's no quit)

* emscripten: log area fixes

* emscripten/webgl: workaround for fullscreen viewport issue

* emscripten: implement frameskip

* emscripter: improve framerate limiter

* align List to at least 8 bytes (shut up warnings)

* fix non-emscripten builds

* improve fullscreen handling, mainly for emscripten

* Workaround to make audio work in chromium

emscripten-core/emscripten#6511

* emscripten: better vsync handling; enable vsync & disable fxaa by default
2019-03-09 21:32:32 +02:00
Andrei Alexeyev
8fc5abb78a
The Powersurge game mechanic and scoring system (#159) 2019-02-22 01:56:03 +02:00
Andrei Alexeyev
fcf08dcac7
workaround ANGLE's brokenness 2019-02-17 23:35:11 +02:00
Andrei Alexeyev
e2fe1af8fd
add file that has been forgotten for several months... facepalm 2019-02-17 01:18:43 +02:00
laochailan
9f3b975411
same optimization for boss_death 2019-02-16 14:41:08 +01:00
laochailan
e71dc90321
player_death shader vectorization 2019-02-16 08:33:26 +01:00
Andrei Alexeyev
b72eee8b08
fix build 2019-01-26 16:18:19 +02:00
Andrei Alexeyev
1feb94e4f7
Revamp (and fix) data packaging and installation 2019-01-26 15:57:38 +02:00
Andrei Alexeyev
fa802dbd94
Some refactoring
* Added (and fixed) a few useful warnings
    * Removed some dead code
    * Cleaned up the build system files a bit
    * Once again separated ZIP support from data packaging
    * Converted macOS cross-compilation options into cross-file properties
2019-01-24 22:24:43 +02:00
Andrei Alexeyev
4159ea1249
'upkeep' target for maintenance tasks; back to include guards; happy new year! 2019-01-23 22:10:43 +02:00
Andrei Alexeyev
f8a2d3c112
very important optimization 2019-01-23 16:02:51 +02:00
laochailan
64878d5c67
new youmu a bomb
pool myon billards

tweak youmuA bomb (new movement + larger radius)

fix preload
2019-01-08 04:54:43 +02:00