Home › Forums › Graphics / Blender › [SOLVED] Switching between materials with normal map flickering
- This topic has 5 replies, 2 voices, and was last updated 3 years ago by xeon.
-
AuthorPosts
-
2021-10-24 at 12:50 pm #46407hulpesergiuParticipant
Hi Guys!
Doing some tests with Verge3D to see if it’s feasible to replace a custom babylon.JS workflow which is too complicated for quick small projects.
I noticed it’s not possible to assign a new material to an object if that material uses a normal map. It will cause the object to have incorrect shading and flicker, especially if moving the mouse outside of the browser window.
The new material is very simple, I attached a preview below.
Also here is a link to a test scene, it’s just the template Verge3d project, with an added icosphere. If you click the icosphere, the material on the cube will change.
Attachments:
You must be logged in to view attached files.2021-10-24 at 3:43 pm #46410xeonCustomerCould you upload your scene? I would like to see if I can isolate the issue.
On my iPhone I do not get any flickering but also do not see any representation of a normal map. I will test on a desktop shortly.
Have you tried this without the normal map shader mode?
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2021-10-24 at 3:52 pm #46411xeonCustomerJust another thought when using the normal map node. Might want to try the below.
From blender docs
“For tangent space normal maps, the UV coordinates for the image must match, and the image texture should be set to Non-Color mode to give correct results.
https://docs.blender.org/manual/en/latest/render/shader_nodes/vector/normal_map.html
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2021-10-24 at 4:54 pm #46412xeonCustomerOk… so switching materials when you have a normal requires that both materials have a normal.
Links to test scene with two red and two blue ico spheres.
online test application
https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:184ff32db5/applications/test_normal_map_swap/test_normal_map_swap.htmlonline project with blend file:
https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:184ff32db5/zip/test_normal_map_swap.zipclicking on a blue ico sphere will change the materials with the associated red ico shpere.
I used your texture as the source for each blue ico sphere.
In the top example…much like the default verge3d cube, there is no normal map assigned to the target material. In this case, only the color information comes over. The normal map has nowhere to be placed and is left out. On desktop, this is working but on iPhone the missing normal node causes the render of the red ico sphere to turn black.
In the lower example, both the blue and red ico spheres have normal maps in their materials. When clicked the result is as expected.- everything works.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2021-10-25 at 3:49 am #46416hulpesergiuParticipantHey Xeon! OMG, I’ve spend a couple of hours trying to figure this out, trying different UV maps, and settings for normal map, and nothing worked.
This actually fixes it! Thank you so much
2021-10-25 at 4:20 am #46417xeonCustomerGlad that worked out for you! If you have a chance please edit the title of the post to “[SOLVED] Switching between materials with normal map flickering”.
Thank X.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com -
AuthorPosts
- You must be logged in to reply to this topic.