Commit graph

75 commits

Author SHA1 Message Date
Andrei Alexeyev
9b3779ebb4
Some renderer refactoring (mostly API and GLES preparations) (#144)
* Refacor uniforms API:

    - More complete and consistent
    - Type-safety
    - Usage correctess assertions missing for now, planned

* Redesign texturing API: texunits gone, assign textures to sampler uniforms directly

r_texture_create now allocates memory and returns an opaque Texture
pointer; similar changes to the other renderer APIs will follow.

* Framebuffers: make _create return an opaque pointer, add debug label APIs (unused for now)

* opaque pointers and debug label APIs for vertex arrays and buffers

* fix null renderer

* Refactor glsl preprocessing into an independent module

* Separate shader resource management from renderer backend

This makes it possible to add more shading languages and/or include a
transpiler, which will be useful for the GLES backend.

* refactor r_clear into a stateless API

* add r_texture_clear API; fix gl33_framebuffer_clear

* Replace deprecated glsl_objects with objects in all *.prog files

* fix missing texture_clear implementation in null renderer

* remove some dead code in null renderer

* fix GLES segfault

* GLES 3.0 actually has glVertexAttribDivisor

* Query GL for supported GLSL versions (preparing to add shader transcompilation)
2018-09-14 10:37:20 +03:00
Andrei Alexeyev
721bed1a8c
draw boss overlay on top of everything else 2018-08-31 05:46:37 +03:00
Andrei Alexeyev
e4f49310ff
Fix textures being internally Y-flipped (#142)
* WIP: upload textures with the bottom-left-origin convention, as OpenGL expects

* unflip: fix spellcard_walloftext, text_hud

* unflip: fix reimu's and marisa's bombs

* unflip: fix stagetext

* unflip: fix graph.frag.glsl

* fix sprite_circleclipped_indicator
2018-08-28 11:25:54 +03:00
Andrei Alexeyev
56f066ca3e
Add optional FXAA for the 3D views; fix nasty rendering bug 2018-08-17 01:32:58 +03:00
Andrei Alexeyev
3615b95f13
Add Reimu Hakurei as a playable character (#106)
* Reimu (#101)

* add the reimu

* Add Reimu story

* account for various blunders

* add reimu dialog picture

* Reimu: WIP yin-yang orbs

* reimu: fix up indents

* Reimu: swap the shotmode names to match the kanji order in her Japanese name

* Reimu: compatibility with the latest system

* WIP ReimuA crap

* ReimuA homing trails

* more ReimuA stuff

* more ReimuA adjustments + enhanced DPS stats

* Reimu: stubs for new player animation sequences

* Reimu: occupy the 0th character slot

* Reimu: tweak needle sprite

* Reimu: buff movement speed to better match Touhou

* Reimu: fixup for the recent projectile changes

* ReimuA: make homing shots a bit smaller; give them custom effect on collision

* Reimu: add intermediate frames; move some loose sprites to the atlas

* Reimu: fix compile errors

* replace DBL_MAX by INFINITY

* Don’t draw reimu orbs twice

fixes #127

* add new reimu dialog pic

* ReimuA adjustments (mostly homing); it's still OP

* wip ReimuB gaps

* still not sure where i'm going with these gaps

* meh

* Reimu: premultiplied alpha fixups after rebase

* reimuB shot pattern with basic power scaling (not balanced at all)

* reimuB: some lame-ass particle effects

* ReimuB bomb effect prototype

* reimuA bomb prototype

* fix reimu shots for the new damage system

* Reimu: use the new player_is_bomb_active() function, add placeholder BG for ReimuB

* some reimuB bomb projectiles

* ReimuB bomb bg and some framebuffer utils required to support it.

Might reuse this at least in part for ReimuA unless we come up with
something better.

* hack to fix ReimuB bomb fade; refactoring needed

* reimuA damaging bombs

* fix ub

* prevent nan when reimuA bombs without enemies present

* add a bomb_bg to reimuA

* ...

* various fantasy seal tweaks

* Reimu: placeholder bomb sounds; slight fantasy seal buff

* fix null pointer dereference

* Reimu "balance" adjustments; minor fixes

* putting bandaids over gunshot wounds

* Add aoe damage and bullet cancel to ReimuB's bomb

* more exorcism porn

* make reimu bomb bg runes better visible on dark backgrounds

* More ReimuA shot changes
2018-08-11 22:13:48 +03:00
Andrei Alexeyev
12a9acbc71
Add more functions to query player state properly (is alive, is vulnerable, is bombing)
There are some minor changes to the logic to keep things consistent.
2018-07-31 10:07:34 +03:00
Andrei Alexeyev
e9ef77abee
basic entity damage generalization 2018-07-30 10:04:39 +03:00
Andrei Alexeyev
8490576810
Premultiplied alpha (#133)
* WIP premultiplied alpha

* WIP color API rework (doesn't build yet; lots of things left to convert)

* convert everything remaining to new Color api except stage*_event.c files

* convert the stages to new Color api. builds & runs now; still many rendering errors

* fix the bullet shader for premultiplied alpha

* fix masterspark, graphs and stage 1 fog clouds

* fix marisa_b and most of spellcards

* Add deprecation warnings for BLEND_ADD and PFLAG_DRAWADD

* fix a segfault in stage 6

undo accidental earlier change

* fix text_hud.frag.glsl

* fix scuttle bg and remaining stage3 BLEND_ADDs

* fix marisa laser opacity

* hacky fix for myon

The old implementation relied on alpha being stored inside p->color. In
premul alpha this doesn’t work and functions like color_set_opacity
can’t solve this i think.

So I tried messing around with it until it looked somewhat similar.

* fix marisa_b stars

* remove color_set_opacity i overlooked

* more plrmode blending changes

* fixup additive blending in stage 1

* various premultiplied alpha fixups for bosses and enemies

* stage 2 premul alpha fixups

* stage 4 premul alpha fixups

* stage 5 premul alpha fixups

* stage 6 premul alpha fixups

* make lasers also use the PMA blend mode

* remove PFLAG_DRAWADD and PFLAG_DRAWSUB

* fix remaining PMA issues in menus

* lame extraspell bg workaround

* fix item alpha

* make marisaA lasers look somewhat like in master

* fix marisaA bomb background fadeout

* fixup various r_color4 calls

* fix myon

* remove dead code

* fix use of BLEND_ADD in player death effect

* fix myon shot trails (broken on master as well)

* fix myon shot fade-in

* extend the sprite shaders custom parameter to a vec4

* fix youmuB stuff and make it look somewhat better.

the code looks even worse though.
2018-07-23 20:07:59 +03:00
Andrei Alexeyev
c57d1130aa
support mipmaps and anisotropy (not used until we have premultiplied alpha) 2018-07-11 14:55:08 +03:00
Andrei Alexeyev
b16f402040
Refactor framebuffer-related stuff (#130)
* Renderer: rename render targets to framebuffers

* Refactor framebuffer pair helper and some of the video API

* Remove hardcoded dimensions from draw_framebuffer_tex

* Make viewport a per-framebuffer property rather than a global one

* Handle config updates via the events system. React to viewport fg/bg quality change requests.
2018-07-04 11:36:16 +03:00
Andrei Alexeyev
322edd0dce
Text rendering rewrite and optimizations; some refactoring (#129)
* wip font rendering stuff; hashtable monstrosity is temporary

* various text rendering fixes/improvements

* HashTables™ 3.0

* Add some comments to aid navigating the hashtable macro maze

* overhaul text rendering API; add default and example shaders

* text: implement text_render for spellcard effect; misc fixes

* README: update dependencies

Bye SDL_ttf, hello freetype2.

* text_draw: fix resolution/scale-dependent bugs

* make text_draw fallback to the current shader, fix hud and stagetext

* repair the bgm loading

* fix spell practice mode

* fix walloftext

forgot one site of text_draw earlier

* fix wrapped text rendering

* fix and simplify the hud text shader

* dynamic glyph cache

* implement font size change on window resize/quality setting change/etc.

* rename text shaders for consistency

* preloads for fonts and text shaders

* make the stagetext shader look somewhat better

* text_render: attempt to normalize height

* small improvement for stagetext
2018-06-30 00:36:51 +03:00
Andrei Alexeyev
83a8961df6
use "anchored" lists for most game objects
these have a pointer to the last element, thus appending is fast
2018-06-01 21:40:18 +03:00
Andrei Alexeyev
f3616f3496
enhanced DPS stats (backport from reimu branch) 2018-05-20 04:42:17 +03:00
Andrei Alexeyev
379f9ebfe3
player death overlay effect (wip) 2018-05-18 21:15:11 +03:00
Andrei Alexeyev
ef37b22d6d
Improve (totally rewrite) projectile collision detection and graze mechanics (#122)
* improve (totally rewrite) projectile collision detection and graze mechanics

* fix lineseg_circle_intersect as per lao's suggestion

* adjust hit"boxes"

* fix false hits on inductive resonanse (bad lerp)

* initialize projectile prevpos on spawn

* pp_basic_init_projectile: always override the projectile's sprite when setting the prototype
2018-05-13 16:08:58 +03:00
Andrei Alexeyev
004ef04384
debug: add key to toggle display of real collision boundaries 2018-05-08 16:03:12 +03:00
Andrei Alexeyev
fd06ad3026
fix some of the set_ortho/draw_fbo madness 2018-04-26 02:50:48 +03:00
Andrei Alexeyev
af7c4bbb4f
add portable wrappers around getenv/setenv and friends 2018-04-18 01:34:41 +03:00
Andrei Alexeyev
8ef5ffd32c
Flexible draw order; entity "base class" for all game objects 2018-04-15 09:43:11 +03:00
Andrei Alexeyev
59cf8f6300
Rendering system rewrite, tons of refactoring, optimizations, and other cool stuff (#116) 2018-04-12 17:08:48 +03:00
Andrei Alexeyev
a9561d7baf
Sprites and texture atlases; upgrade most graphics to a higher resolution (optimized for 1600x1200) (#113) 2018-02-06 08:19:25 +02:00
Andrei Alexeyev
6da17d8b1d
get rid of Texture.truew/trueh; simplify some transformations 2018-01-29 10:35:35 +02:00
Andrei Alexeyev
30b0c4e3ee
moved draw_stars to util, optimized/rewrote it in the process 2018-01-20 16:53:31 +02:00
Andrei Alexeyev
f4cd177b1a
add option to disable most particle effects. use PFLAG_REQUIREDPARTICLE to ignore it 2018-01-11 22:40:46 +02:00
Andrei Alexeyev
75b0607615
fix segfault when bombbg proc is missing 2018-01-05 23:57:11 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
f8cf13bdf3
more efficient FBO handling 2018-01-03 16:38:42 +02:00
Andrei Alexeyev
e87c512597
more efficient text rendering (no PBOs) 2017-12-28 07:31:39 +02:00
Andrei Alexeyev
c01df4894f
remove redundant frameskip handling from stage code 2017-12-26 13:14:46 +02:00
Andrei Alexeyev
48b13cd83a
frameskip option for slow GPUs 2017-12-26 13:07:40 +02:00
Andrei Alexeyev
de31a20497
objectpool: dynamic extents and other improvements 2017-12-24 05:00:19 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
Andrei Alexeyev
3d5c4707c3
fix some preloading issues 2017-12-14 17:07:24 +02:00
Andrei Alexeyev
276759d0fd
aggressive caching of rendered text 2017-12-14 05:48:30 +02:00
Andrei Alexeyev
abbc62b49c
object pools 2017-12-13 21:08:23 +02:00
Andrei Alexeyev
ca98b39216
framerate graphs; option to turn off compensation 2017-12-11 20:56:46 +02:00
laochailan
9f8ce47107
aligned the HUD text to pixels as much as possible 2017-12-10 16:19:21 +01:00
laochailan
2a0f9e6486
forgot that apply_shader_rules swaps the fbos already 2017-12-10 08:53:47 +01:00
laochailan
28b4ec4449
wip youmu a bomb 2017-12-10 08:53:47 +01:00
laochailan
16f443e54c
redo masterspark 2017-12-10 08:44:37 +01:00
Andrei Alexeyev
2417763155
fix boss indicator 2017-11-23 06:02:54 +02:00
Andrei Alexeyev
ec0a2f277d
HUD improvements 2017-11-23 04:25:53 +02:00
Andrei Alexeyev
4b53d65c23
enable GL_TEXTURE_2D by default to reduce API calls 2017-11-22 02:05:42 +02:00
Andrei Alexeyev
586af9a6b0
huge projectile API changes and optimizations (#93) 2017-11-10 22:49:16 +02:00
laochailan
0e7c849d9b
deactivate spell intro shader quicklier 2017-11-05 13:24:51 +01:00
Andrei Alexeyev
12a9d87f56
points are unsigned 2017-11-02 14:37:45 +02:00
Andrei Alexeyev
c5717cca5e
wave-particle duality changes
whatever, ship it
2017-10-20 21:53:21 +03:00
Andrei Alexeyev
7f72c1c09a
smooth(er) bomb cancellations
speed up the bomb animation when the boss spell is approaching, but only
if it can't be finished properly in time
2017-10-17 23:27:35 +03:00
Andrei Alexeyev
f3ebc903a7
improved boss death effect (with sfx)
also moved some boss drawing code from stagedraw.c to boss.c
2017-10-17 00:50:02 +03:00
Andrei Alexeyev
ffe954f006
WIP stage 3 revamp 2017-10-16 00:07:09 +03:00