Jump to content

[solved] PBRMaterial something wrong with bump-level?


javalang
 Share

Recommended Posts

Hi there,

I did some comparison between StandardMaterial and PBRMaterial and found an odd effect with the level of the bumpTexture : setting this level to one, both materials have near the same "bump-amplitude" but lowering this value to zero seems to have no effect on the PBRMaterial, see playground.

Any ideas, bug?

Link to comment
Share on other sites

In the pbr material the normal map level is used to scale only the xy coordinates as it is defined in gltf and thanks to you I figured an issue in the scale code, the fix should be in soon but will still be different from the standard one so I will also add a parameter to help you scale bump like the standard material.

        vec3 map = texture2D(bumpSampler, uv).xyz;
        map.x = vNormalReoderParams.x + vNormalReoderParams.y * map.x;
        map.y = vNormalReoderParams.z + vNormalReoderParams.w * map.y;
 
        #ifdef NORMALXYSCALE
            map = normalize(map * vec3(vBumpInfos.y, vBumpInfos.y, 1.0));
        #endif
 
 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...