#Seams on spherical texture

8 messages · Page 1 of 1 (latest)

faint garnet
#

Hi, I am creating a sphere with a texture but I end up with it having a very ugly seams. Is the way I implement it wrong or is it a bug? Note that the texture in use is 4096 x 2048.

let sphere_handle = meshes.add(
    Mesh::try_from(shape::Icosphere {
        radius: 10.0,
        ..default()
    })
    .unwrap(),
);

let jupiter_handle: Handle<Image> = asset_server.load("textures/jupiter.jpg");

let material_handle = materials.add(StandardMaterial {
    base_color_texture: Some(jupiter_handle),
    reflectance: 0.02,
    unlit: false,
    ..default()
});

// Sphere
commands.spawn((PbrBundle {
    mesh: sphere_handle,
    material: material_handle,
    ..default()
},));
bleak silo
#

Have you tried using a UVSphere over an Icospherre?

faint garnet
#

Thanks. Using UVSphere removes the seams. Do I need a different texture dimension to work with Icosphere?

bleak silo
#

afaik the seams on UVSphere are at the poles + a single arc going from the south to north pole, so they are less visible, but still exist.

#

It's because the UVSphere is a bunch of squares on a grid of latitude and longitudes, while the Icosphere is a bunch of triangles. Icosphere has a better silhouette for less triangles, but it's more difficult to map a texture on them.

faint garnet
#

Now that you mention it I can see the seams on the poles. But this is totally acceptable. For those who are interested, UVSphere uses Z axis as the up direction.

peak hill
#

from what i've read, custom shaders that use smoothstep to blend out at the poles is how you get rid of seems, how thats actually implemented... no idea im not good at math, but smoothstep apparently solves everything from the 100 videos ive watched lol

radiant heath
#

@faint garnet track [bevyengine/bevy] Pull request opened: #8717 Make UVSphere 3d shape use Y-up convention