This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This code sends VL53L1X 12 x 12 or 8 x 8 ROI distance data over serial. | |
Python code for plottomg: | |
import serial | |
import struct | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 450 core | |
uniform bool enableRimLight; | |
uniform sampler2D sampler; | |
in VS_OUT { | |
in vec3 L; | |
in vec3 V; | |
in vec2 tc; | |
} fs_in; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 450 core | |
layout(location = 0) in vec3 aVert; | |
layout(location = 1) in vec3 aNorm; | |
layout(location = 2) in vec2 aTexCoord; | |
layout(location = 3) in vec3 aTangent; | |
uniform mat4 vMat; | |
uniform mat4 pMat; | |
uniform mat4 mMat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from PIL import Image | |
from math import sqrt | |
def main(): | |
NX, NY = 256, 256 | |
nmap = np.zeros([NX, NY, 3], np.float32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stripes | |
float val = clamp(round(sin( 20 * fs_in.tc.x * 3.14156)), 0, 1); | |
vec3 col1 = vec3(255, 237, 81) / 255.0; | |
vec3 col2 = vec3(133, 202, 93) / 255.0; | |
vec3 col = mix(col1, col2, val); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float rim = (1.0 - dot(N, V)); | |
rim = smoothstep(0.0, 1.0, rim); | |
float rim_exp = 3.5; | |
rim = pow(rim, rim_exp); | |
vec3 rim_col = vec3(0.1, 0.1, 0.1); | |
crim = rim * rim_col; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 450 core | |
uniform bool enableRimLight; | |
in VS_OUT { | |
in vec3 N; | |
in vec3 L; | |
in vec3 V; | |
} fs_in; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 450 core | |
layout(location = 0) in vec3 aVert; | |
layout(location = 1) in vec3 aNorm; | |
uniform mat4 vMat; | |
uniform mat4 pMat; | |
uniform mat4 mMat; | |
out VS_OUT { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 450 core | |
uniform bool enableRimLight; | |
uniform sampler2D sampler; | |
in VS_OUT { | |
in vec3 N; | |
in vec3 L; | |
in vec3 V; | |
in vec2 tc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model.compile( | |
optimizer=tf.keras.optimizers.Adam(), | |
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), | |
metrics=['accuracy'], | |
) | |
EPOCHS = 10 | |
history = model.fit( | |
train_ds, | |
validation_data=val_ds, |
NewerOlder