1
0

4:3 output ratio

This commit is contained in:
2025-09-26 05:54:05 +02:00
parent 71cca0589e
commit a0cba047e5
3 changed files with 58 additions and 22 deletions

View File

@ -35,6 +35,7 @@ uniform float pts;
const vec2 sensor_size = vec2(5.949440, 5.205760);
const float equidistant_focal_length = 2.970000;
const float rectilinear_focal_length = 2.167601;
const vec2 rectilinear_scale = vec2(1.138819, 1.0);
// constants
const int subsampling = 4;
@ -49,7 +50,7 @@ vec2 sensor_to_texture;
void initialize() {
texture_center = myResolution * 0.5;
texture_to_sensor = sensor_size / myResolution;
texture_to_sensor = (sensor_size / myResolution) * rectilinear_scale;
#ifdef rotate_180
texture_to_sensor *= -1.0;
#endif
@ -68,7 +69,7 @@ vec3 sample_texture(const in vec2 coord) {
vec2 y_coord = texture_center + rectilinear * sensor_to_texture;
#ifdef debug_borders
if (y_coord.x < 0.0 || y_coord.y < 0.0 || y_coord.x > myResolution.x || y_coord.y > myResolution.y) {
return vec3(16.0 / 255.0, 0.5, 0.5);
return vec3(235.0 / 255.0, 240.0 / 255.0, 240.0 / 255.0);
}
#endif
vec2 uv_coord = y_coord * 0.5;