Add everything.
Some checks failed
Build C++ Project with Fedora Container and Create Release / build (push) Has been cancelled

This commit is contained in:
2025-11-30 23:02:25 +01:00
commit ec1610443c
910 changed files with 425564 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
#version 330 core
out vec4 FragColor;
in vec3 FragPos;
in vec3 Normal;
in vec2 TexCoord;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform float mixAmount = 0.2;
uniform vec3 lightPos;
uniform vec3 viewPos;
uniform vec3 lightColor = vec3(1.0);
uniform float ambientStrength = 0.2;
uniform float specularStrength = 0.5;
uniform float shininess = 32.0;
void main()
{
vec3 norm = normalize(Normal);
vec3 lightDir = normalize(lightPos - FragPos);
vec3 viewDir = normalize(viewPos - FragPos);
// Ambient
vec3 ambient = ambientStrength * lightColor;
// Diffuse
float diff = max(dot(norm, lightDir), 0.0);
vec3 diffuse = diff * lightColor;
// Specular (Blinn-Phong)
vec3 halfwayDir = normalize(lightDir + viewDir);
float spec = pow(max(dot(norm, halfwayDir), 0.0), shininess);
vec3 specular = specularStrength * spec * lightColor;
// Texture mixing (corrected)
vec4 tex1 = texture(texture1, TexCoord);
vec4 tex2 = texture(texture2, TexCoord);
vec4 mixedTex = mix(tex1, tex2, mixAmount);
vec3 texColor = mixedTex.rgb;
vec3 result = (ambient + diffuse + specular) * texColor;
FragColor = vec4(result, mixedTex.a); // Preserve alpha if needed
}

View File

@@ -0,0 +1,98 @@
#version 330 core
out vec4 FragColor;
in vec3 fragPos;
uniform float timeOfDay; // 0..1 (0.0 = midnight)
float hash(vec3 p) {
p = fract(p * 0.3183099 + 0.1);
p *= 17.0;
return fract(p.x * p.y * p.z * (p.x + p.y + p.z));
}
vec3 getSkyColor(vec3 dir, float tod) {
float height = dir.y;
// Continuous rotation no midnight jump
float t = fract(tod);
float angle = t * 6.28318530718;
vec3 sunDir = normalize(vec3(cos(angle), sin(angle) * 0.5, sin(angle)));
float sunDot = max(dot(dir, sunDir), 0.0);
// Your original colors (unchanged)
vec3 nightTop = vec3(0.01, 0.01, 0.05);
vec3 nightHorizon = vec3(0.05, 0.05, 0.15);
vec3 dayTop = vec3(0.3, 0.5, 0.9);
vec3 dayHorizon = vec3(0.6, 0.7, 0.9);
vec3 sunriseTop = vec3(0.4, 0.3, 0.5);
vec3 sunriseHorizon= vec3(1.0, 0.5, 0.3);
vec3 sunsetTop = vec3(0.5, 0.3, 0.4);
vec3 sunsetHorizon = vec3(1.0, 0.4, 0.2);
// Same 4-phase interpolation as you had
vec3 skyTop, skyHorizon;
if (t < 0.25) {
float f = t * 4.0;
skyTop = mix(nightTop, sunriseTop, f);
skyHorizon = mix(nightHorizon, sunriseHorizon, f);
} else if (t < 0.5) {
float f = (t-0.25)*4.0;
skyTop = mix(sunriseTop, dayTop, f);
skyHorizon = mix(sunriseHorizon, dayHorizon, f);
} else if (t < 0.75) {
float f = (t-0.5)*4.0;
skyTop = mix(dayTop, sunsetTop, f);
skyHorizon = mix(dayHorizon, sunsetHorizon, f);
} else {
float f = (t-0.75)*4.0;
skyTop = mix(sunsetTop, nightTop, f);
skyHorizon = mix(sunsetHorizon, nightHorizon, f);
}
vec3 skyColor = mix(skyHorizon, skyTop, smoothstep(-0.3, 0.3, height));
// Sun (exactly like yours)
vec3 sunCol = vec3(1.0, 0.95, 0.8);
float sunGlow = pow(sunDot, 128.0) * 2.0;
float sunDisc = smoothstep(0.9995, 0.9998, sunDot);
float atmGlow = pow(sunDot, 8.0) * 0.5;
float sunVisibility = smoothstep(-0.12, 0.15, sunDir.y); // smooth fade in/out
skyColor += sunCol * (sunDisc + atmGlow + sunGlow*0.3) * sunVisibility;
// ——— STARS: now actually visible and pretty ———
float night = 1.0 - sunVisibility;
if (night > 0.0) {
vec3 p = dir * 160.0; // denser grid
vec3 i = floor(p);
vec3 f = fract(p);
float stars = 0.0;
for (int z=-1; z<=1; z++)
for (int y=-1; y<=1; y++)
for (int x=-1; x<=1; x++) {
vec3 o = vec3(x,y,z);
vec3 pos = i + o;
float h = hash(pos);
if (h > 0.99) { // only the brightest 1%
vec3 center = o + 0.5 + (hash(pos+vec3(7,13,21))-0.5)*0.8;
float d = length(f - center);
float star = 1.0 - smoothstep(0.0, 0.12, d); // tiny sharp dot
star *= (h - 0.99)*100.0; // brightness variation
stars += star;
}
}
stars = pow(stars, 1.4);
stars *= night;
stars *= smoothstep(-0.1, 0.25, height); // fade near horizon
skyColor += vec3(1.0, 0.95, 0.9) * stars * 2.5;
}
return skyColor;
}
void main() {
vec3 dir = normalize(fragPos);
vec3 col = getSkyColor(dir, timeOfDay);
FragColor = vec4(col, 1.0);
}

View File

@@ -0,0 +1,14 @@
#version 330 core
layout (location = 0) in vec3 aPos;
out vec3 fragPos;
uniform mat4 projection;
uniform mat4 view;
void main()
{
fragPos = aPos;
vec4 pos = projection * view * vec4(aPos, 1.0);
gl_Position = pos.xyww; // Trick to ensure skybox depth is always 1.0 (furthest)
}

View File

@@ -0,0 +1,20 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aNormal;
layout (location = 2) in vec2 aTexCoord;
out vec3 FragPos;
out vec3 Normal;
out vec2 TexCoord;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
void main()
{
FragPos = vec3(model * vec4(aPos, 1.0));
Normal = mat3(transpose(inverse(model))) * aNormal;
TexCoord = aTexCoord;
gl_Position = projection * view * vec4(FragPos, 1.0);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

BIN
Resources/Textures/wall.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

67
Resources/imgui.ini Normal file
View File

@@ -0,0 +1,67 @@
[Window][Debug##Default]
Pos=60,60
Size=400,400
Collapsed=0
[Window][Modularity - Project Launcher]
Pos=569,288
Size=720,480
Collapsed=0
[Window][New Project]
Pos=679,403
Size=500,250
Collapsed=0
[Window][DockSpace]
Pos=0,21
Size=1858,1036
Collapsed=0
[Window][Viewport]
Pos=307,42
Size=1202,792
Collapsed=0
DockId=0x00000002,0
[Window][Hierarchy]
Pos=0,42
Size=305,792
Collapsed=0
DockId=0x00000001,0
[Window][Inspector]
Pos=1511,42
Size=347,1015
Collapsed=0
DockId=0x00000008,0
[Window][File Browser]
Pos=787,836
Size=722,221
Collapsed=0
DockId=0x00000006,0
[Window][Console]
Pos=0,836
Size=785,221
Collapsed=0
DockId=0x00000005,0
[Window][Project]
Pos=787,836
Size=722,221
Collapsed=0
DockId=0x00000006,1
[Docking][Data]
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,42 Size=1858,1015 Split=X Selected=0xC450F867
DockNode ID=0x00000007 Parent=0xCCBD8CF7 SizeRef=1509,1015 Split=Y
DockNode ID=0x00000003 Parent=0x00000007 SizeRef=1858,792 Split=X
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=305,1015 Selected=0xBABDAE5E
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=1202,1015 CentralNode=1 Selected=0xC450F867
DockNode ID=0x00000004 Parent=0x00000007 SizeRef=1858,221 Split=X Selected=0xEA83D666
DockNode ID=0x00000005 Parent=0x00000004 SizeRef=785,221 Selected=0xEA83D666
DockNode ID=0x00000006 Parent=0x00000004 SizeRef=722,221 Selected=0x9C21DE82
DockNode ID=0x00000008 Parent=0xCCBD8CF7 SizeRef=347,1015 Selected=0x36DC96AB