Commit Graph
1194 Commits
Author SHA1 Message Date
kichikuou 579c158477 Implement DrawRipple HLL
Used in Majo no Shokuzai.
2024-11-02 07:55:30 +09:00
kichikuou 842bac92f3 Implement DrawRain HLL
Used in Tsuma Shibori.
2024-11-01 10:59:06 +09:00
kichikuou dc8a9379d0 Implement DrawSnow HLL
Used in Tsuma Shibori, and some indie System 4 games.

This HLL is a draw plugin that uses SACT2's "custom sprite" mechanism.
Custom sprites do not have a texture. Instead, the plugin's render()
callback draws them directly to the main surface.
2024-11-01 08:53:58 +09:00
Nunuhara Cabbage f8f02a1c99 Merge pull request #207 from kichikuou/framebuffer
Fix "incomplete framebuffer" error in gfx_init_texture_rgb(a)
2024-10-27 20:38:55 -07:00
kichikuou d7d9bb70f2 Fix "incomplete framebuffer" error in gfx_init_texture_rgb(a)
This fixes "incomplete framebuffer" error in Haru Urare right after the
game start, due to gfx_set_framebuffer() being called with a zero width
texture. It was a regression introduced by commit 04d5237, which started
using gfx_set_framebuffer() in gfx_init_texture_rgba().

Ideally, we should avoid creating zero-area textures in upper layers
(commit 3f18b18 was an attempt to do so), but this is difficult because
there are many places that create textures. Let's just make sure that we
don't generate unrecoverable errors.
2024-10-28 11:28:08 +09:00
Nunuhara Cabbage dcdb82e2a8 Merge pull request #205 from kichikuou/alpha
TapirEngine: Fix alpha test / alpha blend conditions
2024-10-25 19:00:27 -07:00
kichikuou f1a2904262 TapirEngine: Fix alpha test / alpha blend conditions
In ReignEngine, alpha blending is the default. Alpha testing is used if
the mesh/material has the (sprite) attribute.

In TapirEngine, alpha testing is the default. Alpha blending is used if
the mesh/material has the (alpha) attribute.
2024-10-22 10:17:07 +09:00
kichikuou ecd71896b3 3d: Store 3D engine version in a global variable
So that we don't have to pass it around everywhere.
2024-10-22 10:16:51 +09:00
Nunuhara Cabbage d7b7879747 Merge pull request #204 from kichikuou/3d
3d: Various improvements for Rance Quest
2024-10-20 09:08:45 -07:00
kichikuou 1cbf6125ce 3d: Implement vertex alpha
POL v2 models can have an alpha mod per vertex.
2024-10-20 08:25:42 +09:00
kichikuou 9b03741288 3d: Pack bone transform matrices
Before this, the BoneTransforms uniform block consumed
(4 * 4 * sizeof(float) * MAX_BONES) = 19712 bytes, which exceeds 16384,
the minimum possible value of GL_MAX_UNIFORM_BLOCK_SIZE in OpenGL ES
3.2.

Since the bone matrices are affine, we can drop the 4th rows and pack
them into a mat4x3 array. Now the BoneTransforms block is 14784 bytes
and it should work with all OpenGL ES 3.2 implementations.
2024-10-20 08:25:39 +09:00
kichikuou 4e04db0045 3d: Implement MESH_BOTH attribute
It disables back-face culling.
2024-10-20 08:16:27 +09:00
kichikuou abd3a276a3 TapirEngine: Implement UVScroll mesh attribute 2024-10-20 08:16:24 +09:00
Nunuhara Cabbage 9ca3d3e9c6 Merge pull request #203 from kichikuou/lighting
TapirEngine: Simplify lighting
2024-10-18 20:15:02 -07:00
kichikuou d8ad22b638 TapirEngine: Simplify lighting
In TapirEngine, the following lighting features are not used:

- global ambient
- directional lights
- specular lights
- rim lights
- fog

(The setters / getters for these parameters are still there, but they
don't affect rendering.)

This implementation disables those features in GLSL using #ifdefs. The C
code that sets up the lighting remains almost unchanged --
glGetUniformLocation() will return -1 if the specified uniform variable
name is not found, and glUniform*(-1, ...) will be no-op.
2024-10-19 08:43:31 +09:00
Nunuhara Cabbage 3f02a22a8d Merge pull request #202 from kichikuou/fps
gfx: Add frame rate counter
2024-10-17 06:30:07 -07:00
kichikuou bff491bbe9 gfx: Add frame rate counter
It is exposed through StoatSpriteEngine functions, and is normally only
visible when the game's debug mode is enabled. It's very useful for
checking graphics performance.
2024-10-17 09:20:26 +09:00
Nunuhara Cabbage f566539e4f Merge pull request #201 from kichikuou/outline
TapirEngine: Outline rendering
2024-10-13 11:28:53 -07:00
kichikuou c04aa8a844 TapirEngine: Outline rendering
This implements outline (called "edge" in the game config) rendering of
3D objects, using the "inverted hull" method.
2024-10-13 07:18:49 +09:00
kichikuou 87b1e2abe2 Make variable names consistent between reign.v.glsl and reign_shadow.v.glsl
Pure refactoring, no behavior changes.
2024-10-13 07:18:49 +09:00
kichikuou a0a68a022c TapirEngine: Load .opr file
A .pol file may have a corresponding .opr file, which is a text file
containing parameters for the meshes.
2024-10-13 07:18:49 +09:00
Nunuhara Cabbage 3fb2dc3650 Merge pull request #200 from kichikuou/bones
3d: Increase MAX_BONES to 308
2024-10-11 21:00:49 -07:00
kichikuou c1ce2c88c6 3d: Increase MAX_BONES to 308
This is the maximum number of bones in a model for Rance Quest
(pasuteru_full.POL).

Now bone transform matrices are stored in a uniform buffer object,
because its size exceeds GL_MAX_VERTEX_UNIFORM_COMPONENTS in iOS Safari.
2024-10-12 07:35:51 +09:00
Nunuhara Cabbage 222d2700a9 Merge pull request #199 from kichikuou/CGManager
CGManager.LoadArchive() should open archive in the game directory
2024-10-09 06:24:33 -07:00
kichikuou dd18d68be5 CGManager.LoadArchive() should open archive in the game directory
This fixes a boot problem in Rance Quest Magnum.
2024-10-09 12:51:08 +09:00
Nunuhara Cabbage db7c3a608c Merge pull request #198 from kichikuou/shadow
3d: Fix shadow rendering in Rance Quest
2024-10-06 19:57:03 -07:00
kichikuou 899c6c02a1 3d: Fix shadow rendering in Rance Quest
- Use glm_look_anyup() to avoid singularities when the shadow light
  direction is parallel to the up vector
- Fix bounding sphere calculation when there are multiple shadow casters
2024-10-07 10:53:41 +09:00
Nunuhara Cabbage 8ff5ffe30b Merge pull request #197 from kichikuou/alphamap
3d: Ignore alpha map if same as color map
2024-10-05 21:22:58 -07:00
Nunuhara Cabbage ff9175c1fd Merge pull request #196 from kichikuou/wheel
IbisInputEngine: Mouse wheel support
2024-10-05 21:22:41 -07:00
kichikuou 74666c9b90 3d: Ignore alpha map if same as color map
In Rance Quest (e.g. mapF_ew01), some materials use the same image for
both color map and alpha map. In that case, the alpha channel of the
color map can be used, so ignore the alpha map.
2024-10-06 07:53:15 +09:00
kichikuou 68bd33e099 IbisInputEngine: Mouse wheel support
This enables wheel operations in Rance Quest.
2024-10-06 07:38:24 +09:00
Nunuhara Cabbage 84ab9a41da Merge pull request #195 from kichikuou/vert-color
3d: Implement vertex colors
2024-10-04 20:39:59 -07:00
kichikuou 22a06b1da9 3d: Implement vertex colors
3D objects can have a color per vertex, which is multiplied with the
texture color.
2024-10-05 07:41:17 +09:00
Nunuhara Cabbage 128b2fd6d5 Merge pull request #194 from kichikuou/collision
TapirEngine: Proper collision detection
2024-09-30 10:53:47 -07:00
kichikuou 09dc9470ae TapirEngine: Proper collision detection
Collision detection is based on a mesh named "collision" in the map's 3D
model. The "collision" mesh specifies the area in which the character
can move in the xz plane, and the y coordinate represents the height of
the map at that point.

Now cglm 0.9.2 is required, for 2D AABB operations.
2024-09-30 09:11:54 +09:00
Nunuhara Cabbage 0f5a39c292 Merge pull request #193 from kichikuou/FileOperation
Implement FileOperation HLL functions for Rance Quest
2024-09-28 10:37:52 -07:00
kichikuou 73f7acde40 Implement FileOperation HLL functions for Rance Quest 2024-09-28 11:07:43 +09:00
Nunuhara Cabbage 3afe4e4453 Merge pull request #192 from kichikuou/A_SORT
Fix A_SORT
2024-09-25 17:32:28 -07:00
kichikuou 8f69f1911a Fix A_SORT
* Fix sorting of strings and floats
* Avoid overflow in integer comparison
2024-09-25 13:20:03 +09:00
Nunuhara Cabbage e466b3f06b Merge pull request #191 from kichikuou/game_compatibility
Update game_compatibility.md
2024-09-22 07:42:33 -07:00
kichikuou a2ae28c1c1 Update game_compatibility.md 2024-09-22 21:12:42 +09:00
Nunuhara Cabbage 41626b5018 Merge pull request #190 from kichikuou/dash
Implement StoatSpriteEngine.SP_SetDashTextSprite
2024-09-21 22:38:47 -07:00
kichikuou 9a76d472db Implement StoatSpriteEngine.SP_SetDashTextSprite
This implementation creates a temporary "glyph" texture and draws it to
the sprite using gfx_draw_glyph().
2024-09-21 10:35:42 +09:00
Nunuhara Cabbage 964bba1823 Merge pull request #189 from kichikuou/vanish
StoatSpriteEngine: Make SP_GetMaxZ consider multisprites
2024-09-20 18:12:09 -07:00
kichikuou 49b85f885d StoatSpriteEngine: Make SP_GetMaxZ consider multisprites
This fixes a problem in Vanish! where the opening movie was hidden
behind other sprites.
2024-09-20 20:39:20 +09:00
Nunuhara Cabbage 93e9357f84 Merge pull request #188 from kichikuou/glsl
Fix compile error of dungeon_raster.f.glsl on WebGL
2024-09-19 06:09:19 -07:00
kichikuou 2a7f58c187 Fix compile error of dungeon_raster.f.glsl on WebGL
`sample` is a reserved word in GLSL ES 3.0.
2024-09-19 12:55:21 +09:00
Nunuhara Cabbage 08e47b8d04 Merge pull request #187 from kichikuou/vmDrawGauge
Add guard against division by zero in vmDrawGauge.Draw()
2024-09-18 18:58:51 -07:00
kichikuou 217c4d5d65 Add guard against division by zero in vmDrawGauge.Draw()
When `max` is 0, the gauge is drawn as empty.
2024-09-19 07:32:30 +09:00
Nunuhara Cabbage ea762de937 Merge pull request #186 from kichikuou/DrawDungeon
Implement DrawDungeon.SetWalkedAll
2024-09-17 20:05:31 -07:00