Bump map looks ok on phong material, has stair step effect on physical material

BTW: There will be a breaking change in r158 in context of bump maps. Please read the following PR for more information:

The migration task is easy though. Updating bumpScale to a different (higher) value is sufficient.

2 Likes

I heard of this too. When searching for free assets online, I found one I liked and it only had only a bump map. I tried some assets with normal maps, but I couldn’t get them to look as good (pronounced depth) but maybe it was just assets I that I found at the time.

That’s interesting! After some tweaks to your demo, your adjusted bump map is in fact able to make the wall rougher and more bumpy:


I have a question though: shouldn’t the bump scale effectively achieve the same thing you did manually scaling the image asset?


I still wonder what it is about the original demo in my OP that avoids stair steps while allowing high bump depth. :thinking: Let me see if I can export the scene as plain Three.js, and codepen it…

1 Like

It is scale + blur. The blur introduces new intermediate levels, that were not present at the beginning.

2 Likes

Ah, that makes sense. So the original bump map limited its data to a subset of the range of available values, which I’m imagining is not very many bits for the range of all its data. (Still curious how my original example avoided the issue though, but I’ll have to circle back to that a little later)

1 Like

Interesting, never used that before. I wasn’t able to find a Three.js demo (looks like older examples had one, but now removed).

I found this plain webgl demo:

Here’s an r3f demo on three r126:

But it gets a bit funky/artefacty when the “wall” is at more of an angle. It’s also just a webgl-demo wrapped in Three (ShaderMaterial), not really useful without the rest of Three’s material system.

I’m guessing there’s a reason this isn’t in Three core.

Maybe it is more useful as a composable node material for WebGPURenderer? But node materials are not easy to modify last I tried.

1 Like

Parallax mapping is a bit of a hack:
(not that that is bad or unusable but can be confusing if someone expecting it to behave “correctly”)