<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Perspective-Correct Computation Pixels Color for Systems of Three-Dimensional Rendering</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Oleksandr</forename><surname>Romaniuk</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Department of Software Engineering</orgName>
								<orgName type="institution" key="instit1">Vinnytsia National Technical University</orgName>
								<orgName type="institution" key="instit2">UKRAINE</orgName>
								<address>
									<addrLine>95 Khmelnytske shose str</addrLine>
									<settlement>Vinnytsia</settlement>
								</address>
							</affiliation>
						</author>
						<author role="corresp">
							<persName><forename type="first">Oleksandr</forename><surname>Dudnyk</surname></persName>
							<email>dudnyk@vntu.edu.ua</email>
							<affiliation key="aff0">
								<orgName type="department">Department of Software Engineering</orgName>
								<orgName type="institution" key="instit1">Vinnytsia National Technical University</orgName>
								<orgName type="institution" key="instit2">UKRAINE</orgName>
								<address>
									<addrLine>95 Khmelnytske shose str</addrLine>
									<settlement>Vinnytsia</settlement>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Serhii</forename><surname>Pavlov</surname></persName>
							<affiliation key="aff1">
								<orgName type="department">Department of Biomedical Engineering</orgName>
								<orgName type="institution" key="instit1">Vinnytsia National Technical University</orgName>
								<orgName type="institution" key="instit2">UKRAINE</orgName>
								<address>
									<addrLine>95 Khmelnytske shose</addrLine>
									<settlement>Vinnytsia</settlement>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Olena</forename><surname>Tsikhanovska</surname></persName>
							<affiliation key="aff2">
								<orgName type="department" key="dep1">Department of Economics of Enterprises and Corporations</orgName>
								<orgName type="department" key="dep2">The Vinnytsyia Educational</orgName>
								<orgName type="institution" key="instit1">Research Institute of Economics Ternopil National Economic University</orgName>
								<orgName type="institution" key="instit2">UKRAINE</orgName>
								<address>
									<addrLine>Gonta str</addrLine>
									<postCode>37</postCode>
									<settlement>Vinnytsia</settlement>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Perspective-Correct Computation Pixels Color for Systems of Three-Dimensional Rendering</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">5D44F29B7F90F4D269B49CEE270CD608</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T02:21+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>texturing</term>
					<term>texture mapping</term>
					<term>rendering</term>
					<term>computer graphic</term>
					<term>shading</term>
					<term>Phong shading</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>In computer graphics, the projections of three-dimensional images are considered on a twodimensional picture plane. Flat geometric projections are divided into two main classes: central and parallel. The difference between them is determined by the relationship between the center of the projection and the projection plane. If the distance between them is finite, then the projection will be central, and if it is infinite, then the projection will be parallel. In real space reflection of rays from objects is perceived at the location of the observer, that is, on the principle of central projection. Correct reproduction of colors takes place provided that the components of the color intensities of the corresponding surface points in the global (object) and screen coordinate systems coincide.</p><p>The authors propose methods to improve the performance of texture mapping and realism of shading, in particular, the methods perspective-correct texturing and Phong shading.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>When forming graphical images is solved by a twofold task -improve performance and enhance realism. Today the performance of graphical tools sufficient for the formation of images according to their visual properties similar to the photos, you have achieved photographic quality.</p><p>To ensure high realism is important to consider the perspective transformation of polygons in the determination of pixel colors: in the texture mapping and shading.</p><p>The perspective-correct formation of colors is used both for shading and texture mapping.</p><p>When coloring the surfaces of three-dimensional objects, the methods of Gourund and Phong are most often used. The question of the prospective correct reproduction of colors according to these methods is considered, respectively, in <ref type="bibr" target="#b0">[1,</ref><ref type="bibr" target="#b1">2,</ref><ref type="bibr" target="#b2">3]</ref>.</p><p>In the tasks of texturing, you need to find the relationship between the screen coordinates and texture coordinates. In order to ensure high productivity, the linear and quadratic functions are often used in perspective-correct texture mapping <ref type="bibr" target="#b4">[4,</ref><ref type="bibr" target="#b5">5]</ref>. In such approaches, a molded image may have artifacts and does not always faithfully reproduce the perspective of an object. In order to increase the realism of perspective-correct texturing <ref type="bibr" target="#b4">[4,</ref><ref type="bibr" target="#b5">5,</ref><ref type="bibr" target="#b6">6]</ref>, use of nonlinear functions, the calculation of which involves the implementation of labor-intensive operations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. SHADING WITH THE PERSPECTIVE</head><p>Ignoring the depth of the object in the calculation of the vectors leads to error computing its orthogonal components, which can be calculate by the formula</p><formula xml:id="formula_0">1 A B A A 2 2 1 1 B A B A 2 2 1 B A 2 2 1 1 u z I I ( I I ) I z u ( z z ) u z ( I I ) u ( I I ) ( u ) z u( z z ) 1 ( I I ) u ( 1 ), z z u( 1 ) z z ∆ ⋅ = + − ⋅ − − − ⋅ − ⋅ − − ⋅ = − ⋅ − = − − = − ⋅ ⋅ − + −<label>(1)</label></formula><p>replacing the intensity value of the color value of the orthogonal component.</p><p>For perspective-correct reproduction of colors using Phong shading it is necessary to use non-linear interpolation of normal vectors using a variable w t . Unfortunately, the calculation w t according to the formula [1]   Àw</p><formula xml:id="formula_1">v w Bw v Bw Aw Z t t Z t ( Z Z ) ⋅ = − ⋅ − (2)</formula><p>provides for the execution of a division operation for each current value of To do this we set up a system of equations using three points</p><formula xml:id="formula_2">v v v t 0, t 1, t 1/ 2. = = = Àw Bw Aw c 0, a b c 1, 1 1 Z a b c . 4 2 Z Z = + + = ⋅ + ⋅ + = +       </formula><p>The system has such a solution</p><formula xml:id="formula_3">( ) ( ) ( ) ( ) Bw Aw Aw Bw Bw Aw Bw Aw 2 Z Z 3 Z Z a , b , Z Z Z Z c 0. ⋅ − ⋅ − = = + + = If Bw Aw Z Z =  , then ( ) ( ) ( ) (</formula><p>)</p><formula xml:id="formula_4">2 1 3 a , b . 1 1 ⋅ − − = = + +    </formula><p>The quadratic approximation gives satisfactory results only for 3 ≤</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head></head><p>. In figure <ref type="figure" target="#fig_1">1</ref> shows a graph of change of the absolute error of the approximation from v t ,  .  </p><formula xml:id="formula_5">0 t 0,5 ≤ ≤ ( ) ( )( ) ( ) ( )( ) Aw Bw Aw Bw Aw Âw Aw Aw Bw Bw Aw Âw Aw 8 Z Z Z a Z Z 3 Z Z 3 Z Z b , c 0. Z Z 3 Z Z ⋅ ⋅ − = + ⋅ + ⋅ + = = + ⋅ + For v 0,5 t 1 &lt; ≤ ( ) ( )( ) Bw Aw Bw Bw Aw Âw Aw 8 Z Z Z a , Z Z 3 Z Z − ⋅ ⋅ − = + ⋅ + ( ) ( )( ) Aw Bw Bw Bw Aw Âw Aw 2 9 Z 5 Z Z b , Z Z 3 Z Z ⋅ ⋅ − ⋅ ⋅ = + ⋅ + ( ) ( )( ) 2 Aw Bw Bw Aw Âw Aw 3 Z Z c . Z Z 3 Z Z ⋅ − = + ⋅ +</formula><p>The analysis showed that in this case 2, 3, 4, 5 =  the maximum modulus of the relative error does not exceed, 1% , 4%, 8%, 13%. With regard to three-dimensional objects, ,  as a rule, does not exceed 3.</p><p>Consider using approximation by third-order polynomial of the form</p><formula xml:id="formula_6">3 2 v v a t b t ct d . ⋅ + ⋅ + +</formula><p>For finding the unknown we set up a system of four equations. To do this, make the value of the polynomial equal w t (see formula 2) in points v t 0, 1 / 3, 2 / 3, 1 =</p><p>. Find:</p><formula xml:id="formula_7">( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( ) ( ) 2 Bw Aw Bw Aw Bw Aw Bw Aw Bw Aw Bw Aw Bw Aw 2 Bw Aw Bw Aw Bw Aw Bw Aw 9 Z Z a , 2 Z Z Z 2 Z 9 Z Z Z 2 Z b , 2 Z Z Z 2 Z 2 Z 4 Z Z 11 Z c . 2 Z Z Z 2 Z ⋅ − = ⋅ + ⋅ + ⋅ − ⋅ − − ⋅ = ⋅ + ⋅ + ⋅ ⋅ − ⋅ ⋅ + ⋅ = ⋅ + ⋅ + ⋅</formula><p>The analysis showed that when using the cubic interpolation achieves better accuracy compared to piecewise-quadratic interpolation. For example, when 2, 3, 4, 5 =  the maximum modulus of the relative error does not exceed, 0,64 %, 2,9 %, 6,3 %, 10,6 %.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. IMPROVING THE PERFORMANCE OF TEXTURING WITH PERSPECTIVE</head><p>Finding texture coordinates is a time consuming procedure because it requires the execution of complex operations for each pixel according to the formula <ref type="bibr" target="#b4">[4,</ref><ref type="bibr" target="#b5">5]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Ax By C u</head><p>Gx Hy I</p><formula xml:id="formula_8">+ + = + + , Dx Ey F v</formula><p>Gx Hy I</p><formula xml:id="formula_9">+ + = + + . If i i 1 x x 1 + = + , then 1 i 1 i 1 i 1 i i A ( x 1 ) B y C u D ( x 1 ) E y F + ⋅ + + ⋅ + = = ⋅ + + ⋅ + 1 i 1 i 1 1 i i ( A x B y C ) A . ( D x E y F ) D ⋅ + ⋅ + + ⋅ + ⋅ + +</formula><p>For u0 the formula has the form:</p><formula xml:id="formula_10">1 0 1 1 0 0 0 0 i i A (x ) B y C u D (x ) E y F ⋅ + + ⋅ + = = ⋅ + + ⋅ + 1 0 1 1 0 . i i A x B y C D x E y F ⋅ + ⋅ + ⋅ + ⋅ +</formula><p>For u1:</p><formula xml:id="formula_11">1 0 1 1 1 0 ( 1) ( 1) i i A x B y C u D x E y F ⋅ + + ⋅ + = = ⋅ + + ⋅ + 1 0 1 1 1 0 . i i A x A B y C D x D E y F ⋅ + + ⋅ + ⋅ + + ⋅ +</formula><p>For u2:</p><formula xml:id="formula_12">1 0 1 1 2 0 (<label>2</label></formula><formula xml:id="formula_13">)</formula><p>( 2)</p><formula xml:id="formula_14">i i A x B y C u D x E y F ⋅ + + ⋅ + = = ⋅ + + ⋅ + 1 0 1 1 1 0 2 . 2 i i A x A B y C D x D E y F ⋅ + ⋅ + ⋅ + ⋅ + ⋅ + ⋅ + =</formula><p>Thus, for un the formula has the form:</p><formula xml:id="formula_15">1 0 1 1 0 (<label>)</label></formula><formula xml:id="formula_16">( ) i n i A x n B y C u D x n E y F ⋅ + + ⋅ + = = ⋅ + + ⋅ + 1 0 1 1 1 0 . i i A x A n B y C D x D n E y F ⋅ + ⋅ + ⋅ + = ⋅ + ⋅ + ⋅ +<label>(2)</label></formula><p>A similar formula can be written for vn.</p><formula xml:id="formula_17">0 2 2 2 2 0 . i n i A x B y B n C v D x E y E n F ⋅ + ⋅ + ⋅ + = ⋅ + ⋅ + ⋅ +</formula><p>From the given formulas it is visible that for calculation of each texel computer needs to perform 2 operations of division, 8 operations of addition and 8 multiplications.</p><p>As can be seen from formulas (2), the value of the for each n remain unchanged, and therefore can be calculated once for each rasterization line using formula:</p><formula xml:id="formula_18">1 0 1 1 1 0 , . t i b i u A x A n B y C u D x E y F = ⋅ + ⋅ + ⋅ + = ⋅ + ⋅ +</formula><p>where ut and ub constant part of the numerator and denominator of formula (1) in accordance. Therefore, un can be calculated according using the formula</p><formula xml:id="formula_19">1 . t n b u A n u u D n + ⋅ = + ⋅<label>(3)</label></formula><p>Thus, for calculating coordinates of all texels, variables, u1t and u1b are constant, and their value is sufficient to calculate once. Similarly you can calculate vn.</p><p>This simplification reduces the number of operations of addition and multiplication to 4 for each.</p><p>Based on these mathematical relationships it is possible to offer algorithm of parallel calculation of texels coordinates: for each rasterization line at first calculates the parameters ut and ub, then calculate values of the numerator and denominator in parallel by the formula:</p><formula xml:id="formula_20">1 n t w u A n = + ⋅ , n b v u D n = + ⋅ ,</formula><p>then the division operation to calculate the coordinates</p><formula xml:id="formula_21">n n n w u v = .</formula><p>The sequence of operations of the algorithm shown in figure <ref type="figure">2</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Fig. 2. Parallel calculating texel coordinates</head><p>Since for each x, n is increased by 1, there is such a formula:</p><formula xml:id="formula_22">1 1 n n w w A − = + , 1 n n v v D − = + .<label>(4)</label></formula><p>In accordance with the formulas (4), we can offer a consistent algorithm for calculating texture coordinates: wn and vn for each х calculated by adding to wn-1 and vn-1, that was calculated for х-1, А1 and D. The sequence of operations of the algorithm shown in figure <ref type="figure">3</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Fig. 3. Sequential calculating texel coordianates</head><p>The computing of texture coordinates by this algorithm can also be accelerated using parallel computing. One possible approach to parallelization is the parallel rasterization of several lines simultaneously. However, this approach will not be productive enough in cases when the number of pixels per row is much higher than the number of rows. Therefore, it is advisable to use means of parallel calculations within a single line.</p><p>Let's consider parallel computing of cordiant texels for pixels located at even and odd positions in the rasterization line (fig. <ref type="figure" target="#fig_4">4</ref>). </p><formula xml:id="formula_23">− = + , а 1 n n v v D − = + then: 1 1 1 1 ( ) n n w w A A + − = + + , 1 1 ( ) n n v v D D + − = + + .</formula><p>Thus, parallel computation of the texture coordinates of pixels on odd and even positions is possible according to the formulas: </p><p>In this case, the coordinates texels for the first two points are defined by the formula (3).</p><p>Based on the formulas ( <ref type="formula" target="#formula_24">5</ref>) and (5) to establish the relationship which allows parallel rasterization the line in an random number of threads using formulas: It is also possible a parallel calculation of the coordinates in two streams by simultaneous rasterization of line in two directions (fig. <ref type="figure" target="#fig_8">5</ref>). From right to left according to the formula (4), and from left to right according to the formula:  The figure <ref type="figure" target="#fig_9">6</ref> show that the proposed method makes it possible to increase productivity perspective-correct texturing 26%. Testing was conducted on the Intel i7 2600K CPU and GPU AMD RX460. </p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head></head><label></label><figDesc>Find unknown a, b, c .</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Fig. 1 .</head><label>1</label><figDesc>Fig. 1. The dependence of the modulus of the absolute error of the approximation from v t ,  Higher accuracy of approximation can be achieved if the use of piecewise quadratic interpolation on two periods of change v t . For</figDesc><graphic coords="2,63.60,349.30,206.15,149.90" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head></head><label></label><figDesc>v</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Fig. 4 .</head><label>4</label><figDesc>Fig. 4. Parallel computing texels coordinates for two threads on the same rasterization line</figDesc><graphic coords="4,109.55,183.10,128.15,82.45" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_6"><head></head><label></label><figDesc>k -the number of concurrent threads.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_8"><head>Fig. 5 .</head><label>5</label><figDesc>Fig. 5. Parallel computation of the coordinates in the two streams with a counter direction of rasterization</figDesc><graphic coords="4,93.10,582.10,147.00,75.00" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_9"><head>Fig. 6 .</head><label>6</label><figDesc>Fig. 6. Comparison of the performance of the proposed method with the classicalIII. CONCLUSIONProposed methods to improve the performance of texture mapping and realism of shading, in particular, the methods perspective-correct texturing and Phong shading.</figDesc><graphic coords="4,320.75,209.05,216.15,153.14" type="bitmap" /></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0">ACIT 2018, June 1-3, 2018, Ceske Budejovice, Czech Republic</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Content Base Image Retrieval Using Fast Phong Shading</title>
		<author>
			<persName><forename type="first">G</forename><forename type="middle">F</forename><surname>Ahmed</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Barskar</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Bharti</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><forename type="middle">S</forename><surname>Rajput</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">2010 International Conference on Computational Intelligence and Communication Networks</title>
				<imprint>
			<date type="published" when="2010">2010</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<title level="m" type="main">Phong Shading Reformulation for Hardware Renderer Simplification</title>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">F</forename><surname>Lyon</surname></persName>
		</author>
		<idno>#43</idno>
		<imprint>
			<date type="published" when="1993-08-02">August 2, 1993</date>
		</imprint>
	</monogr>
	<note type="report_type">Apple Technical Report</note>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Models of shading. Flat model. Shading on Guro and Fong</title>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">A</forename><surname>Kulagin</surname></persName>
		</author>
		<ptr target="http://compgraphics.info/3" />
	</analytic>
	<monogr>
		<title level="m">Computer graphics. Theory, algorithms, examples on C++ and OpenGL</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title/>
		<author>
			<persName><forename type="first">D/Lighting/</forename><surname>Shading_Model</surname></persName>
		</author>
		<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Survey of Texture Mapping</title>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">S</forename><surname>Heckbert</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IEEE Computer Graphics and Applications</title>
		<imprint>
			<biblScope unit="volume">6</biblScope>
			<biblScope unit="issue">11</biblScope>
			<biblScope unit="page" from="56" to="67" />
			<date type="published" when="1986">1986</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Polygon-based texture mapping for cyber city 3D building models</title>
		<author>
			<persName><forename type="first">F</forename><surname>Tsai</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename><forename type="middle">C</forename><surname>Lin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">International Journal of Geographical Information Science</title>
		<imprint>
			<biblScope unit="volume">21</biblScope>
			<biblScope unit="issue">9</biblScope>
			<biblScope unit="page" from="965" to="981" />
			<date type="published" when="2007">2007</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">An Improved Texture Rendering Technique Based on MipMap Algorithm</title>
		<author>
			<persName><forename type="first">X</forename><forename type="middle">U</forename><surname>Ying</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Journal of Mianyang Normal University</title>
		<imprint>
			<biblScope unit="volume">5</biblScope>
			<biblScope unit="page">17</biblScope>
			<date type="published" when="2013">2013</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
