Have 100 cubes flying around in a circle with refraction.

This commit is contained in:
Zed A. Shaw 2026-09-09 13:36:53 -04:00
parent 1107c86036
commit a199d41890
7 changed files with 29 additions and 15 deletions

View file

@ -1,11 +1,17 @@
#version 330 core
out vec4 FragColor;
in vec3 Normal;
in vec3 FragPos;
in vec2 TexCoords;
uniform sampler2D texture1;
uniform vec3 cameraPos;
uniform samplerCube skybox;
void main()
{
FragColor = texture(texture1, TexCoords);
float ratio = 1.0/1.52;
vec3 I = normalize(FragPos - cameraPos);
vec3 R = refract(I, normalize(Normal), ratio);
FragColor = vec4(texture(skybox, R).rgb, 1.0);
}