0 votes

Switching on 'As Normal Map' for a noise texture in the inspector turns said noise into a normal map by calculating bump from the texture.

Question: how do I recreate this in the shader code or in visual shader?

Godot version 4.0
in Engine by (478 points)

1 Answer

0 votes

I don't know of a built in function, but the basic idea is to sample a height map at least times (north, south, east, and west of the current sample point) and use the difference between those samples to create normals:

Generating a normal map from a height map

by (272 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.