Dealt with indentations, split comment over multiple lines.
@@ -113,7 +113,11 @@ void main() {
vec2 viewDirectionUvProjection = -normalizedViewPos * uvToView;
float height = parallaxScale * texture2D(textureAtlasHeight, texCoord).r - parallaxBias;
- //Ideally this should be divided by dot(normal, normalizedViewPos), as the offset for texCoord is the component parallel to the surface of a vector along the view's forward axis, the other component being a vector perpendicular to the surface and having magnitude "height". In practice the current way looks better at low angles, as the height-map can't make the triangle protrude beyond its boundaries like displacement mapping would.
+ // Ideally this should be divided by dot(normal, normalizedViewPos), as the offset for texCoord
+ // is the component parallel to the surface of a vector along the view's forward axis,
+ // the other component being a vector perpendicular to the surface and having magnitude "height".
+ // In practice the current way looks better at low angles, as the height-map can't make the triangle
+ // protrude beyond its boundaries like displacement mapping would.
texCoord += height * viewDirectionUvProjection * TEXTURE_OFFSET;
//Crudely prevent the parallax from extending to other textures in the same atlas.
