- use separate textures for the palswap shade tables.

This creates a lot less mess than one big texture and also allows easier use of texelFetch in the server which is preferable for data textures.
This commit is contained in:
Christoph Oelckers 2019-10-08 01:08:08 +02:00
parent 06e9a60190
commit 7131fe6c6e
8 changed files with 37 additions and 71 deletions

View file

@ -441,10 +441,7 @@ void GLInstance::SetPalette(int index)
void GLInstance::SetPalswap(int index)
{
float v1 = index * renderState.PalswapSize[0];
float v2 = floorf(v1);
renderState.PalswapPos[0] = v1 - v2 + (0.5f / PALSWAP_TEXTURE_SIZE);
renderState.PalswapPos[1] = v2 * renderState.PalswapSize[1] + (0.5f / PALSWAP_TEXTURE_SIZE);
palmanager.BindPalswap(index);
}
@ -466,9 +463,6 @@ void PolymostRenderState::Apply(PolymostShader* shader)
shader->Brightness.Set(Brightness);
shader->Fog.Set(Fog);
shader->FogColor.Set(FogColor);
shader->PalswapPos.Set(PalswapPos);
shader->PalswapSize.Set(PalswapSize);
shader->PalswapIndex.Set(PalSwapIndex);
}