We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

[SOLVED] Switching between materials with normal map flickering

Home Forums Graphics / Blender [SOLVED] Switching between materials with normal map flickering

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #46407
    hulpesergiu
    Participant

    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.

    https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:44097fd654/ext/02_Verge3d/TestNormals/TestNormals.html

    Attachments:
    You must be logged in to view attached files.
    #46410
    xeon
    Customer

    Could 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.com

    #46411
    xeon
    Customer

    Just 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.com

    #46412
    xeon
    Customer

    Ok… 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.html

    online project with blend file:
    https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:184ff32db5/zip/test_normal_map_swap.zip

    clicking 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.com

    #46416
    hulpesergiu
    Participant

    Hey 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

    #46417
    xeon
    Customer

    Glad 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.