Commit Graph
63 Commits
Author SHA1 Message Date
kichikuou afae3fc9a6 DrawDungeon14: Implement raster effect
It is implemented as a post-processing effect. The hack for the
projection transform matrix has been removed, because now the image is
flipped upside down in the post-processing stage.
2023-09-01 21:45:46 +09:00
kichikuou 0e5d41a728 Implement DrawGraph.CopyGrayscale
Used in Daiteikoku.
2023-06-18 20:57:00 +09:00
Nunuhara Cabbage 2237bb814c Implement various HLL functions for Rance Quest
Most of the functionality of gfx_render_texture (draw method, blend
rate) is moved into sprite_render, since this was the only place using
it.
The draw method and blend rate are now stored in sact_sprite objects
instead of textures.
sact_sprite now has two renderers: the old SACT2 renderer (with blend
rate as the only shader parameter) and the new ChipmunkSpriteEngine
renderer, which supports multiply/add colors and the "surface area"
feature from PartsEngine.

Rance Quest now runs up to the first Flash-related function call
(Flash?!?!).
2023-02-12 15:59:36 -08:00
kichikuou de2db1af93 Implement DrawMovie, DrawMovie2 and PlayMovie HLLs
These HLLs play .mpg movie files (later games use .alm file extension,
but the format is the same, i.e. MPEG-PS) that contain MPEG1 video and
MP2 audio streams.

pl_mpeg.h is the PL_MPEG library (https://github.com/phoboslab/pl_mpeg)
imported from commit 5aeef4d07593be1960a0e4c7fe204809cfae30bd.

This adds a few mixer functions (mixer_stream_*) for playing custom
audio streams under the master mixer.
2023-01-06 12:12:07 +09:00
kichikuou 82407a1d59 Fix shader compilation errors in OpenGL ES 2023-01-01 11:50:03 +09:00
Nunuhara Cabbage f23d713f46 Merge pull request #91 from kichikuou/effect
Implement EFFECT_NOISE_CROSSFADE and EFFECT_SEPIA_NOISE_CROSSFADE
2022-12-27 10:11:54 -08:00
kichikuou 8aafb271f9 Implement EFFECT_NOISE_CROSSFADE and EFFECT_SEPIA_NOISE_CROSSFADE
EFFECT_SEPIA_NOISE_CROSSFADE is frequently used in Toushin Toshi 3.
2022-12-27 21:13:01 +09:00
kichikuou 2de5132803 ReignEngine: Support (sprite) mesh attribute
It has the same effect as the (sprite) material attribute.

Also, now sprite objects are rendered in the DRAW_OPAQUE phase.
2022-12-24 16:54:40 +09:00
kichikuou 70b4071350 ReignEngine: Support "shadow darkness" material parameter
It is a value between 0.0 and 1.0, where 0.0 means no shadows are drawn
on the material.
2022-12-24 16:54:40 +09:00
kichikuou 8c72c5b5e0 ReignEngine: Normalize vectors after applying normal_transform
normal_transform can be non-orthogonal, so after transforming with it
direction vectors must be normalized.

This fixes a bug where President Garter is rendered too specular.
2022-12-17 10:59:16 +09:00
kichikuou 581593f9b5 ReignEngine: Support (env) mesh attribute
If specified, the mesh should be rendered with environment mapping
using the material's COLOR_MAP as a matcap texture.
2022-11-05 20:56:26 +09:00
kichikuou 814ebb7d3d ReignEngine: Support (sprite) material attribute
If specified, alpha test is used instead of alpha blend.
2022-11-05 20:56:25 +09:00
Nunuhara Cabbage bc852567f2 Merge pull request #73 from kichikuou/gles
Fix shader compilation errors in OpenGL ES
2022-10-01 10:37:52 -07:00
kichikuou 1ae812ff03 Fix shader compilation errors in OpenGL ES 2022-10-01 16:41:51 +09:00
kichikuou 3615223b52 ReignEngine: Implement alpha mapping 2022-10-01 16:24:20 +09:00
kichikuou 909168acdb ReignEngine: Implement particle rendering
This completes the implementation of the particle effect system, except
for the camera quake effect.
2022-09-25 10:39:37 +09:00
kichikuou 06a630ea62 ReignEngine: Implement Fog
There are two types of fog, linear fog and atmospheric scattering. The
formula for light scattering is incorrect (see the comment in
reign.v.glsl) and therefore not physically correct.
2022-08-06 09:38:48 +09:00
kichikuou d185ae71bf ReignEngine: Implement CalcInstanceHeightDetection
This is used to compute Y-positions of map objects.

It is called quite often, so this implementation creates and caches a
height map of the instance by (re)using the shader for shadow mapping.
2022-07-30 15:17:08 +09:00
kichikuou 233b2a4f20 ReignEngine: Implement shadow mapping 2022-07-24 16:01:16 +09:00
kichikuou af7127580c ReignEngine: Implement light mapping 2022-07-16 15:26:41 +09:00
kichikuou c86ca5de87 ReignEngine: Implement bump mapping 2022-07-16 12:59:35 +09:00
kichikuou 80c6b62074 ReignEngine: Implement specular map 2022-07-10 13:33:50 +09:00
kichikuou fe02c8f401 ReignEngine: Implement rim lighting
Lighting parameters are per-material and are stored in the .amt file.
2022-07-10 13:20:50 +09:00
kichikuou b42032c9f8 ReignEngine: Implement basic lighting
This implements a Phong shading with ambient, diffuse and specular
components, using up to three directional lights and one specular light.

The light calculation is made to match the "high quality" 3D mode of
Toushin Toshi 3.
2022-07-09 14:36:44 +09:00
Nunuhara Cabbage 8ee136b287 parts: various fixes and improvements
* SetAddColor and SetMultiplyColor implemented
* additive draw filter implemented
* GetPartsUpperLeftPos{X,Y} implemented
* various parameters are now applied from parent to child parts
* misc. bug fixes

The first dungeon screen in Rance 01 now renders correctly.
2022-06-21 19:57:36 -07:00
kichikuou db97942393 Implement ReignEngine.SetInstanceAlpha 2022-06-12 21:27:49 +09:00
kichikuou a2bbe15b20 ReignEngine: Implement skeletal animation 2022-06-11 13:28:02 +09:00
Nunuhara Cabbage 09f2c3e1ed parts: implement Parts_Set*SurfaceArea functions
These functions apply a clipping rectangle to the parts texture.
2022-06-08 16:51:06 -07:00
kichikuou 9da9f53671 Implement FillAngle HLL
This is used in Toushin Toshi III for the "clock" effect of battle
command icons.
2022-06-05 10:06:42 +09:00
kichikuou dca30c3aab Initial implementation of ReignEngine HLL
ReignEngine is the 3D rendering engine used in Toushin Toshi III, and is
the predecessor of the 3D engines for Rance Quest, Rance 9, Evenicle,
etc.

This implements minimal functionality to be able to draw the first 3D
dungeon scene. Many important parts such as motion and lighting are not
implemented yet.
2022-06-04 11:29:07 +09:00
Nunuhara Cabbage 2262f7067c Use FreeType2 instead of SDL_ttf
SDL_ttf isn't really designed to be used with OpenGL. It caches glyph
bitmaps in memory, whereas we want to cache glyph textures on the GPU.
By using FreeType directly we avoid creating and destroying a new
texture every time a glyph is rendered.

Additionally, all glyph textures (including fnl-derived glyphs) now use
the GL_RED internal format instead of GL_RGBA.
2022-05-08 16:11:25 -07:00
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