Calculating normals on the GPU for procedural terrain

Описание к видео Calculating normals on the GPU for procedural terrain

Only 6 months later...
How to calculate normals on a displaced plane using a spatial shader in Godot 4. This video will show you to do this using the plane's vertices or using pixels from a height map texture.

This video builds on two previous videos, but they are not required to understand what is going in this here.
   • Massive Infinite TERRAIN that Generat...  
   • Massive Infinite Terrain that Generat...  

Normal Vector to Normalmap pixel function:

vec3 to_normalmap(vec3 n){
n*=vec3(1.0,1.0,-1.0);
n = n/2.0+0.5;
n = vec3(n.x,n.z,n.y);
return n;
}

Комментарии

Информация по комментариям в разработке