#Tiled texture smoothness

10 messages · Page 1 of 1 (latest)

winged comet
#

Hey! I'm wondering if I'm setting up a tiled texture correctly. I'm using a simple grid image and it's showing up a bit jagged and missing some lines.

I have a comparison image for Bevy versus Godot. I don't really know Godot, I just wanted a comparison point and threw together a similar setup.

Curious if the difference might come from some default settings I should be changing.

Here is the code for making the plane:

fn setup(
    mut commands: Commands,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<StandardMaterial>>,
    asset_server: Res<AssetServer>,
) {
    let mesh = Plane3d::new(Vec3::Y, Vec2::splat(10.));
    let mesh = meshes.add(mesh);

    let base_color_texture =
        asset_server.load_with_settings("grid.png", |settings: &mut ImageLoaderSettings| {
            settings.sampler = ImageSampler::Descriptor(ImageSamplerDescriptor {
                address_mode_u: ImageAddressMode::Repeat,
                address_mode_v: ImageAddressMode::Repeat,
                ..default()
            });
        });

    let material = StandardMaterial {
        base_color: Color::srgb_u8(158, 192, 219),
        base_color_texture: Some(base_color_texture),
        uv_transform: Affine2::from_scale(Vec2::splat(20.)),
        ..default()
    };
    let material = materials.add(material);

    let bundle = MaterialMeshBundle {
        mesh,
        material,
        ..default()
    };

    commands.spawn(bundle);
}

#

Here is the grid.png file as well

valid ridge
winged comet
#

Oh that is a bit better, thanks. I'm thinking to experiment with some of the antialiasing options as well.

valid ridge
#

I wonder if mipmaps would help here, I can't think of why else godot would look better

#

Can you try disabling mipmaps in the texture import settings in godot and see what it looks like?

winged comet
#

Wow nice call! Does Bevy have a way to generate mipmaps as well?

valid ridge
#

But yeah, generate mipmaps, and use a linear sampler, and you'll be fine