Commit Graph
15 Commits
Author SHA1 Message Date
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 bf319b5437 TINYGL: Cache and clip dirty rect on all DrawCall subclasses.
getDirtyRegion will be called twice on each DrawCall instance, so make
repeated work as short as possible.
2017-04-23 12:30:00 +00:00
Vincent Pelletier 112ca82363 TINYGL: Manage BlitImages with a refcount.
So that zdirtyrect can keep an image alive for longer than its creator
intended.
2016-07-28 23:32:43 +00:00
Stefano Musumeci 41737fcc21 TINYGL: Added/Updated license header in tinyGL files. 2014-08-16 16:03:54 +02:00
Stefano Musumeci 9e807696bc TINYGL: Minor style/formatting fixes. 2014-08-13 21:20:15 +02:00
Stefano Musumeci 92d8ecc34c TINYGL: Added depth test enabled state tracking to dirty rects. 2014-08-13 14:33:54 +02:00
Stefano Musumeci 8c13ef4c35 TINYGL: Added some comments to draw call classes. 2014-08-11 22:03:07 +02:00
Stefano Musumeci ca54fd848a TINYGL: Renamed member functions loadState to captureState. 2014-08-10 19:39:21 +02:00
Stefano Musumeci daa8394adb TINYGL: Moved DrawCallType enum inside DrawCall. 2014-08-10 19:37:26 +02:00
Stefano Musumeci c27be840ea TINYGL: Added not equality operator for GLVertex and DrawCall. 2014-08-09 12:34:26 +02:00
Stefano Musumeci d1b9585662 TINYGL: Fixed formatting. 2014-08-08 12:43:39 +02:00
Stefano Musumeci 83626dce94 TINYGL: Fixed code formatting. 2014-08-07 21:49:13 +02:00
Stefano Musumeci 10a3b9b0ce TINYGL: Replaced size_t with int 2014-08-07 21:48:38 +02:00
Stefano Musumeci 6cd062826b TINYGL: Renamed zrect in zdirty rect 2014-08-07 17:56:01 +02:00