kichikuou
31823f5731
ReignEngine: Draw instances in z-order
...
To get correct blending effect for overlapped transparent objects.
2022-11-05 20:56:25 +09:00
Nunuhara Cabbage
835679205c
Merge pull request #76 from kichikuou/overflow
...
Fix integer overflow in audio_mixer.c
2022-10-22 09:30:22 -07:00
kichikuou
88268b084c
Fix integer overflow in audio_mixer.c
...
This fixes a bug in Toushin Toshi 3 where the audio thread crashes when
battle ended, after exploring the second dungeon for (INT_MAX / 44100)
milliseconds (~= 50 secs).
2022-10-22 10:23:22 +09:00
Nunuhara Cabbage
76aba9cd6b
Merge pull request #75 from kichikuou/tt3
...
Fixes / improvements for Toushin Toshi 3
2022-10-12 20:05:20 -07:00
kichikuou
2370052b54
ReignEngine: Fix bone mapping between model and motion
...
Some motion files (e.g. maidsan_ahoge_* and otokomae_*) have wrong bone
IDs, so bone names should be used to look up matching bones in the
model.
However, this does not always work because masokan.POL has multiple
bones with the same name. In that case ID matching must be used.
2022-10-10 14:20:20 +09:00
kichikuou
252f1b5464
Fix out-of-bounds access in MsgSkip HLL
...
Toushin Toshi 3 calls MsgSkip.{Get,Set}Flag with msgnum = -1.
2022-10-10 14:20:20 +09:00
kichikuou
5c288f87e5
Implement EFFECT_TV_SWITCH_OFF
...
Used in Toushin Toshi 3.
2022-10-10 14:20:20 +09:00
Nunuhara Cabbage
0dec3ff5eb
Merge pull request #74 from kichikuou/gles
...
Fix text rendering issue in OpenGL ES
2022-10-03 21:54:32 -07:00
kichikuou
3f1d76cd9f
Fix text rendering issue in OpenGL ES
...
This fixes an issue where text is not rendered on Android.
In OpenGL ES3.0, GL_RED is not a valid value for the internalFormat
parameter of glTexImage2D.
2022-10-03 21:59:30 +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
Nunuhara Cabbage
11356db636
Merge pull request #72 from kichikuou/reign
...
ReignEngine improvements
2022-10-01 10:34:19 -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
fbf74db7a4
ReignEngine: Fix rim lighting for very small rim_exponent values
2022-10-01 16:24:16 +09:00
kichikuou
773cce03eb
ReignEngine: Implement camera quake effect
2022-10-01 16:24:13 +09:00
Nunuhara Cabbage
8d0cf7cdcb
Merge pull request #71 from kichikuou/particle
...
ReignEngine: Implement particle rendering
2022-09-26 17:04:34 -07:00
kichikuou
97c65a33db
Add frame bounds check in render_polygon_particles()
2022-09-26 15:46:12 +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
Nunuhara Cabbage
296fe887e5
Merge pull request #70 from kichikuou/reign
...
ReignEngine improvements
2022-09-11 09:52:32 -07:00
kichikuou
803bb1a8a4
ReignEngine: Fix BackCG issues
...
- Enable both alpha map and alpha mod, using the new drawing function
gfx_copy_stretch_blend_amap_alpha().
- Do not draw if `bcg->show` flag is false.
- Do not WARNING() for SetBackCGNum(0) as it's used to unload the CG.
2022-09-11 21:08:54 +09:00
kichikuou
c30225d535
ReignEngine: Bind all vertex attributes to fixed locations
...
So that model_load() doesn't have to depend on RE_renderer.
2022-09-11 14:39:37 +09:00
kichikuou
2ceb727a66
ReignEngine: Instances with draw=false should not cast shadows
2022-09-11 14:35:50 +09:00
kichikuou
7bffaeffe6
ReignEngine: Fix projection matrix calculation
...
Now it makes the same angle of view as the original ReignEngine.
2022-09-11 14:33:43 +09:00
Nunuhara Cabbage
57525689a2
Merge pull request #69 from kichikuou/particle
...
ReignEngine: Add loader for particle effects
2022-09-04 15:21:41 -07:00
kichikuou
0ff9c5a62c
ReignEngine: Add loader for particle effects
...
This implements a parser for particle effect definition files (.pae)
and a set of field accessor functions for the RE_ITYPE_PARTICLE_EFFECT
instance type. Rendering of effects is not yet implemented.
2022-09-04 10:17:03 +09:00
Nunuhara Cabbage
30b810b309
Merge pull request #68 from kichikuou/fog
...
ReignEngine: Implement Fog
2022-08-05 18:51:38 -07: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
Nunuhara Cabbage
3e536af09a
Implement DG_ADD, DG_EXIST, DG_ERASE
2022-08-02 18:16:16 -07:00
Nunuhara Cabbage
62a2dc003c
Merge pull request #67 from kichikuou/height
...
ReignEngine: Implement CalcInstanceHeightDetection
2022-07-30 12:55:59 -07: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
Nunuhara Cabbage
be977bab46
Merge pull request #66 from kichikuou/shadow
...
ReignEngine: Implement shadow mapping
2022-07-24 14:04:50 -07:00
kichikuou
233b2a4f20
ReignEngine: Implement shadow mapping
2022-07-24 16:01:16 +09:00
kichikuou
b0e540e67b
gfx: Expose low level shader loading function
...
And use it in 3d/. This gives more flexibility on vertex attribute /
uniform variable configurations.
2022-07-24 16:01:16 +09:00
Nunuhara Cabbage
9675c8f256
Merge pull request #65 from kichikuou/3d
...
ReignEngine improvements
2022-07-23 11:27:15 -07:00
kichikuou
2918a6310c
ReignEngine: Remove hard limit on number of instances
...
Some maps in Toushin Toshi 3 have more than 32 instances.
2022-07-23 21:41:41 +09:00
kichikuou
fc81d0ec4e
ReignEngine: Do not ignore BuildModel() with elapsed time 0
...
It isn't no-op, because instance motion may be changed by
SetInstanceMotionFrame().
2022-07-23 21:23:13 +09:00
kichikuou
e7c9410df4
ReignEngine: Implement two functions
...
GetInstanceBoneIndex and TransInstanceLocalPosToWorldPosByBone.
2022-07-18 13:01:49 +09:00
Nunuhara Cabbage
feb2fc17f4
Merge pull request #64 from kichikuou/BuildModel
...
Implement ReignEngine.BuildModel
2022-07-17 16:29:23 -07:00
kichikuou
3343efbcb9
Implement ReignEngine.BuildModel
...
Instance motions are updated with this function.
2022-07-17 16:20:02 +09:00
Nunuhara Cabbage
b1f3e85c4d
Merge pull request #63 from kichikuou/lighting
...
ReignEngine: Implement bump mapping and light mapping
2022-07-16 11:15:01 -07:00
kichikuou
af7127580c
ReignEngine: Implement light mapping
2022-07-16 15:26:41 +09:00
kichikuou
84f55a55cd
ReignEngine: Optimize vertex buffer layout
...
Now unused vertex attributes (e.g. bone weights) are not included in the
vertex buffer.
2022-07-16 15:26:38 +09:00
kichikuou
c86ca5de87
ReignEngine: Implement bump mapping
2022-07-16 12:59:35 +09:00
Nunuhara Cabbage
b98fff601f
Merge pull request #62 from kichikuou/lighting
...
ReignEngine: Implement rim lighting and specular mapping
2022-07-10 21:47:49 -07: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
Nunuhara Cabbage
2e23554162
Implement SACT2.Joypad_GetAnalogStickStatus
2022-07-09 17:35:07 -07:00
Nunuhara Cabbage
6ed2417612
Merge pull request #61 from kichikuou/billboard
...
ReignEngine: Fix billboard rendering issue
2022-07-09 17:22:40 -07:00
kichikuou
5e25dd4000
ReignEngine: Fix billboard rendering issue
...
This fixes an issue where billboard objects are not drawn in some
environments.
ReignEngine disables some vertex attributes when drawing billboards, but
AMD's driver doesn't draw anything if any of those attributes are
assigned to attribute index 0.
To avoid this, this explicitly binds "vertex_pos" attribute (which is
always enabled) to index 0.
References:
https://community.khronos.org/t/gldisablevertexattribarray-not-working/67077/4
https://stackoverflow.com/questions/28818997/how-to-use-glvertexattrib
2022-07-10 08:04:08 +09:00
Nunuhara Cabbage
b39ad5fdc3
Merge pull request #60 from kichikuou/lighting
...
ReignEngine: Implement basic lighting
2022-07-09 08:28:34 -07:00