// ----- Vertex Shader ----- #version 330 core layout(location = 0) in vec3 position; uniform mat4 projection; uniform mat4 model; void main(){ gl_Position = projection * model * vec4(position,1); } // ----- Fragment Shader ----- #version 330 core uniform vec2 resolution; uniform float time; out vec3 color; #define MAX_STEPS 100 #define MAX_DIST 100. #define SURF_DIST .01 float GetDist(vec3 p) { vec4 s = vec4(0, 1, 6, 1); float sphereDist = length(p-s.xyz)-s.w; float planeDist = p.y; float d = min(sphereDist, planeDist); return d; } float RayMarch(vec3 ro, vec3 rd) { float dO=0.; for(int i=0; iMAX_DIST || dS