fragment.fs 443 B

12345678910111213141516171819
  1. #version 430
  2. layout (binding = 0) uniform sampler3D noiseSamp;
  3. layout (binding = 1) uniform sampler3D textureSamp;
  4. uniform float height;
  5. in vec3 varTextureG;
  6. in vec3 varNormalG;
  7. out vec4 color;
  8. const vec3 light = vec3(-0.746, -0.373, -0.224);
  9. void main(void) {
  10. vec3 f = texture(textureSamp, (varTextureG + vec3(0.0, height, 0.0)) * 8.0).xyz;
  11. float l = max(dot(light, varNormalG), 0.0) * 0.7 + 0.3;
  12. color = vec4(f * l, 1.0);
  13. }