Skip to content

Commit d672e0c

Browse files
added pastel colors, used checkerboard shader indtead of texture, swapped to default shader
1 parent 095229a commit d672e0c

File tree

15 files changed

+190
-458
lines changed

15 files changed

+190
-458
lines changed

res/shaders/ground.fsh

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,26 @@ uniform bool hasTexture;
1515

1616
void main()
1717
{
18-
float ambientStrength = 0.5f;
19-
float specularStrength = 0.5f;
18+
float ambientStrength = 0.01f;
19+
float specularStrength = 0.01f;
2020

21-
// ambient
21+
// Lighting calculations
2222
vec3 ambient = ambientStrength * lightColor;
23-
24-
// diffuse
2523
vec3 norm = normalize(Normal);
2624
vec3 lightDir = normalize(lightPos - FragPos);
2725
float diff = max(dot(norm, lightDir), 0.0f);
2826
vec3 diffuse = diff * lightColor;
29-
30-
// specular
3127
vec3 viewDir = normalize(viewPos - FragPos);
3228
vec3 reflectDir = reflect(-lightDir, norm);
3329
float spec = pow(max(dot(viewDir, reflectDir), 0.0f), 32);
3430
vec3 specular = specularStrength * spec * lightColor;
3531

3632
vec3 result = (ambient + diffuse + specular) * objectColor;
37-
if (hasTexture)
38-
{
39-
vec4 texColor = texture(ourTexture, TexCoord);
40-
FragColor = texColor * vec4(result, 1.0f);
41-
}
42-
else
43-
{
44-
FragColor = vec4(result, 1.0f);
45-
}
33+
34+
// Checkerboard pattern
35+
float scale = 10.0; // Controls size of squares
36+
float checker = mod(floor(TexCoord.x * scale) + floor(TexCoord.y * scale), 2.0);
37+
vec3 checkerColor = mix(vec3(1.0), vec3(0.0), checker); // White and black
38+
39+
FragColor = vec4(checkerColor * result, 1.0);
4640
}

res/shaders/platform.fsh

Lines changed: 0 additions & 46 deletions
This file was deleted.

res/shaders/platform.vsh

Lines changed: 0 additions & 19 deletions
This file was deleted.

res/shaders/sphere.fsh

Lines changed: 0 additions & 46 deletions
This file was deleted.

res/shaders/sphere.vsh

Lines changed: 0 additions & 19 deletions
This file was deleted.

scenes/test_scene_1.yaml

Lines changed: 77 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,101 @@
11
scene:
22
name: Test Scene 1
33
objects:
4-
# # Platform
5-
# - name: Platform
6-
# position: [0.0, -0.5, 0.0]
7-
# rotationAxis: [0.0, 0.0, 1.0]
8-
# rotationDeg: 0.0
9-
# scale: [50.0, 0.5, 50.0]
10-
# shader: platform
11-
# mesh: cube
12-
# texture: ""
13-
# isStatic: true
14-
15-
# Ground
16-
- name: Ground
4+
- name: Surface
175
position: [0.0, 0.0, 0.0]
186
rotationAxis: [0.0, 0.0, 1.0]
197
rotationDeg: 180.0
208
scale: [1000.0, 1.0, 1000.0]
219
shader: ground
2210
mesh: surface
23-
texture: tile
11+
texture: ""
2412
color: [1.0, 1.0, 1.0]
2513
isStatic: true
2614

27-
# - name: Bunny
28-
# position: [0.0, 0.0, 0.0]
29-
# rotationAxis: [0.0, 1.0, 1.0]
30-
# rotationDeg: 0.0
31-
# scale: [100.0, 100.0, 100.0]
32-
# shader: sphere
33-
# mesh: bunny
34-
# texture: ""
35-
# color: [1.0, 1.0, 1.0]
36-
# isStatic: false
37-
3815
- name: Block
39-
position: [0.0, 1.0, 0.0]
16+
position: [0.0, 8.0, 0.0]
4017
rotationAxis: [0.7, 0.1, 0.6]
41-
rotationDeg: 0.0
18+
rotationDeg: 30.0
4219
scale: [1.0, 1.0, 1.0]
43-
shader: dirtblock
20+
shader: default
4421
mesh: cube
45-
texture: dirtblock
46-
color: [1.0, 1.0, 1.0]
22+
texture: ""
23+
color: [0.929, 0.443, 0.392]
4724
isStatic: false
4825

49-
# - name: Block
50-
# position: [2.9, 10.7, -8.3]
51-
# rotationAxis: [0.2, 0.8, 0.5]
52-
# rotationDeg: 33.0
53-
# scale: [1.0, 1.0, 1.0]
54-
# shader: dirtblock
55-
# mesh: cube
56-
# texture: dirtblock
57-
# color: [1.0, 1.0, 1.0]
58-
# isStatic: false
26+
- name: Block
27+
position: [2.9, 10.7, -8.3]
28+
rotationAxis: [0.2, 0.8, 0.5]
29+
rotationDeg: 33.0
30+
scale: [1.0, 1.0, 1.0]
31+
shader: default
32+
mesh: cube
33+
texture: ""
34+
color: [0.369, 0.471, 0.290]
35+
isStatic: false
5936

60-
# - name: Block
61-
# position: [-3.5, 13.9, 7.6]
62-
# rotationAxis: [0.5, 0.4, 0.7]
63-
# rotationDeg: 88.0
64-
# scale: [1.0, 1.0, 1.0]
65-
# shader: dirtblock
66-
# mesh: cube
67-
# texture: dirtblock
68-
# color: [1.0, 1.0, 1.0]
69-
# isStatic: false
37+
- name: Block
38+
position: [-3.5, 13.9, 7.6]
39+
rotationAxis: [0.5, 0.4, 0.7]
40+
rotationDeg: 88.0
41+
scale: [1.0, 1.0, 1.0]
42+
shader: default
43+
mesh: cube
44+
texture: ""
45+
color: [0.949, 0.757, 0.427]
46+
isStatic: false
7047

71-
# - name: Block
72-
# position: [7.1, 16.3, -6.2]
73-
# rotationAxis: [0.6, 0.3, 0.7]
74-
# rotationDeg: 54.0
75-
# scale: [1.0, 1.0, 1.0]
76-
# shader: dirtblock
77-
# mesh: cube
78-
# texture: dirtblock
79-
# color: [1.0, 1.0, 1.0]
80-
# isStatic: false
48+
- name: Block
49+
position: [7.1, 16.3, -6.2]
50+
rotationAxis: [0.6, 0.3, 0.7]
51+
rotationDeg: 54.0
52+
scale: [1.0, 1.0, 1.0]
53+
shader: default
54+
mesh: cube
55+
texture: ""
56+
color: [0.082, 0.365, 0.506]
57+
isStatic: false
8158

82-
# - name: Block
83-
# position: [-8.4, 14.8, 2.4]
84-
# rotationAxis: [0.4, 0.7, 0.5]
85-
# rotationDeg: 102.0
86-
# scale: [1.0, 1.0, 1.0]
87-
# shader: dirtblock
88-
# mesh: cube
89-
# texture: dirtblock
90-
# color: [1.0, 1.0, 1.0]
91-
# isStatic: false
59+
- name: Block
60+
position: [-8.4, 14.8, 2.4]
61+
rotationAxis: [0.4, 0.7, 0.5]
62+
rotationDeg: 102.0
63+
scale: [1.0, 1.0, 1.0]
64+
shader: default
65+
mesh: cube
66+
texture: ""
67+
color: [0.227, 0.220, 0.451]
68+
isStatic: false
9269

93-
# - name: Block
94-
# position: [5.7, 19.1, -1.9]
95-
# rotationAxis: [0.8, 0.2, 0.5]
96-
# rotationDeg: 76.0
97-
# scale: [1.0, 1.0, 1.0]
98-
# shader: dirtblock
99-
# mesh: cube
100-
# texture: dirtblock
101-
# color: [1.0, 1.0, 1.0]
102-
# isStatic: false
70+
- name: Block
71+
position: [5.7, 19.1, -1.9]
72+
rotationAxis: [0.8, 0.2, 0.5]
73+
rotationDeg: 76.0
74+
scale: [1.0, 1.0, 1.0]
75+
shader: default
76+
mesh: cube
77+
texture: ""
78+
color: [0.949, 0.757, 0.427]
79+
isStatic: false
10380

104-
# - name: Block
105-
# position: [-2.3, 11.6, 8.7]
106-
# rotationAxis: [0.6, 0.5, 0.6]
107-
# rotationDeg: 41.0
108-
# scale: [1.0, 1.0, 1.0]
109-
# shader: dirtblock
110-
# mesh: cube
111-
# texture: dirtblock
112-
# color: [1.0, 1.0, 1.0]
113-
# isStatic: false
81+
- name: Block
82+
position: [-2.3, 11.6, 8.7]
83+
rotationAxis: [0.6, 0.5, 0.6]
84+
rotationDeg: 41.0
85+
scale: [1.0, 1.0, 1.0]
86+
shader: default
87+
mesh: cube
88+
texture: ""
89+
color: [0.929, 0.443, 0.392]
90+
isStatic: false
11491

115-
# - name: Block
116-
# position: [1.5, 17.4, -9.0]
117-
# rotationAxis: [0.7, 0.3, 0.6]
118-
# rotationDeg: 95.0
119-
# scale: [1.0, 1.0, 1.0]
120-
# shader: dirtblock
121-
# mesh: cube
122-
# texture: dirtblock
123-
# color: [1.0, 1.0, 1.0]
124-
# isStatic: false
92+
- name: Block
93+
position: [1.5, 17.4, -9.0]
94+
rotationAxis: [0.7, 0.3, 0.6]
95+
rotationDeg: 95.0
96+
scale: [1.0, 1.0, 1.0]
97+
shader: default
98+
mesh: cube
99+
texture: ""
100+
color: [0.369, 0.471, 0.290]
101+
isStatic: false

0 commit comments

Comments
 (0)