Pantomorphic Perspective for Immersive Imagery
Total Page:16
File Type:pdf, Size:1020Kb
Pantomorphic Perspective for Immersive Imagery Jakub Maksymilian Fober [email protected] Abstract even more critical, as there is no mathematical model for gen- A wide choice of cinematic lenses enables motion-picture erating anamorphic projection in an artistically-convincing creators to adapt image visual-appearance to their creative manner [Yuan and Sasian 2009]. Some attempts were made vision. Such choice does not exist in the realm of real-time at alternative projections for computer graphics, with fixed computer graphics, where only one type of perspective pro- cylindrical or spherical geometry [Baldwin et al. 2014; Sharp- jection is widely used. This work provides a perspective less et al. 2010]. A parametrized perspective model was imaging model that in an artistically convincing manner also proposed as a new standard [Correia and Romão 2007], resembles anamorphic photography lens variety and more. but wasn’t adopted. It included interpolation states in be- It presents an asymmetrical-anamorphic azimuthal projec- tween rectilinear/equidistant and spherical/cylindrical pro- tion map with natural vignetting and realistic chromatic jection. The cylindrical parametrization of this solution was aberration. The mathematical model for this projection has merely an interpolation factor, where intermediate values been chosen such that its parameters reflect the psycho- did not correspond to any common projection type. There- physiological aspects of visual perception. That enables its fore it was not suited for artistic or professional use. The use in artistic and professional environments, where specific notion of sphere as a projective surface, which incorporates aspects of the photographed space are to be presented. cartographic mapping to produce a perspective picture be- came popularized [German et al. 2007; Peñaranda et al. 2015; CCS Concepts: • Computing methodologies ! Percep- Williams 2015]. Also, perspective parametrization that tran- tion; Ray tracing; • Human-centered computing; • Ap- sitions according to the content (by the view-tilt angle) has plied computing ! Media arts; been developed, as a modification to the computer game Keywords: Curvilinear Perspective, Panini, Pantomorphic, Minecraft [Williams 2017]. But the results of these solutions Cylindrical, Fisheye, Perspective Map were more a gimmick and have not found practical use. The linear perspective projection is still the way-to-go for most digital content. One of the reasons is the GPU fixed-function © 2021 Jakub Maksymilian Fober architecture in regard to rasterization. With the advent of real-time ray-tracing, more exotic projections could become widely adopted. This work is licensed under Creative Commons BY-NC-ND 3.0 license. https://creativecommons.org/licenses/by-nc-nd/3.0/ This paper aims to provide a perspective model with math- For all other uses including commercial, contact the owner/author(s). ematical parametrization that gives artistic-style interaction with image-geometry. It is a parametrization that works similarly to the way film directors choose lenses for each 1 Introduction scene by their aesthetics [Giardina 2016; Neil 2004; Sasaki The perspective in computer real-time graphics hasn’t changed 2017a], but with a greater degree of control. It also provides a since the dawn of CGI. It is based on a concept as old as the psycho-physiological correlation between perspective model fifteenth century Renaissance, a linear projection [Alberti parameters and the perception of depicted space attributes, like distance, size, proportions, shape or speed. That map- arXiv:2102.12682v4 [cs.GR] 19 Jul 2021 1435; Argan and Robb 1946; McArdle 2013]. This situation is similar to the beginnings of photography, where only one ping enables the use of the presented model in a professional type of lens was widely used, an A.D. 1866 Rapid Rectilinear environment, where image geometry is specifically suited [Kingslake 1989] lens. Linear perspective even at the time of for a task [Whittaker 1984]. pantomorphic its advent, 500 years ago, has been criticized for distorting The presented perspective model is named panto- +morphe¯ proportions [Da Vinci 1632]. In a phenomenon known today (G. , all , shape; assuming all shapes). as Leonardo’s paradox [Dixon 1987], in which figures further away but at the periphery appear larger, than those located 1.1 Document naming convention near the optical center. Computer graphics really skipped This document uses the following naming convention: the artistic achievements of the last five centuries in regard to perspective. This includes the cylindrical perspective of • Left-handed coordinate system. Pannini [Sharpless et al. 2010], Barker [Wikipedia, contribu- • Vectors presented natively in column. tors 2019] and anamorphic lenses used in cinematography • Matrix vectors arranged in rows (row-major order) [Giardina 2016; Neil 2004; Sasaki 2017a,b]. The situation is "row col. Fober, J.M. ®2 EG ¹ º • Matrix-matrix multiplication by »column¼0 ·»row¼1 = 2 2 2 3 " 1 cos 2i # i® E® ¸®E cos2 i ¸ " G = 6 G ~ 7 = = 2 2 , 0 1. i 6 E®2 7 2 i cos¹2iº (1d) ®~ 6 ~ 7 sin 1 − • jDj 2 2 2 2 A single bar enclosure “ ” represents vector length 6 E®G ¸®E~ 7 or scalar absolute. 4 5 • Vectors with an arithmetic sign, or without, are calcu- where A 2 R¡0 is the view-coordinate radius (magnitude). lated component-wise and form another vector. Vector \® 2 »0, c¼2 contains incident angles (measured from • Centered dot “·” represents the vector dot product. the optical axis) of two azimuthal projections. Vector i® 2 5 , 2 • Square brackets with a comma “» ¼” denote interval. »0, 1¼2 is the anamorphic interpolation weight, which is lin- • Square brackets with blanks “»G ~¼” denote vector and ear i®G ¸i ®~ = 1, but has spherical distribution (see Figure 1 matrix. on the facing page). Vector :® 2 »−1, 1¼2 (also »−1, 1¼3 in sub- • The power of “−1” signifies the reciprocal of the value. section 2.2 variant) describes two power axes of anamorphic • QED symbol “□” marks the final result or output. projection. The algorithm is evaluated per-pixel of position This naming convention simplifies the transformation pro- E® 2 R2 in view-space coordinates, centered at the optical axis cess of formulas into code. and normalized at the chosen angle-of-view (horizontal or vertical). The final anamorphic incident angle \ 0 is obtained 2 Anamorphic primary-ray map by interpolation, using i® weights. If we assume that projective visual space is spherical [Fleck "\® # i 1994; McArdle 2013], one can define perspective picture as \ 0 G ®G = ® · i (2a) an array of rays pointing to the visual sphere surface. This is \~ ®~ how the algorithm described below will output a projection- 퐺^ E i map (aka perspective-map). Perspective map is an array of 2 G 3 2 sin \0 ®G 3 2 \ 0 cos 3 6 7 6 A 7 6sin 7 6퐺^~7 = 6 E®~ 7 = 6 sin i 7 , □ (2b) three-dimensional rays, which are assigned to each screen- 6 7 6 0 7 6 0 7 6퐺^ 7 6 cos\ 7 6 cos\ 7 pixel. Visual sphere as the image model enables a wider 4 I 5 4 5 4 5 angle of view, beyond 180°-limit of planar projection. Ray- 0 map can be easily converted to cube-*+ -map, () -map and here \ 2 ¹0, c¼ is the anamorphic incident angle, measured other screen distortion formats. from the optical axis. This measurement resembles azimuthal Here, the procedural algorithm for primary-ray map (aka projection of the globe (here a visual sphere) [McArdle 2013]. 3 perspective map) uses two input values from the user: dis- The final incident vector 퐺^ 2 »−1, 1¼ (aka primary-ray) is 0 tortion parameter for two power axes and focal-length or obtained from the anamorphic angle \ . Parameters A, E,® i® angle-of-view (aka FOV). Two distinct power axes define the are in view-space, while \,\® 0, i,퐺^ are in visual-sphere space. anamorphic projection type. Each axis is expressed by the Essentially the anamorphic primary-ray map preserves the azimuthal projection factor : [Bettonvil 2005; Fleck 1994; azimuthal angle i, while modulating only the picture’s ra- Krause 2019]. Both power axes share the same focal-length dius. 5 . Evaluation of each power-axis produces spherical an- ® ® gles \G and \~, which are then combined to anamorphic 2.1 Focal length and angle-of-view 0 azimuthal-projection angle \ . Interpolation of \ is done To give more control over the picture, a mapping between i i through anamorphic weights ®G and ®~. Weights are derived angle-of-view Ω and focal-length 5 can be established. Here, from spherical angle i, of the azimuthal projection. To note, focal-length is derived in a reciprocal from, to optimize usage calculation of i is omitted here, by using view-coordinates in Equation (1). E®-optimization. Ω tan ℎ :® 8 2 G , :® > ® if G ¡ 0 q > :G 2 2 −1 ><> Ω A = j®Ej = E®G ¸E ®~ (1a) 5 ℎ , :® , Ωℎ = 2 if G = 0 (3) Ω A > sin ℎ ® arctan :® > 2 :G 8 5 G ® > , if :® < 0 > , if :G ¡ 0 > ® G > :G : :G ® >< A ® \G = , if :G = 0 (1b) 5 Ω 2 ¹0, g¼ > arcsin A :® where ℎ denotes a horizontal angle of view. Simi- > 5 G , :® > if G < 0 larly, vertical Ω can be obtained using :® parameter instead. : :G E ~ 1 arctan A :® The resultant value /5 2 R¡0 is the reciprocal focal-length. 8 5 ~ , :® > if ~ ¡ 0 > :~ \® >< A , :® Remark. Focal-length 5 value must be same for \® and \® . ~ = 5 if ~ = 0 (1c) G ~ > arcsin A :® Therefore, only one reference angle Ω can be chosen, either > 5 ~ , :® > if ~ < 0 horizontal or vertical. : :~ Pantomorphic Perspective for Immersive Imagery r 1 1 0 0 1 r (a) Graph mapping angle i, to anamor- (b) Radial graph, mapping anamorphic (c) Radial graph illustrating anamorphic 2 phic interpolation weights i®G and i®~.