mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
Implement func_paletted shader
This commit is contained in:
parent
44c2223c2f
commit
865b7a1a2c
1 changed files with 14 additions and 0 deletions
|
@ -425,6 +425,20 @@ static void RunShader(int x0, int x1, PolyTriangleThreadData* thread)
|
|||
}*/
|
||||
return;
|
||||
}
|
||||
else if (thread->EffectState == SHADER_Paletted) // func_paletted
|
||||
{
|
||||
int texWidth = thread->textures[0].width;
|
||||
int texHeight = thread->textures[0].height;
|
||||
const void* texPixels = thread->textures[0].pixels;
|
||||
bool texBgra = thread->textures[0].bgra;
|
||||
|
||||
const uint32_t* lut = (const uint32_t*)thread->textures[1].pixels;
|
||||
|
||||
for (int x = x0; x < x1; x++)
|
||||
{
|
||||
fragcolor[x] = lut[RPART(sampleTexture(u[x], v[x], texPixels, texWidth, texHeight, texBgra))] | 0xff000000;
|
||||
}
|
||||
}
|
||||
else if (thread->EffectState == SHADER_NoTexture) // func_notexture
|
||||
{
|
||||
uint32_t a = (int)(streamdata.uObjectColor.a * 255.0f);
|
||||
|
|
Loading…
Reference in a new issue