mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-18 22:36:27 +01:00
fix scaling issue
This commit is contained in:
parent
8d14854b4e
commit
3821633dd3
@ -25,13 +25,13 @@ void main(void) {
|
||||
{
|
||||
if(channel == 0)
|
||||
{
|
||||
adjusted = texture2D(lut, vec2(currentColor.r, 0.5));
|
||||
adjusted = texture2D(lut, vec2((currentColor.r * 255.0 + 0.5) / 256.0, 0.5));
|
||||
} else if(channel == 1) {
|
||||
adjusted = texture2D(lut, vec2(currentColor.g, 0.5));
|
||||
adjusted = texture2D(lut, vec2((currentColor.g * 255.0 + 0.5) / 256.0, 0.5));
|
||||
} else if(channel == 2) {
|
||||
adjusted = texture2D(lut, vec2(currentColor.b, 0.5));
|
||||
adjusted = texture2D(lut, vec2((currentColor.b * 255.0 + 0.5) / 256.0, 0.5));
|
||||
} else if(channel == 3) {
|
||||
adjusted = texture2D(lut, vec2(currentColor.a, 0.5));
|
||||
adjusted = texture2D(lut, vec2((currentColor.a * 255.0 + 0.5) / 256.0, 0.5));
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ export class PaletteMapFilter extends NitroFilter
|
||||
break;
|
||||
}
|
||||
|
||||
this._lut = NitroBasetexture.fromBuffer(Uint8Array.from(lut), lut.length / 4, 1);
|
||||
this._lut = NitroBasetexture.fromBuffer(Uint8Array.from(lut), lut.length / 4, 1, { mipmap: 0, scaleMode: 0 });
|
||||
|
||||
this.uniforms.lut = this._lut;
|
||||
this.uniforms.channel = this._channel;
|
||||
|
Loading…
Reference in New Issue
Block a user