-
`The orientation of the UV coordinates of a mesh relative to the light have a very strong impact on how that light is rendered on the mesh which really feels incorrect to me. In the attached screen capture, I have rendered the same normal texture 4 ways, left to right, they are:
You will see that when the UV coordinates are rotated (the 2 on the right), it has a huge impact on the lighting which doesn't make sense and doesn't look correct given where the light is. Mesh 2 shows that rotating the texture map does not have a significant impact on lighting so why would rotating the UV coordinates have such an impact. I get the same results in 0.13.1 and 0.14.2. I would love to find out I am doing something wrong because trying to work around this in my application would be quite difficult. The textures are here: The code is below: use std::f32::consts::PI; #[cfg(feature = "wee_alloc")] #[wasm_bindgen] #[wasm_bindgen] fn build(width: f32, height: f32) { /// set up a simple 3D scene
} fn get_uv(rotateUVFlag: bool) -> Vec<[f32;2]> { fn create_mesh(tangentFlag: bool, rotateUVFlag: bool) -> Mesh {
} fn spawnLight(commands: &mut Commands, mut meshes: &mut ResMut<Assets>, } ` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, It looks like it's just down to non-normalised normal maps due to loading the normal maps as sRGB (which is the default). You can fix it like so: normal_map_texture: Some(asset_server.load_with_settings(
"Materials/TCom_Leather_Plain04_012x012_1K_normal.png",
|s: &mut ImageLoaderSettings| s.is_srgb = false,
)), There's a doc issue for this #12123. |
Beta Was this translation helpful? Give feedback.
Hi,
It looks like it's just down to non-normalised normal maps due to loading the normal maps as sRGB (which is the default).
You can fix it like so:
There's a doc issue for this #12123.