Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SAM-tak committed Aug 14, 2022
1 parent 3330e01 commit ccf8d1b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ Final Image

![Final Image](img/finalimage.jpg "Final Image")

### Front View Overscan

The resolution is calculated so that the angle of view of each camera (front, back, top, bottom, and side) fits the final rendering resolution, but in this case the panorama is stretched and the front center is not resolved enough.

The resolution can be increased by this amount only for the frontal rendering to compensate for the lack of resolution.

The default setting of 25% almost eliminates the lack of resolution in the center of the image, but it results in excessive resolution on the periphery.
This means that rendering will take more time.

### No Side Plane

Generates panorama image **without rendering side views**.
Expand Down
7 changes: 4 additions & 3 deletions renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define VMARGIN %f
#define EXTRUSION %f
#define INTRUSION %f
#define FB_SCALE %f
const float INVSIDEFRAC = 1 / SIDEFRAC;
const float TBHTEXSCALE = 1 / (TBFRAC - INTRUSION);
Expand Down Expand Up @@ -350,10 +351,11 @@ def __init__(self, context, is_animation = False, folder = ''):
self.no_top_bottom_images = True
hmargin = 0.0 if self.no_side_images else margin
vmargin = 0.0 if self.no_top_bottom_images else margin
fb_scale = 1.0 + max(0.0, props.frontViewOverscan / 100.0)
# print(f"stichAngle {stitch_margin} margin:{margin} hmargin:{hmargin} vmargin:{vmargin} extrusion:{extrusion} intrusion:{intrusion}")
# print(f"HTEXSCALE:{1 / (1 + 2 * extrusion + 2 * hmargin)} VTEXSCALE:{1 / (1 + 2 * extrusion + 2 * vmargin)}")
frag_shader = \
(commdef % (fovfrac, sidefrac, tbfrac, h_fov, v_fov, hmargin, vmargin, extrusion, intrusion))\
(commdef % (fovfrac, sidefrac, tbfrac, h_fov, v_fov, hmargin, vmargin, extrusion, intrusion, fb_scale))\
+ (dome % domemodes[int(props.domeMethodEnum)] if is_dome else equi)\
+ fetch_setup\
+ ('' if self.no_side_images else fetch_sides)\
Expand Down Expand Up @@ -397,8 +399,7 @@ def __init__(self, context, is_animation = False, folder = ''):
side_resolution = trans_resolution(base_resolution, sidefrac, 1, 0, vmargin)
side_angle = pi/2 + ((2 * stitch_margin) if vmargin > 0.0 else 0.0)
side_shift_scale = 1 / (1 + 2 * vmargin)
fb_scale = 1 + max(0, (props.frontViewOverscan / 100.0))
fb_resolution = trans_resolution(base_resolution, fb_scale, fb_scale, extrusion+hmargin, extrusion+vmargin)
fb_resolution = trans_resolution(base_resolution, fb_scale, fb_scale, (extrusion+hmargin)*fb_scale, (extrusion+vmargin)*fb_scale)
fb_angle = (base_angle if no_side_plane else pi/2) + 2 * stitch_margin
self.camera_settings = {
'top': (0.0, 0.5*(tbfrac-1+intrusion), pi/2, tb_resolution[0], tb_resolution[1], aspect_ratio),
Expand Down

0 comments on commit ccf8d1b

Please sign in to comment.