* load all but the first mip-map tiles as 1D texture atlas, that is array of texels.
all tiles loaded as rgba32.
first 8 texels contain information about tile's width, height and offset, 1 texel per tile.
* mipmap shader corrected to fetch texels from the atlas.
All hacks, which were necessary to load N64 mip-maps into OpenGL texture are removed.
tile tmem address can be set to a value greater than 512, that is above TMEM size.
It should be used with proper mask for tileTmemInBytes calculation.
Fixed#2360 Castlevania 64 Crash
calculated texture size in bytes can be too large to fit TMEM.
It leads to out-of-bounds reads in checksum calculations and thus random checksum.
Example:
Fixed Unplayable performance with any kind of texture enhancement. #2279
Stunt Racer uses combiner with two textures for track polygons, but actually loads only T0.
T1 replaced by T0 because of LOD flags in othermode.
This situation was not checked in the main code and ClampWrapMirror shader got wrong parameters,
which lead to the glitches.
- use RiceVideo method for texture size calculation.
RiceVideo uses the same method for texture dumping.
- rewrite texture mapping.
Texture Clamp-Wrap-Mirror implemented in shaders.
Problem explanation:
https://github.com/gonetz/GLideN64/issues/1885#issuecomment-485136358
Fixed various glitches with HD textures, #1885
BgCopy set dimensions for tile0 to zero.
We can't use dimensions of load tile either because of CopyBlock.
The only way to find size of loaded texture is to use coordinates of texrect.
There is one-to-one correspondence between rect pixels and texture texels in copy mode,
so we can safely use it in this case.
masks and maskt set by gDPSetTile, but _calcTileSizes may change them if actual
tile dimension do not correspond the mask. This creates problem for S2DEX_BG_1Cyc command,
which set tile masks and maskt to maximum, while actual size of loaded tiles may vary.
_calcTileSizes may set new values for masks and maskt, which are valid for the current tile but invalid for next ones.
Thus, original values of tile masks and maskt must be restored when tile size calculated again in _calcTileSizes.
-Fix cut off textures in hamster64. Enable coord correction if
gDP.otherMode.textureFilter == G_TF_BILERP.
-Fix seams in hamster64 and texture fragments in starcraft64. Enable
texture clamp if lrs/lrt <= (imageW/imageH - 1).