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).
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.
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.
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.
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.
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.
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.
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.
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