How can I calculate the normals in a spatial shader?

You misunderstood. You see, I was working with a wold bending shader. That is, a shader that modifies a vertex y value according to the distance to the camera to simulate a curvature, like in Animal Crossing.

But, I ran into the problem of interiors and exteriors. That is, inside a building I don't want the world bending effect. But, as a programmer, I'm lazy, and I didn't want to write two shaders for my objects, one for when they're outside and bend, and another for when they're inside and don't.

This question was about how to minimize the workload by using two separate vertex shaders, one for inside and one for outside. I wanted to avoid if when possible. I hope this clears it up.

/r/godot Thread Parent