How to fix funky pixel scaling?

hi!
i am working on a pixel art isometric chess game, i wanted it to have a small resolution (kinda like pico8!)
the problem i’m facing is, even with integer mode scaling, the pixels ends up all funky


editor view


ingame view

as a example, the horse’s eye has doubled in width
image
image


screen config

godot 4.6

Did you set filter to nearest? You can do that in project settings or per node

yup, i did, mipmap nearest more specifically, and this is a 3D project with sprite3Ds so sadly i have to do it per node

I guess try a higher resolution and using nearest rather than nearest mip map since that does seem to be using some sort of compression like a mip map but somebody more experienced should fact check that

Yeah I mean something is compressing it so you could try this. Otherwise if you can’t find any fix you could try to add a shader such as a pixel perfect shader which would make it pretty well but that’s a last resort. Could you send your entire scene tree.

I’ve had similar issues, in my case it was because the position of the sprites resulted in the engine averaging two pixels during rendering

If you superimpose your two images, you can kinda see it

I solved it by setting my sprites at a specific pixel positions, and using the “billboard” mode, as well as keeping the scale


void vertex() {
	// Billboard Mode: Particles
	mat4 mat_world = mat4(
			normalize(INV_VIEW_MATRIX[0]),
			normalize(INV_VIEW_MATRIX[1]),
			normalize(INV_VIEW_MATRIX[2]),
			MODEL_MATRIX[3]);
	mat_world = mat_world * mat4(
			vec4(cos(INSTANCE_CUSTOM.x), -sin(INSTANCE_CUSTOM.x), 0.0, 0.0),
			vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0),
			vec4(0.0, 0.0, 1.0, 0.0),
			vec4(0.0, 0.0, 0.0, 1.0));
	MODELVIEW_MATRIX = VIEW_MATRIX * mat_world;

	// Billboard Keep Scale: Enabled
	MODELVIEW_MATRIX = MODELVIEW_MATRIX * mat4(
			vec4(length(MODEL_MATRIX[0].xyz), 0.0, 0.0, 0.0),
			vec4(0.0, length(MODEL_MATRIX[1].xyz), 0.0, 0.0),
			vec4(0.0, 0.0, length(MODEL_MATRIX[2].xyz), 0.0),
			vec4(0.0, 0.0, 0.0, 1.0));

	MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX);


	// Fixed Size: Enabled
	if (PROJECTION_MATRIX[3][3] != 0.0) {
		// Orthogonal matrix; try to do about the same with viewport size.
		float h = abs(1.0 / (2.0 * PROJECTION_MATRIX[1][1]));
		// Consistent with vertical FOV (Keep Height).
		float sc = (h * 2.0);
		MODELVIEW_MATRIX[0] *= sc;
		MODELVIEW_MATRIX[1] *= sc;
		MODELVIEW_MATRIX[2] *= sc;
	} else {
		// Scale by depth.
		float sc = -(MODELVIEW_MATRIX)[3].z;
		MODELVIEW_MATRIX[0] *= sc;
		MODELVIEW_MATRIX[1] *= sc;
		MODELVIEW_MATRIX[2] *= sc;
	}
}

This was my shader code

Hope this helps!

oh yeah sure, sorry for late reply, i ended up skipping over the “send scene tree” part…
in editor

in-game

and more and more sprite3Ds for each piece…