Why does fragment shader quality decrease on vertex displacement?

Hi all,
why does the quality of the fragment output decrease, once i add some displacement in the vertex shader?

to demonstrate my problem i made the following simple shader in the nme:



  • a simple cellular noise map serves as fragment output
  • the same noise is used to change the vertex position along its normal for an animated displacement


if I set the displacement to any value, the resulting fragment shader looks like being overwritten by vertex color or something (very low res) (marked as 1)


if I completely ignore the vertex shader, my cellular noise is pretty and high res (marked as 2)

why does this happen?
how can i keep the high resolution on a displaced mesh?


hi. I dont know why but for displacement you need increace polygons count of your mesh https://playground.babylonjs.com/#9BKDIN#7

Yup, definitely a precision issue. so increasing sub div adds more points and increase the rendered “precision”.

thank you two,
I found another solution which decouples geometry detail from color detail


i duplicated the whorley noise node and used this second one as the fragment input. you can see that i now have my low poly icosphere (16 subdivs instead of 256 subdivs) with full resolution colors.

But i dont understand why I need that second whorley noise node, (which should generate the exact same values as the first one.)

1 Like


1 Like