Vertex Shader Aligning

Godot Version

4.2.1

Question

I was trying to recreate the ‘rolling log’ effect from Animal Crossing. Where the world bends around like you are on a small planet. I managed to do it using a flat plane and a visual shader you can see here:

However my issue is that I wanted to add a multimeshinstance on top of it to put some grass onto the plane, but when I did that the grass is floating on the actual hitbox of the floor mesh and doesn’t bend down with it. I would put in more screenshots of this happening, but I am limited to 1 embed image per post :confused:

I sort of hacked together a solution by applying to same shader to the grass to bend it around like I did with the ground above but that seems very messy to me, and also gave somewhat inconsistent results. So is there an easier way to accomplish this, maybe with normals or something? Thanks all for the help in advance.

I think that is what you need to do with the material, what kind of inconsistent results are you getting?

I use a curve amount of 0.005 on the floor, but with the grass shader I can’t use the vertex input, so I use world space instead and the amount of 0.005 there does not equal out to the same curve. I have to up it to somehwere around 0.015 to get a similar looking curve.

Yeah, you’ll want to use World Space on all of them to make it so all of the assets you ever want to follow that curved path to falloff in the same way. Any localized data whether it’s the mesh data or the actor data will make it a lot harder.

You might get some distortion on some things, like if you had a road with some light poles, you wouldn’t want them to stretch at the top, so then you’d want to get some more actor data and adjust the math. That is if needed.