Commit Graph
32 Commits
Author SHA1 Message Date
Nunuhara Cabbage 44891458f1 Implement DrawGraph.SaturDP_DPxSA 2022-05-03 20:01:48 -07:00
Nunuhara Cabbage 54f6ece82d Implement DrawGraph.FillAMapGradationUD 2022-05-03 18:49:40 -07:00
Nunuhara Cabbage 65be47e05b Implement DrawGraph.BlendUseAMapColor 2022-05-02 20:35:02 -07:00
Nunuhara Cabbage 9108ce19ea Implement DrawGraph.BlendAMapAlphaSrcBright 2022-05-02 18:19:09 -07:00
Nunuhara Cabbage 2f573803c4 Implement DrawGraph.BlendAMapBright 2022-05-02 17:01:23 -07:00
Nunuhara Cabbage d085951f68 Implement EFFECT_BLUR_FADEOUT
Used in Sengoku Rance (when Ran summons Suzaku).
2022-05-02 11:25:42 -07:00
Nunuhara Cabbage f7b6da9679 Implement DrawGraph.BlendAMapColorAlpha
Used in the Rance VI credits.
2022-04-28 20:43:55 -07:00
Nunuhara Cabbage 9089fa1fd1 Rewrite fnl font renderer
Only unscaled glyph bitmaps are now cached in regular memory. Scaled
glyphs are stored as textures on the GPU. Only the alpha channel on
glyph textures is used, with the color being provided as an input to the
shader.

Outline and bold rendering is improved by using a simple dilate shader.
This looks okay but could be improved (the result is a bit blurry
still).
2022-04-28 19:13:27 -07:00
Nunuhara Cabbage 55aed4c755 Implement EFFECT_TURN_PAGE
Used in Rance VI.
2022-04-16 21:51:12 -07:00
Nunuhara Cabbage c1e9099a6c Implement EFFECT_LINEAR_BLUR
Used in Rance VI.
This implementation is not perfect, but it gets pretty close.

Alicesoft's implementation has a sharper curve on the blur size around
t=0.5, giving a "snappy" effect at the middle of the transition.
2022-04-16 10:47:59 -07:00
Nunuhara Cabbage 6118eef06a Implement EFFECT_UP_DOWN_CROSSFADE 2022-04-04 06:52:51 -07:00
Nunuhara Cabbage 888b491b38 Implement EFFECT_CROSSFADE_LR 2022-04-03 22:35:37 -07:00
kichikuou e0466dfb7c Fix GLSL ES compile errors
Implicit conversion between int and float is not supported in GLSL ES.
2022-01-08 15:10:38 +09:00
Nunuhara Cabbage ecb0c1607d Implement EFFECT_BLIND_DOWN
Used in GALZOO Island.
2021-12-13 18:10:54 -08:00
Nunuhara Cabbage 382b339941 Implement ZIGZAG_CROSSFADE effect
Used in Shaman's Sanctuary.

This implementation doesn't give the same result as SACT2.dll. SACT2.dll
zigzag's the image along both axes, whereas this implementation only
does the zigzag along one axis.
2021-07-11 11:58:56 -07:00
Nunuhara Cabbage 35a84ba708 Implement BLUR_CROSSFADE effect
Used in Shaman's Sanctuary.

This implementation gives a bit of a different result compared to
SACT2.dll, but it's reasonably close.
2021-07-08 20:07:43 -07:00
Nunuhara Cabbage 75539d4cdc Implement BLIND_LR effect
Very frequently used across many games.
2021-07-07 20:14:25 -07:00
Nunuhara Cabbage 08edf8638b Merge branch 'master' of https://github.com/nunuhara/xsystem4 2021-06-20 11:00:41 -07:00
Nunuhara Cabbage b4b85c1f75 Implement crossfade mosaic effect
This one is used quite frequently in Sengoku Rance.

The implementation here is slightly wrong, in that the anchor point for
the pixel zoom is at the lop left of the screen instead of the center.
2021-06-20 10:46:53 -07:00
kichikuou da5ac4a26c Support OpenGL ES 3.0
This adds `USE_GLES` compile-time flag. If it's defined, gfx_init()
requests an OpenGL ES >=3.0 context.

This also makes the following changes to make it work with OpenGL ES:

- The USE_GLES flag also switches shader's #version directive, which is
  now provided separately from the .glsl file.
- Implicit conversion between int and float is not supported in GLSL ES.
- Use GL_RGB in gfx_copy_main_surface. Because main_surface is in GL_RGB
  format, using GL_RGBA generates GL_INVALID_OPERATION in OpenGL ES.
2021-06-20 17:12:35 +09:00
Nunuhara Cabbage 12b755ba87 Use shaders for effects
Shaders will be required to implement more complex effects (e.g. mosaic
crossfade).
2021-06-19 19:38:27 -07:00
kichikuou 4d139a0ddd Implement DrawGraph.SpriteCopyAMap
Used in GALZOO Island.
2021-06-13 11:43:27 +09:00
kichikuou 1522c85e46 DrawDungeon: Tweak fog parameters 2021-06-06 14:22:33 +09:00
kichikuou c54f2493d1 DrawDungeon: Use billboarding for floating event markers
Before this, floating markers were rendered as OpenGL's point sprites.
But point sprites has an implementation-dependent maximum size, and
Intel driver's maximum (256 pixels) is too small for us.

After this, markers are drawn with the same shaders as normal objects,
using the billboarding technique.
2021-05-30 21:31:08 +09:00
kichikuou 98798a6ab9 DrawDungeon: A major rewrite of dungeon renderer
Before this, all objects that share a texture were drawn at once.
Objects were not depth-sorted, so if a transparent object was drawn
first, objects behind it were not drawn.

After this, dungeon is drawn for each cell, sorted by distance from
the camera position. To reduce the number of cells to be drawn, PVS
(Potentially Visible Set) stored in dgn files is used.
2021-05-30 21:28:22 +09:00
Nunuhara Cabbage 50a719ba76 Implement DrawGraph.FillAMap{Over,Under}Border
Used in Alice 2010.
2021-05-14 18:35:29 -07:00
kichikuou adb558c67c Initial implementation of DrawDungeon.hll (Rance VI)
In addition to DrawDungeon.c, this adds the following files in
{src,include}/dungeon/:

- dgn.{h,c}: Parser for .dgn (map data)
- dtx.{h,c}: Parser for .dtx (textures)
- tes.{h,c}: Parser for .tes (sound IDs associated with textures)
- dungeon.{h,c}: Renderer main routines
- mesh.{h,c}: Renderer for walls and stairs
- skybox.{h,c}: Renderer for background cubemap
- event_markers.{h,c}: Renderer for event markers

And the following changes are made to the existing graphics code:

- sact_Update() calls dungeon_update(), so that event markers animate
- gfx_render_texture() renders vertically flipped image when
  texture.flip_y == true (see the comment in dungeon_context_create())

Some features are not implemented yet, including 2D maps and door
animation.

This makes cglm a dependency.
2021-05-08 22:42:57 +09:00
kichikuou e5cb875f9b Implement DrawGraph.BlendAMapColor and DrawGraph.BlendDA_DAxSA
And fixes DrawGraph.SubDA_DAxSA.
2021-05-08 20:52:48 +09:00
Nunuhara Cabbage f282c69266 Implement DrawGraph.CopyColorReverse
Just a copy operation that inverts colors. Used in Rance VI Sonogo.
2021-04-22 19:20:12 -07:00
kichikuou 7fcacb3c16 Fix OpenGL issues on MacOS
MacOS does not support OpenGL compatibility profile, so the following
changes had to be made:

- Replaced deprecated texture2D() with texture() in shaders
- Renamed `texture` uniform variable to `tex`, to avoid name conflict
- Use VAO, which is mandatory in OpenGL 3 core profile
2020-09-03 23:16:08 +09:00
Nunuhara Cabbage b12cce78e1 Implement DrawGraph.CopyRotZoom* functions 2019-12-18 17:08:14 -08:00
Nunuhara Cabbage e90821cc20 Use OpenGL instead of SDL's 2D graphics API
This will be necessary for supporting 3D games in the future (Rance VI,
GALZOO, etc.).
2019-12-16 19:59:17 -08:00