 vec3 Q(vec3 p)
 {
   vec3 a,b,c,h,i,j;
-  h=m*p;
-  i=m*h*3.;
-  j=m*i*3.;
+  h = noise_matrix * p;
+  i = noise_matrix * h * 3.0;
+  j = noise_matrix * i * 3.0;
   a = (texture(noise_volume, h).xyz - 0.5) * 2.0 * 0.6;
   b = (texture(noise_volume, i).xyz - 0.5) * 2.0 * 0.3;
   c = (texture(noise_volume, j).xyz - 0.5) * 2.0 * 0.1;

  else
  {
#if defined(USE_LD)
    h=m*p*scales[0].x;
    i=m*h*scales[0].y;
    j=m*i*scales[0].z;
    k=m*j*scales[0].w;
    a = texture(surface_texture, h.xz).x * scales[1].x;
    b = texture(surface_texture, i.xz).x * scales[1].y;
    c = texture(surface_texture, j.xz).x * scales[1].z;
    r = texture(surface_texture, k.xz).x * scales[1].w;
#else
    h=m*p*.007;
    i=m*h*2.61;
    j=m*i*2.11;
    k=m*j*2.11;
    a = texture(surface_texture, h.xz).x * 2.61;
    b = texture(surface_texture, i.xz).x * 1.77;
    c = texture(surface_texture, j.xz).x * 0.11;

layout(location=1)uniform sampler3D noise_volume;
layout(location=2)uniform vec3[10] uniform_array;
#if defined(USE_LD)
layout(location=19)uniform mat3 noise_matrix;
layout(location=22)uniform vec4[3] scales;
layout(location=25)uniform vec3 aspect;
#else
mat3 noise_matrix = mat3(0.42, -0.7, 0.58, 0.53, 0.71, 0.46, -0.74, 0.12, 0.67);
#endif
out vec4 output_color;

vec4 march_params = vec4(0.3, 0.0, 0.7, 0.009);
vec3 L=normalize(vec3(2.,.5,-1.));
