Whatcha doing fractional alpha

This commit is contained in:
ScorpionX90
2025-09-10 11:17:27 +02:00
parent 5521fe6aca
commit babcacd735
2 changed files with 23 additions and 44 deletions

View File

@@ -7,6 +7,5 @@ uint gridSize = 200;
void main()
{
float col = (int(gl_FragCoord.y) / gridSize + int(gl_FragCoord.x) / gridSize) % 2;
color = vec4(col, 0.0f, col, col);
color = fragment_colors;
}

View File

@@ -179,56 +179,36 @@ fn main() {
// == // Set up your VAO around here
let vertices = vec![
// Triangle 1
-0.9, -0.9, 0.0,
-0.7, -0.9, 0.0,
-0.8, -0.7, 0.0,
//Triangle 1
0.8, 0.2, 0.2,
-0.2, 0.2, 0.2,
0.3, -0.8, 0.2,
// Triangle 2
-0.6, -0.2, 0.0,
-0.2, -0.5, 0.0,
0.4, 0.7, 0.0,
// // Triangle 2
-0.8, 0.2, 0.2,
0.2, 0.2, 0.2,
-0.3, -0.8, 0.2,
// Triangle 3
0.5, 0.0, 0.0,
0.0, -0.9, 0.0,
0.6, -0.9, 0.0,
// Triangle 4
-0.4, 0.9, 0.0,
-0.9, 0.4, 0.0,
-0.2, 0.2, 0.0,
// Triangle 5
0.9, -0.9, 0.0,
0.9, 0.9, 0.0,
0.5, 0.9, 0.0,
// // Triangle 3
// 0.5, 0.0, 0.0,
// 0.0, -0.9, 0.0,
// 0.6, -0.9, 0.0,
];
let indices = vec![
0,1,2,
3,4,5,
6,7,8,
9,10,11,
12,13,14
0,1,2
];
let colors = vec![
1.0, 0.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
0.0, 0.0, 1.0, 1.0,
1.0, 0.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
0.0, 0.0, 1.0, 1.0,
1.0, 0.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
0.0, 0.0, 1.0, 1.0,
1.0, 0.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
0.0, 0.0, 1.0, 1.0,
1.0, 0.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
0.0, 0.0, 1.0, 1.0,
1.0, 0.0, 0.0, 0.4,
1.0, 0.0, 0.0, 0.4,
1.0, 0.0, 0.0, 0.4,
0.0, 1.0, 0.0, 0.4,
0.0, 1.0, 0.0, 0.4,
0.0, 1.0, 0.0, 0.4,
0.0, 0.0, 1.0, 0.4,
0.0, 0.0, 1.0, 0.4,
0.0, 0.0, 1.0, 0.4,
];
let vao_id = unsafe { create_vao(&vertices, &indices, &colors) };