Commit graph

109 commits

Author SHA1 Message Date
Cameron Cawley
1357bfe672 COMMON: Avoid including engine headers in common code for DebugChannelDef 2024-06-20 20:15:57 +01:00
neuromancer
00a0346983 TINYGL: make sure stipple pattern is copied into the internal states instead of using pointers 2024-06-01 15:33:50 +02:00
neuromancer
4cd57d59a8 TINYGL: removed the usage of stipple pattern from textured triangles 2024-06-01 15:33:50 +02:00
neuromancer
e232c9d797 TINYGL: make sure the polygon stipple pattern is copied 2024-06-01 15:33:50 +02:00
neuromancer
fdd84fd08a TINYGL: initial implementation of tglPolygonStipple 2024-06-01 15:33:50 +02:00
Cameron Cawley
d293a659d3 TINYGL: Remove use of Graphics::PixelBuffer from the FrameBuffer class 2023-05-14 23:04:11 +02:00
Cameron Cawley
5cc4607ff4 TINYGL: Add a fast path for rendering opaque BlitImages 2023-03-03 09:59:41 +00:00
Paweł Kołodziejski
c4686ee84c
TINYGL: Rename copyToBuffer to copyFromFrameBuffer 2023-02-09 07:31:09 +01:00
Cameron Cawley
4b2e3e6726 TINYGL: Use realloc to increase the size of the vertex array 2023-02-03 22:06:53 +00:00
Paweł Kołodziejski
0ca414daa0
TINYGL: Removed few more forced inlines 2022-07-17 01:35:19 +02:00
Paweł Kołodziejski
31e3132896
TINYGL: Reduced some forced inlines 2022-07-17 01:10:54 +02:00
Paweł Kołodziejski
f045abc031
TINYGL: Removed some not needed inlines 2022-07-16 23:54:41 +02:00
Paweł Kołodziejski
cdaec9de8d
TINYGL: Added fog support. 2022-06-05 20:59:38 +02:00
Paweł Kołodziejski
de67c1ae54
TINYGL: Latest TinyGL 0.4.1 is relicensed under MIT license. 2022-03-08 15:47:20 +01:00
Paweł Kołodziejski
20cb0ae228
ALL: Cleanup ResidualVM -> ScummVM 2021-12-26 21:19:38 +01:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Paweł Kołodziejski
b673e0adf5
TINYGL: Janitorial 2021-12-15 23:55:36 +01:00
Paweł Kołodziejski
c98fe1c61c
TINYGL: Eliminate unnecessary branches and code in flow 2021-12-15 23:15:55 +01:00
Paweł Kołodziejski
c66ca22cbb
TINYGL,GRIM: Replace custom shadows to stencil buffer solution 2021-12-10 18:37:24 +01:00
Paweł Kołodziejski
6a591146c8
TINYGL: Added stencil buffer implementation 2021-12-09 21:10:53 +01:00
Paweł Kołodziejski
3b9f9804ee
TINYGL: Rearrange access to TinyGL 2021-12-08 14:52:18 +01:00
Paweł Kołodziejski
87594a052f
TINYGL: Cleanup more FrameBuffer class entries 2021-12-07 22:11:55 +01:00
Paweł Kołodziejski
10f6a79ce8
TINYGL: More work on accessing FrameBuffer class 2021-12-07 20:40:32 +01:00
Paweł Kołodziejski
2368991ab6
TINYGL: Rearrange access gl context access from/to frame buffer class 2021-12-07 19:58:03 +01:00
Paweł Kołodziejski
c1512a5c40
TINYGL: Eliminate passing context where possible 2021-12-07 00:58:14 +01:00
Paweł Kołodziejski
d80bd265d2
TINYGL: Rearrange visibility various functions 2021-12-06 13:57:41 +01:00
Paweł Kołodziejski
8ed00821ac
TINYGL: Attempt to fix compilation 2021-12-05 23:00:15 +01:00
Paweł Kołodziejski
9f7a903b10
TINYGL: Mark private/public entries in FrameBuffer class 2021-12-05 22:30:52 +01:00
Paweł Kołodziejski
0c59f5a673
TINYGL: Moved PixelBuffer to TinyGL 2021-11-27 21:29:02 +01:00
Paweł Kołodziejski
af37825be3
ENGINES: Replace PixelBuffer with Surface 2021-11-27 20:14:44 +01:00
Paweł Kołodziejski
eab1fe4097
TINYGL: Implemented tglPolygonOffset function 2021-10-26 21:59:04 +02:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Vincent Pelletier
f8c72b5967 TINYGL: Move texture resampling from create time to render time
Thanks to pixel repacking using cpu data cache, this has a low runtime
cost even for TGL_LINEAR.
Adds support for TGL_NEAREST.
Adds support for TGL_MIRRORED_REPEAT, TGL_CLAMP_TO_EDGE and TGL_REPEAT.
Also, add support for more texture clamping and resampling options.

Mipmaps are not supported, although their sampling modes will be
applied - but to the full-size texture instead of selected mipmap.

Note: Texture sampler is still chosen at texture creation time.
2020-11-12 08:15:39 +01:00
Pawel Kolodziejski
b321938c7b TINYGL: Restored ability to create internal buffer based on pixel format 2020-10-05 08:09:20 +02:00
Vincent Pelletier
7988c696d9 TINYGL: Drop unused Framebuffer pixelbits property 2017-05-01 08:34:53 +00:00
Vincent Pelletier
4bcc95f217 TINYGL: Fix ARGBST scaling.
I based ARGB scaling on ST scaling without giving it enough thought.
It accidentally uncovered an older bug in glopClear, which made me recheck
these formulas.
ST scaling maps [0.0, 1.0] to [0x01.0000, 0xff.0000], meaning the first and
last texture rows and columns are never shown.
Treating s and t as proportions of ST_MAX fixes this by mapping to
[0x00.0000, 0xff.fffc] (last two fractional bits being off-precision, as
there are only 14 bits), covering the whole available range.
2017-05-01 08:34:25 +00:00
Vincent Pelletier
92a54a5969 fixup! TINYGL: Fix line color
These shifts are now handled in zline (only user of this macri),
consistently with ztriangle.
I have removed this macro from my working copy, but I missed the breakage
while resolving the conflict.
2017-05-01 04:45:11 +00:00
Vincent Pelletier
39656ce5c5 TINYGL: Store colors with 8-bits integer part
Before this change vertex data (post-shading) was limited to 6 (green) or
5 (all others) bits of precision.
Interpolation happened with 8-bits precision, so the visual effect is
minor: about 4 off at vertices.
2017-05-01 02:22:17 +00:00
Vincent Pelletier
054a2bd920 TINYGL: Fix line color
As in ztriangle, vertex color must be shifted from internal 16-bits
fixed-point format to 8-bits colors.
To do so, define values similar to the ones describing for ST fixed-point
format.
Also, use these in tglClear instead of hard-coded multiplicands, as is
done in tglColor4f and gl_transform_to_viewport.
Also, make tglClear take into account requested clear depth.
2017-05-01 02:21:40 +00:00
Vincent Pelletier
5ab94de318 TINYGL: Avoid unneeded calls in writePixel. 2017-04-26 13:11:00 +00:00
Vincent Pelletier
6087492dbd TINYGL: Simplify setting & disabling scissors. 2017-04-23 10:35:04 +00:00
Vincent Pelletier
e1de3407f1 TINYGL: Make scissors follow Common::Rect semantics.
As per Common::Rect data model, right and bottom border are excluded, so:
- Make FrameBuffer::scissorPixel reject bottom & right borders.
- Update bounding rectangle definition for dirty rectangle operations
  ClearBufferDrawCall::getDirtyRegion is already correct.
- zblit was almost following, except for an off-by-one mistake.
2017-04-23 10:35:04 +00:00
Vincent Pelletier
e1d5b811e1 Revert "GRIM: fixed transparency in TinyGL renderer"
This reverts commit b8bddf64da.

Since 9b7548ccf7, alpha test is enabled
when drawing model faces, fixing transparency issues in GRIM which were
corrected by reverted commit.
It is incorrect to test transparency when caller did not enable it.
Also, this change bypasses increments done at the end of
putPixelTextureMappingPerspective, so transparent textures in 16 bits mode
would be stuck on the transparent pixel for the current line's 8-pixel run
in filTriangle, and would ignore z coordinate.
2016-07-28 01:55:14 +00:00
Paweł Kołodziejski
74ffd37dbe Merge pull request #1278 from vpelletier/tinygl_scissorpixel
Tinygl: optimise scissorpixel
2016-07-21 21:57:05 +02:00
Vincent Pelletier
d2defcd1cc TINYGL: Actually check if alpha test and blending are enabled. 2016-07-21 16:42:10 +02:00
Vincent Pelletier
d437892538 TINYGL: Get rid of PSZB as it duplicates pixelbytes. 2016-07-21 16:39:40 +02:00
Vincent Pelletier
db764b1ca5 TINYGL: Entirely avoid calling scissorPixel in putPixel when possible. 2016-07-21 16:02:22 +02:00
Vincent Pelletier
3c2689a65f TINYGL: Optimise scissorPixel.
Scissor operations happen in a 2d rectangle, but it used to take a buffer
offset as a parameter. As a result, it had to divide that value with its
width, which is an expensive operation, which has to be done for each
pixel candidate for display (even before z-buffer comparison when
applicable, in current implementatoin).
But callers actually generate the buffer offset from rectangular
coordinates, so propagate these instead.
This sadly increases API redundancy, but saves a lot of time in a very
frequent occurrence (especially when enabling dirty rect mechanism,
which is not yet enabled by default).
2016-07-21 15:56:29 +02:00
Vincent Pelletier
638b841c74 TINYGL: Simplify zline.cpp .
drawLine was broken for dx = 0 lines.
Also, the split between fillLineGeneric and drawLine, along with the many
parameters exchanged (with obscure names with subtle differences), made
the code hard to understand.
This implementation should be easier to check.
There was no visible CPU usage change.
Fixes GRIM's ticket printer, which are composed of a lot of vertical
segments.
2016-07-18 15:55:08 +02:00
Vincent Pelletier
03da50312b TINYGL: Move the task of writing to z-buffer to FrameBuffer::writePixel.
Because writePixel may decide to not write anything (alpha test), in which
case no z-buffer write should happen.
Factorises code.
Fixes apparent back-face culling in GRIM behind transparent textures, like
the tube (the 3d-shape Manny takes out, not the flat image in foreground)
in set mo.
2016-07-14 21:30:18 +00:00