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"]): if not (args.full_screen or custom_config["full_screen"]):
window_width //= 2 window_width //= 2
window_height = int(window_width / aspect_ratio) window_height = int(window_width / aspect_ratio)
return { return dict(
"size": (window_width, window_height), size=(window_width, window_height),
} )
def get_camera_config(args: Namespace, custom_config: dict) -> dict: 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); const vec2 DEFAULT_FRAME_SHAPE = vec2(8.0 * 16.0 / 9.0, 8.0);
vec4 get_gl_Position(vec3 point){ vec4 get_gl_Position(vec3 point){
bool is_fixed = bool(is_fixed_in_frame);
vec4 result = vec4(point, 1.0); vec4 result = vec4(point, 1.0);
vec2 shape = DEFAULT_FRAME_SHAPE; if(!is_fixed){
if(!bool(is_fixed_in_frame)){
result = view * result; result = view * result;
shape = frame_shape;
} }
vec2 shape = is_fixed ? DEFAULT_FRAME_SHAPE : frame_shape;
result.x *= 2.0 / shape.x; result.x *= 2.0 / shape.x;
result.y *= 2.0 / shape.y; result.y *= 2.0 / shape.y;
result.z /= focal_distance; 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 get_joint_unit_normal(vec4 joint_product){
vec3 result; vec3 result = (joint_product.w < COS_THRESHOLD) ?
if(joint_product.w < COS_THRESHOLD){ joint_product.xyz : v_joint_product[1].xyz;
result = joint_product.xyz;
}else{
result = v_joint_product[1].xyz;
}
float norm = length(result); float norm = length(result);
return (norm > 1e-5) ? result / norm : vec3(0.0, 0.0, 1.0); return (norm > 1e-5) ? result / norm : vec3(0.0, 0.0, 1.0);
} }