43 Commits
Author SHA1 Message Date
neuromancer 66e1029071 TINYGL: Clamp viewport coordinates to INT_MAX and INT_MIN to avoid overflow 2025-11-17 14:36:08 +01:00
Cameron Cawley 5b1b14ad80 COMMON: Mark more symbols as const 2023-12-26 20:23:59 +01:00
Paweł Kołodziejski ffe7bee81e TINYGL: Switch profiling to runtime condition 2022-06-05 23:40:35 +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 fef0e04cb7 TINYGL: No need to check for current_texture 2022-01-01 14:06:45 +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 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 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 a8dcf7dbbd TINYGL: Added check if texture is uploaded 2021-11-09 17:09:13 +01:00
Paweł Kołodziejski 760699ab0f TINYGL: Added check if texture is selected to avoid textured triangle path 2021-11-07 15:44:45 +01: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
Vincent Pelletier a6af3a38a3 TINYGL: Fix vertice color when clipped and lighting is disabled
longcurrent_color is assigned per vertex, but it is not saved on each
vertex on creation (unlike their "color" attribute, used when lighting
is enabled).
As a consequence, and because rendering happens asynchronously (rather,
following the draw call queue managed by zdirtyrect.cpp when requested
to flip current buffer), longcurrent_color at clipping time can be
different to the one at vertex declaration time, causing color artifacts.

The effect is most noticeable in EMI set shi, in the grog dispenser +
shipyard manager closeup angle, when Guybrush exits the screen by
crossing its right border: dark triangles become visible on his face.

Instead, always use the color attribute, which is already properly
initialised on vertex creation.
2017-07-20 01:51:07 +00:00
Vincent Pelletier 92130c138e TINYGL: Obey current shade model also when clipping lines.
The code was only interpolating color (in TGL_SMOOTH mode) when clipping
faces, extend it to lines.
Also, factorise color interpolation code.
No visual difference is expected in normal use, but it fixes wireframe
rendering when used for debugging.
2017-07-20 01:48:58 +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 342cf9a60d TINYGL: Simplify a bit updateTmp . 2016-07-15 22:20:41 +00:00
Vincent Pelletier a336422811 TINYGL: Fix clipped triangle vertices alpha channel.
In all 4 updateTmp call places, q is not initialised, so there is nothing
of value in the alpha channel (it's 0). So just apply the same rule as for
other color channels.
2016-07-14 15:36:28 +00:00
Pawel Kolodziejski 1b48414d7e TINYGL: cleanup license headers 2014-08-13 18:52:52 +02:00
Pawel Kolodziejski 9a81f8997c TINYGL: properly handle color for FLAT mode and lines drawing. Respect FLAT/SMOOTH mode for triangle drawing 2014-07-05 20:54:14 +02:00
Pawel Kolodziejski f477946646 TINYGL: allow change internal texture size at compilation time. Now it's 1024x1024 pixels. 2014-07-05 12:13:03 +02:00
Pawel Kolodziejski 2072e51813 Revert "TINYGL: fixing T texture cordinate"
This reverts commit 5d65e40e1f.
2014-07-05 11:08:30 +02:00
Pawel Kolodziejski 5d65e40e1f TINYGL: fixing T texture cordinate 2014-07-05 11:06:34 +02:00
Stefano Musumeci a77ebef942 MYST3: Fixed incorrect viewport issues. 2014-07-03 12:33:06 +02:00
Stefano Musumeci 63fd685589 TINYGL: Implemented alpha interpolation in triangle rasterization routine. 2014-07-01 14:29:44 +02:00
Pawel Kolodziejski f33e1384f1 TINYGL: fixed formatting and minor cleanup 2014-06-30 02:40:46 +02:00
Stefano Musumeci 1a5b6272fc TINYGL: Refactored the name of FrameBuffer instance from zb to fb 2014-06-28 20:39:09 +02:00
Stefano Musumeci 81b5d40588 TINYGL: Refactored fill functions inside ZBuffer struct. 2014-06-28 20:39:07 +02:00
Stefano Musumeci f9438a5e3c TINYGL: Moved all external C functions inside the struct ZBuffer. 2014-06-28 20:39:06 +02:00
Stefano Musumeci 6c7eaca2eb TINYGL: Last optimization batch, performance comparable to the previous version. 2014-06-28 17:58:26 +02:00
Stefano Musumeci d45c455be4 TINYGL: Done some more optimization on maths code. 2014-06-28 17:58:25 +02:00
Stefano Musumeci 4fbb2d0dc3 TINYGL: Done several optimizations to the maths code. 2014-06-28 17:58:24 +02:00
Stefano Musumeci b7853b48f8 TINYGL: Fixed a few mistakes during the refactoring. 2014-06-28 17:57:24 +02:00
Stefano Musumeci c1040a9cdf TINYGL: Started replacing the old classes with the new ones.
TINYGL: Removed all the use of the old classes of Vector and Matrix.
2014-06-27 11:28:59 +02:00
Einar Johan Trøan Sømåen 698ef4a37c TINYGL: Use astyle to (semi-selectively) apply the code-formatting conventions to TinyGL. 2014-02-20 18:46:49 +01:00
Dries Harnie 6bd38b1801 TINYGL: Support ColorMask
Note, this is just basic support, it is either all or nothing.
Disabling select channels is not possible.
2013-07-02 00:22:59 +02:00
Giulio Camuffo 158a19df31 TinyGL: Support for different color modes, first part. 2012-01-24 21:36:46 +01:00
Pawel Kolodziejski 49b578ec6a put tinygl internals into namespace, left only api 2009-05-25 13:19:29 +00:00
Pawel Kolodziejski 110527019b make compilable after latest change 2009-05-08 07:32:33 +00:00
Pawel Kolodziejski f85c21fa4c moved tinygl 2009-05-08 07:17:43 +00:00