Some questions about material plugin custom shader to change position.y

Now I have another problem, this may require a new topic, when I use the same material plugin to operate on the ground material, changing some of the position offset parameters shows a different effect. Can someone help me figure this out?
You can swap comment lines to see the correct effect

To perpetuate the problem

I wanted it to look like this, but when I changed the parameters I got the following effect. I’m not sure what’s going on in the shader, but the texture used is the same and the height shouldn’t change so drastically.

An error occurred in the height calculation. When I set the Y value of line 119 to a constant, it appears normal, but I can’t find the problem that was caused by that step.

I replaced it with a more friendly texture image, which should better express the cause of the problem.

The problem lies in the texture image, and it is found that there is a color transition at the color boundary, and the r value is close to 0 during the transition, so the obtained y value will be close to 0.

I did not store the decimal place in the alpha channel when generating the texture image, and judged the alpha value in the shader, and then operated on the vertex when it was equal to 1.

1 Like