Wile94
Member
Hi, so basically I'm testing the code from this video:
In the create event I have something like this:
In the begin step event I update my v_normal if the row index is changed
Then on the draw event this:
This is the fragment shader code:
Then I have my "bg_palette" with a size of 256x256 and checked with "Used for 3D"
Everything works great until I set the game in fullscreen, then my palettes gets all glitchy like it's getting a color value between 2 positions in the texture uvs. I tried working this out by changing the texture_set_interpolation code inside the draw event, this makes it work but my global interpolation gets deactivated and all the images in the view gets glitchy and sharp, basically loses anykind of antialiasing.
Honestly I'm a noob related to shaders and gpu processing, so any kind of help will be appreciated. I'm guessing that manually setting the interpolation for that specific sampler when setting the fullscreen(false/true) would end up having the same result.
PS: If I start the game in fullscreen this doesn't happen but when I switch to windowed mode it happens anway
In the create event I have something like this:
Code:
color_sets = 4;
color_row_index = 1;
v_offset = shader_get_uniform(shdr_palette_swap, "Offset");
v_normal = color_row_index/256;
palette_swap_sampler = shader_get_sampler_index(shdr_palette_swap, "Palette");
texture_palette = background_get_texture(bg_palette);
texture_set_interpolation_ext(palette_swap_sampler,false);
Then on the draw event this:
Code:
shader_set(shdr_palette_swap);
texture_set_stage(palette_swap_sampler, texture_palette);
shader_set_uniform_f(v_offset, v_normal);
draw_sprite_ext(anim[animNo],animFrame,x,y,animFacing,1,0,c_white,1);
shader_reset();
Code:
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
// Get palette as texture
uniform sampler2D Palette;
// Color Offset Index
uniform float Offset;
void main() {
vec4 ref = texture2D(gm_BaseTexture, v_vTexcoord);
vec2 uv_coord = vec2(ref.r, Offset);
vec4 new_color = texture2D(Palette, uv_coord);
gl_FragColor = new_color;
}
Everything works great until I set the game in fullscreen, then my palettes gets all glitchy like it's getting a color value between 2 positions in the texture uvs. I tried working this out by changing the texture_set_interpolation code inside the draw event, this makes it work but my global interpolation gets deactivated and all the images in the view gets glitchy and sharp, basically loses anykind of antialiasing.
Honestly I'm a noob related to shaders and gpu processing, so any kind of help will be appreciated. I'm guessing that manually setting the interpolation for that specific sampler when setting the fullscreen(false/true) would end up having the same result.
PS: If I start the game in fullscreen this doesn't happen but when I switch to windowed mode it happens anway
Last edited: