shader

GLSL shaders: black dots

Recall our previous post about stretched terrain bug in the game. Shader that fixed the problem gave although an unpleasant bug in the form of many black dots with newer graphic drivers. The black dots are usually a result of a NAN error (not a number) and normally related to bad geometry, a bad shader, light or camera.

Triplanar terrain texturing with GLSL

Stretched textures on vertical triangles is one of a million possible bugs when texturing terrain with shaders. To fix it we need to recalculate texture coordinates in 3 projections: x, y and z.