Repository: bevyengine/bevy
File: examples/3d/solari.rs (Rust)

Code before:
    }
    let plane_mesh = meshes.add(plane_mesh);
    let cube_mesh = meshes.add(
        Cuboid::default()
            .mesh()
            .build()
            .with_generated_tangents()
            .unwrap(),
    );
    let sphere_mesh = meshes.add(
        Sphere::default()
            .mesh()
            .build()
            .with_generated_tangents()
            .unwrap(),
    );

    commands
        .spawn((
            RaytracingMesh3d(plane_mesh.clone()),
            MeshMaterial3d(materials.add(StandardMaterial {
                base_color_texture: Some(
                    asset_server.load_with_settings::<Image, ImageLoaderSettings>(
                        "textures/uv_checker_bw.png",
                        |settings| {
                            settings.sampler = ImageSampler::Descriptor(ImageSamplerDescriptor {
                                address_mode_u: ImageAddressMode::Repeat,
                                address_mode_v: ImageAddressMode::Repeat,
                                ..default()
                            });
                        },
                    ),
                ),
                perceptual_roughness: 0.0,
                ..default()
            })),
        ))
        .insert_if(Mesh3d(plane_mesh), || args.pathtracer != Some(true));

    for _ in 0..200 {
        commands
            .spawn((
                RaytracingMesh3d(cube_mesh.clone()),
                MeshMaterial3d(materials.add(StandardMaterial {
                    base_color: Color::srgb(rng.random(), rng.random(), rng.random()),
                    perceptual_roughness: rng.random(),
                    ..default()
                })),
                Transform::default()
                    .with_scale(Vec3 {
                        x: rng.random_range(0.2..=2.0),

Review comment (suggestion):
should be able to use `.set_address_mode(ImageAddressMode::Repeat)` here, from https://github.com/bevyengine/bevy/pull/22042



Code after:
    }
    let plane_mesh = meshes.add(plane_mesh);
    let cube_mesh = meshes.add(
        Cuboid::default()
            .mesh()
            .build()
            .with_generated_tangents()
            .unwrap(),
    );
    let sphere_mesh = meshes.add(
        Sphere::default()
            .mesh()
            .build()
            .with_generated_tangents()
            .unwrap(),
    );

    commands
        .spawn((
            RaytracingMesh3d(plane_mesh.clone()),
            MeshMaterial3d(materials.add(StandardMaterial {
                base_color_texture: Some(
                    asset_server.load_with_settings::<Image, ImageLoaderSettings>(
                        "textures/uv_checker_bw.png",
                        |settings| {
                            settings
                                .sampler
                                .get_or_init_descriptor()
                                .set_address_mode(ImageAddressMode::Repeat);
                        },
                    ),
                ),
                perceptual_roughness: 0.0,
                ..default()
            })),
        ))
        .insert_if(Mesh3d(plane_mesh), || args.pathtracer != Some(true));

    for _ in 0..200 {
        commands
            .spawn((
                RaytracingMesh3d(cube_mesh.clone()),
                MeshMaterial3d(materials.add(StandardMaterial {
                    base_color: Color::srgb(rng.random(), rng.random(), rng.random()),
                    perceptual_roughness: rng.random(),
                    ..default()
                })),
                Transform::default()
                    .with_scale(Vec3 {
                        x: rng.random_range(0.2..=2.0),
                        y: rng.random_range(0.2..=2.0),