0 votes

Hello, I am trying 3D stuff in Godot for the first time and using Zylann's terrain plugin to generate my terrain, using brushes in the editor. I am trying to access normal values of the terrain in my script because I want to detect terrain slope at some points. However, when I try to access normal map like this:

var normalmap = terrainData.get_image(HTerrainData.CHANNEL_NORMAL)

I get a null value as normalmap. I may calculate normal vector from sampling points from forward and right, but since terrain is reacting to light it should calculate normal values somewhere. I know it may calculate them in the shader on the fly, but I was wondering if there is a way for terrain node to calculate and store this normal map so I can access it later, or there is already a way and I am missing something?

Edit: I can access heightmap the same way without problems.

Godot version 3.3.2
in Engine by (98 points)
edited by

Please log in or register to answer this question.

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.