Commit Graph
789 Commits
Author SHA1 Message Date
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
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
kichikuou b23d05bcc2 ReignEngine: Load material parameters from .amt file 2022-07-09 14:36:40 +09:00
Nunuhara Cabbage 8b6d4943b3 Implement SH_A_FIND_SREF
Used in Rance 01.
2022-06-26 20:41:56 -07:00
Nunuhara Cabbage a78f5348f3 Fix memory leak in PassRegister 2022-06-26 20:15:52 -07:00
Nunuhara Cabbage 73b21210c2 Fix delegate memory management issues
Delegates should be ref'd in vm_copy and unref'd in variable_fini.

This also includes some improvements to the diagnostic reporting of
DEBUG_HEAP.
2022-06-26 17:55:05 -07:00
Nunuhara Cabbage be2b1421f1 Merge pull request #59 from kichikuou/Toushin3Loader
Toushin3Loader: Fix use-after-free after VM reset
2022-06-26 08:26:33 -07:00
kichikuou 60e9696a23 Toushin3Loader: Fix use-after-free after VM reset 2022-06-26 21:15:59 +09:00
Nunuhara Cabbage 9f42ee379d Improve performance of vm_image_to_json
Use a callback-based function to create the heap JSON array. This avoids
the O(n) insertion time of cJSON_AddItemToArray.
2022-06-25 10:00:24 -07:00
Nunuhara Cabbage 3a40542aab parts: fix bug with INT_MIN in numeral object
Use 64-bit integer to avoid overflow when creating numeral for INT_MIN.
2022-06-25 09:22:11 -07:00