Small style tweaks

This commit is contained in:
Grant Sanderson
2023-01-23 15:05:10 -08:00
parent 8d729eef5a
commit 03080a10a7
3 changed files with 8 additions and 12 deletions

View File

@ -414,9 +414,9 @@ def get_window_config(args: Namespace, custom_config: dict, camera_config: dict)
if not (args.full_screen or custom_config["full_screen"]):
window_width //= 2
window_height = int(window_width / aspect_ratio)
return {
"size": (window_width, window_height),
}
return dict(
size=(window_width, window_height),
)
def get_camera_config(args: Namespace, custom_config: dict) -> dict:

View File

@ -6,13 +6,13 @@ uniform float focal_distance;
const vec2 DEFAULT_FRAME_SHAPE = vec2(8.0 * 16.0 / 9.0, 8.0);
vec4 get_gl_Position(vec3 point){
bool is_fixed = bool(is_fixed_in_frame);
vec4 result = vec4(point, 1.0);
vec2 shape = DEFAULT_FRAME_SHAPE;
if(!bool(is_fixed_in_frame)){
if(!is_fixed){
result = view * result;
shape = frame_shape;
}
vec2 shape = is_fixed ? DEFAULT_FRAME_SHAPE : frame_shape;
result.x *= 2.0 / shape.x;
result.y *= 2.0 / shape.y;
result.z /= focal_distance;

View File

@ -42,12 +42,8 @@ vec3 unit_normal = vec3(0.0, 0.0, 1.0);
vec3 get_joint_unit_normal(vec4 joint_product){
vec3 result;
if(joint_product.w < COS_THRESHOLD){
result = joint_product.xyz;
}else{
result = v_joint_product[1].xyz;
}
vec3 result = (joint_product.w < COS_THRESHOLD) ?
joint_product.xyz : v_joint_product[1].xyz;
float norm = length(result);
return (norm > 1e-5) ? result / norm : vec3(0.0, 0.0, 1.0);
}