KR20070113978A - 3d graphics processing method and apparatus for performing perspective correction - Google Patents
3d graphics processing method and apparatus for performing perspective correction Download PDFInfo
- Publication number
- KR20070113978A KR20070113978A KR1020070047834A KR20070047834A KR20070113978A KR 20070113978 A KR20070113978 A KR 20070113978A KR 1020070047834 A KR1020070047834 A KR 1020070047834A KR 20070047834 A KR20070047834 A KR 20070047834A KR 20070113978 A KR20070113978 A KR 20070113978A
- Authority
- KR
- South Korea
- Prior art keywords
- homogeneous coordinates
- pixels
- value
- scan line
- reference value
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/10—Geometric effects
- G06T15/20—Perspective computation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/04—Texture mapping
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/04—Indexing scheme for image data processing or generation, in general involving 3D image data
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- General Physics & Mathematics (AREA)
- Architecture (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Geometry (AREA)
- Image Generation (AREA)
Abstract
Description
도 1a는 컬러 값에 있어서 원근 왜곡이 발생하는 원리를 나타낸다.1A illustrates the principle that perspective distortion occurs in color values.
도 1b는 텍스쳐 좌표에 있어서 원근 왜곡이 발생하는 경우의 예를 나타낸다.1B illustrates an example in which perspective distortion occurs in texture coordinates.
도 2는 쌍곡선 보간 방식을 설명하기 위한 도면이다.2 is a diagram for describing a hyperbolic interpolation method.
도 3은 본 발명의 바람직한 일 실시예에 따른 3차원 그래픽 처리 장치의 구성을 도시한 블록도이다.3 is a block diagram illustrating a configuration of a 3D graphics processing apparatus according to an exemplary embodiment of the present invention.
도 4는 본 발명의 일 실시예에 따른 래스터라이저의 구성을 도시한 블록도이다.Figure 4 is a block diagram showing the configuration of a rasterizer according to an embodiment of the present invention.
도 5는 본 발명의 일 실시예에 따른 에지 처리부의 구성을 도시한 블록도이다.5 is a block diagram showing a configuration of an edge processing unit according to an embodiment of the present invention.
도 6은 본 발명의 일 실시예에 따른 스캔라인 처리부 구성을 도시한 블록도이다.6 is a block diagram illustrating a configuration of a scan line processor according to an exemplary embodiment of the present invention.
도 7은 본 발명의 일 실시예에 따라 스캔라인에서의 원근 왜곡의 정도를 나타내는 기준을 설명하기 위한 도면이다.7 is a diagram for describing a criterion indicating a degree of perspective distortion in a scan line according to an embodiment of the present invention.
도 8은 본 발명의 일 실시예에 따른 보간부의 구성을 도시한 블록도이다.8 is a block diagram illustrating a configuration of an interpolation unit according to an exemplary embodiment of the present invention.
도 9는 본 발명의 일 실시예에 따라 원근 보정을 적용하여 보간할 픽셀의 결 정을 설명하기 위한 도면이다.FIG. 9 is a diagram for explaining determination of pixels to be interpolated by applying perspective correction according to an exemplary embodiment of the present invention.
도 10은 본 발명의 일 실시예에 따른 3차원 그래픽 처리 방법을 나타낸 흐름도이다.10 is a flowchart illustrating a 3D graphic processing method according to an embodiment of the present invention.
도 11은 본 발명의 일 실시예에 따른 도 10의 제103단계를 보다 자세히 나타낸 흐름도이다.11 is a
도 12는 본 발명의 일 실시예에 따른 도 11의 제112단계를 보다 자세히 나타낸 흐름도이다.12 is a
본 발명은 3차원 그래픽 처리 방법 및 장치에 관한 것으로서, 특히 원근 투영으로 인해 발생하는 원근 왜곡을 보정하는 기능을 가지는 3차원 그래픽 처리 방법 및 장치에 관한 것이다.The present invention relates to a three-dimensional graphics processing method and apparatus, and more particularly to a three-dimensional graphics processing method and apparatus having a function of correcting perspective distortion caused by perspective projection.
3차원 그래픽 처리 과정은 크게 기하 단계(geometry stage)와 래스터화 단계(rasterization stage)로 나뉠 수 있다.The three-dimensional graphics processing process can be roughly divided into a geometry stage and a rasterization stage.
기하 단계는 크게 모델 변환과 시야 변환(model transformation), 카메라 변환(camera transformation), 조명처리와 셰이딩(Lighting and Shading), 투영(projecting), 클리핑(clipping) 및 화면 매핑(screen mapping) 단계로 나눌 수 있다. 모델 변환 및 시야 변환은 3차원 객체를 3차원 공간상의 월드 좌표계(world coordinate)로 변환하는 과정과 월드 좌표계로 변환된 3차원 객체를 시점(카메라) 을 기준으로 한 카메라 좌표계(camera coordinate)로 변환하는 과정이고, 조명 처리와 셰이딩은 3차원 객체의 현실감을 높이기 위해서 광원(light source)에 의한 반사효과 및 음영효과를 표현해주는 과정이다. 투영은 카메라 좌표계로 변환된 3차원 객체를 2차원 화면으로 투영하는 과정이고, 클리핑은 시야 영역(View volume) 에 포함되는 프리미티브만 래스터화 단계로 전달하기 위하여 시야 영역을 벗어난 프리미티브의 일부분을 잘라내는 과정이다. 화면 매핑은 투영된 객체가 실제로 화면상에 출력되는 좌표를 찾아내는 과정이다.Geometry phases can be divided into model transformations, model transformations, camera transformations, lighting and shading, projecting, clipping and screen mapping. Can be. Model transformation and field of view transformation converts 3D objects into world coordinates in 3D space and converts 3D objects transformed into world coordinates into camera coordinates based on a viewpoint (camera). Light processing and shading is a process of expressing the reflection effect and the shadow effect by the light source to increase the reality of the 3D object. Projection is the process of projecting a 3D object converted to a camera coordinate system onto a 2D screen. Clipping cuts out a part of the primitive outside the field of view so that only primitives included in the view volume are passed to the rasterization step. It is a process. Screen mapping is the process of finding the coordinates on which the projected object is actually output on the screen.
래스터화 단계는 기하 단계에서 제공된 3차원 객체의 각 정점(vertex)의 좌표, 색상(color) 그리고 텍스쳐 좌표(texture coordinate) 등을 이용하여 각 픽셀의 정확한 속성 값들을 지정하는 과정으로, 입력된 3차원 객체의 정점들의 정보를 이용하여 삼각형을 설정하고, 설정된 삼각형에서 에지 처리 및 스캔라인 처리 등의 과정을 거쳐 각 픽셀의 정확한 속성 값들을 지정한다.The rasterization step specifies the exact property values of each pixel using the coordinates, colors, and texture coordinates of each vertex of the three-dimensional object provided in the geometry step. The triangle is set by using the information of the vertices of the dimensional object, and the correct attribute values of each pixel are specified through the edge process and the scan line process.
특히, 투영은 3차원 그래픽 처리 과정에서 필수적인 과정으로서, 직교 투영(orthographic projection)과 원근 투영(perspective projection) 등의 방법이 있다. 직교 투영은 3차원 공간의 좌표계에서 x, y, z 축 가운데 한 축과 투영방향이 동일하고 투영면은 이 축과 직각이 되도록 배치하여 투영하는 방법이다. 직교 투영에서는 상대적인 크기가 유지되고 직각 방향에서 바라본 각도도 유지되면서 객체의 모습이 투영면에서 나타나므로 기계나 건축설계에 주로 사용된다. 그러나 직교 투영에서는 원근감이 표현되지 않으므로 현실감 있는 화면이 생성되지 않는다. 원근 투영에서는 직교 투영에서와 달리 투영선들이 평행을 이루지 않으며 따라서 투영면에 직각방향으로 투영되지 않는다. 원근 투영에서는 하나의 시점(카메라)에서 3차원 객체를 바라본 모습이 2차원 투영면에 나타나므로 투영선이 시점에 모이게 된다. 원근 투영을 이용하면 시점에서 멀리 떨어져 있는 객체는 작게 투영되고 가까이 있는 객체는 상대적으로 크게 투영이 되므로, 사람의 눈으로 3차원 사물을 보듯이 보다 현실감 있는 투영결과를 얻을 수 있다. 따라서 가상현실이나 게임, 애니메이션 등과 같이 현실감 있는 화면을 필요로 하는 경우 이러한 원근 투영을 이용한다.In particular, projection is an essential process in 3D graphics processing, and there are methods such as orthographic projection and perspective projection. Orthogonal projection is a method in which the projection direction is the same as one of the x, y, z axes in the three-dimensional space coordinate system and the projection plane is perpendicular to the axis. In orthogonal projection, it is mainly used in mechanical or architectural design because the relative size is maintained and the angle viewed from the orthogonal direction is maintained. In orthogonal projection, however, perspective is not expressed, so realistic pictures are not created. In perspective projection, unlike orthogonal projection, the projection lines are not parallel and therefore are not projected perpendicular to the projection plane. In perspective projection, the view of the three-dimensional object from one point of view (camera) appears on the two-dimensional projection plane, so the projection lines are collected at the viewpoint. With perspective projection, objects farther away from the view point are projected smaller and objects closer to each other are projected relatively larger, resulting in more realistic projection results as if a human eye sees a three-dimensional object. Therefore, if you need a realistic screen such as virtual reality, games, animations, such a perspective projection is used.
한편, 3차원 그래픽 처리 과정에서 원근 투영은 동차 좌표계(homogeneous coordinates system)에서 수행된다. 동차 좌표계란 3차원 점, 벡터, 행렬에 추가로 한 차원을 더 사용하는 좌표계이다. 동차 좌표계에서는 점을 x, y, z 세 가지 성분을 사용하여 표현하는 것이 아니라 x, y, z, w 네 가지 성분으로 나타낸다. 여기서 네 번째 성분인 w 성분을 동차 좌표(homogeneous coordinate)라고 한다. 동차 좌표계에서 원근 투영 변환은 4ㅧ4 행렬을 이용하여 수행되고, 이 투영 변환의 결과로서 좌표 (x′, y′, z′, w)가 얻어졌을 때, 이 좌표를 동차 좌표 w로 나눈 결과인 (x, y, z, 1)(여기서 x=x′/w, y=y′/w, z=z′/w, 1)이 화면 좌표가 된다. On the other hand, perspective projection is performed in a homogeneous coordinates system in the three-dimensional graphics processing. Homogeneous coordinate systems are coordinate systems that use one more dimension in addition to three-dimensional points, vectors, and matrices. In a homogeneous coordinate system, points are represented using four components, x, y, z, and w, rather than three components. The fourth component, w, is called homogeneous coordinate. In the homogeneous coordinate system, the perspective projection transformation is performed using a 4 ㅧ 4 matrix, and when the coordinates (x ', y', z ', w) are obtained as a result of this projection transformation, the coordinates divided by the homogeneous coordinate w (X, y, z, 1) (where x = x '/ w, y = y' / w, z = z '/ w, 1) is the screen coordinate.
3차원 객체의 각 정점들(vertices)에 대해서 원근 투영 변환이 수행되면, 래스터화 단계에서는 이 정점들 이외의 점들의 속성 값을 이 정점들의 속성 값을 이용하여 보간함으로써 구하게 된다. 이 때, 일반적인 선형 보간 방식을 이용할 경우 컬러 값 또는 텍스쳐 좌표 등에 있어서 원근 왜곡(perspective distortion)이 발생하게 된다. 도 1a는 컬러 값에 있어서 원근 왜곡이 발생하는 원리를 나타낸다. 도 1a에서 백색과 흑색으로 나타나 있는 두 정점이 원근 투영되는 경우 그 중간에 위치한 중간점은 원근 투영의 영향으로 두 정점 중 어느 하나, 예를 들어 흑색 점에 가깝게 위치하게 된다. 이처럼 흑색 점에 가깝게 위치한 중간점은 정회색이 나타나야 정상이지만 보간의 결과로 검정색에 가까운 회색이 나타나게 된다. 도 1b는 텍스쳐 좌표에 있어서 원근 왜곡이 발생하는 경우의 예를 나타낸다. 원근 왜곡이 발생하지 않는다면 텍스쳐 매핑의 결과로 도 1b의 좌측에서와 같은 정상적인 화면이 출력되어야 하지만, 텍스쳐 좌표 (u, v)를 선형 보간할 경우 도 1b의 우측에서와 같이 일그러진 화면이 출력된다.When perspective projection transformation is performed on each vertex of the three-dimensional object, the rasterization step obtains the property values of points other than these vertices by interpolating using the property values of these vertices. In this case, perspective distortion occurs in color values or texture coordinates when using general linear interpolation. 1A illustrates the principle that perspective distortion occurs in color values. In the case where two vertices shown in white and black in FIG. 1A are projected in perspective, an intermediate point located in the middle thereof is located close to one of the two vertices, for example, a black point under the influence of perspective projection. Like this, the middle point located close to the black point is normal only when gray is appeared, but gray color close to black appears as a result of interpolation. 1B illustrates an example in which perspective distortion occurs in texture coordinates. If perspective distortion does not occur, a normal screen as shown in the left side of FIG. 1B should be output as a result of texture mapping. However, when linear interpolation of the texture coordinates (u and v), a distorted screen is output as shown in the right side of FIG. 1B.
이러한 원근 왜곡을 보정하는 것을 원근 보정(perspective correction)이라 한다. 대표적인 원근 보정 기법으로 쌍곡선 보간(hyperbolic interpolation) 방식이 있다. 이 방식은 픽셀의 속성 값, 예를 들면 텍스쳐 좌표를 동차 좌표 w로 나눈 값 및 동차 좌표의 역수 1/w은 선형 특성을 가진다는 점을 기반으로 한다. 이하, 쌍곡선 보간 방식을 간단히 설명하기로 한다. 도 2는 쌍곡선 보간 방식을 설명하기 위한 도면이다. 세 정점에 의해서 형성된 삼각형의 어느 한 스캔 라인(21)의 양 끝점(22, 23)의 텍스쳐 좌표 및 동차 좌표를 각각 (u1, v1), w1 및 (u2, v2), w2라 하고, 이 스캔 라인 상의 임의의 점(24)의 텍스쳐 좌표 및 동차 좌표를 (u, v), w라 하자. 먼저, 양 끝점(22, 23)에 대하여, 텍스쳐 좌표를 동차 좌표로 나눈 값과 동차 좌표의 역수, 즉, (u1/w1, v1/w1), 1/w1, (u2/w2, v2/w2) 및 1/w2를 구한다. 다음으로, (u1/w1, v1/w1) 및 (u2/w2, v2/w2)를 이용하여 (u/w, v/w)를 선형 보간하고, 1/w1 및 1/w2를 이용하여 1/w을 선형 보간한다. 마지막으로, 보간된 (u/w, v/w)를 보간된 1/w로 나눈 값, 즉 ((u/w)/(1/w), (v/w)/(1/w))을 상기 임의의 점의 텍스쳐 좌표로서 구한다.Correcting this perspective distortion is called perspective correction. A representative perspective correction technique is hyperbolic interpolation. This approach is based on the fact that the attribute values of a pixel, for example, texture coordinates divided by homogeneous coordinates w and the
종래의 3차원 그래픽 처리 방법에서는 원근 보정을 하는 경우에 이러한 쌍곡선 보간(hyperbolic interpolation) 방식을 스캔 라인 상의 모든 픽셀에 대하여 수행하였다. 쌍곡선 보간 방식은 나눗셈 연산이 필수적이고, 이러한 나눗셈 연산을 위해서는 높은 계산 능력(computational power)이 요구된다. 특히 모바일 기기에서 주로 사용되는 ARM(Advanced RISC Machine) CPU는 각종 연산을 소프트웨어로 처리하기 때문에 나눗셈 연산에 많은 처리 시간과 높은 소비 전력을 소비하게 된다. 원근 왜곡이 발생하는 정도는 경우에 따라 달라질 수 있는데, 이를 고려하지 않고 모든 픽셀에 대하여 쌍곡선 보간 방식을 적용한다면 불필요하게 처리 시간과 소비 전력을 소모하는 결과를 초래하게 된다.In the conventional three-dimensional graphics processing method, this hyperbolic interpolation method is performed on all pixels on a scan line when perspective correction is performed. The hyperbolic interpolation method requires a division operation, and a high computational power is required for this division operation. In particular, the ARM (Advanced RISC Machine) CPU, which is mainly used in mobile devices, processes various operations by software, which consumes a lot of processing time and high power consumption for division operations. The degree of perspective distortion may vary from case to case. If the hyperbolic interpolation method is applied to all pixels without considering this, the processing time and power consumption are unnecessarily consumed.
본 발명이 이루고자 하는 기술적 과제는 원근 왜곡이 발생하는 정도를 고려하여 원근 보정을 선택적으로 적용함으로써 짧은 처리 시간과 낮은 소비 전력을 실현하는 원근 보정을 수행하는 3차원 그래픽 처리 방법을 제공하는 데 있다.An object of the present invention is to provide a three-dimensional graphics processing method for performing perspective correction to achieve a short processing time and low power consumption by selectively applying perspective correction in consideration of the degree of perspective distortion.
또한, 본 발명이 이루고자 하는 다른 기술적 과제는 원근 왜곡이 발생하는 정도를 고려하여 원근 보정을 선택적으로 적용함으로써 짧은 처리 시간과 낮은 소비 전력을 실현하는 원근 보정을 수행하는 3차원 그래픽 처리 장치를 제공하는 데 있다.In addition, another technical problem to be achieved by the present invention is to provide a three-dimensional graphics processing apparatus for performing perspective correction to realize a short processing time and low power consumption by selectively applying perspective correction in consideration of the degree of perspective distortion occurs There is.
또한, 본 발명이 이루고자 하는 또 다른 기술적 과제는 상기 본 발명에 따른 3차원 그래픽 처리 방법을 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체를 제공하는 데 있다.Another object of the present invention is to provide a computer-readable recording medium having recorded thereon a program for executing the three-dimensional graphics processing method according to the present invention.
상기 기술적 과제를 해결하기 위하여 본 발명에 따른 3차원 그래픽 처리 방법은 (a) 원근 투영된 복수 개의 정점으로 이루어지는 다각형의 스캔 라인의 양 끝점 각각에 대한 동차 좌표 및 속성 값을 입력받는 단계; (b) 상기 입력받은 동차 좌표를 이용하여 상기 스캔 라인에서의 원근 왜곡의 정도를 나타내는 기준 값을 계산하는 단계; 및 (c) 상기 입력받은 동차 좌표 및 속성 값 중 적어도 일부를 이용하여 상기 스캔 라인의 픽셀들 각각의 속성 값을 보간하되, 상기 계산된 기준 값에 따라 픽셀 별로 원근 보정을 선택적으로 적용하여 상기 속성 값을 보간하는 단계를 포함한다. In order to solve the above technical problem, a three-dimensional graphic processing method according to the present invention comprises the steps of: (a) receiving homogeneous coordinates and property values for each end point of the scan line of the polygon consisting of a plurality of perspective projections; (b) calculating a reference value representing the degree of perspective distortion in the scan line using the received homogeneous coordinates; And (c) interpolating an attribute value of each pixel of the scan line using at least some of the received homogeneous coordinates and attribute values, and selectively applying perspective correction for each pixel according to the calculated reference value. Interpolating the values.
또한, 상기 복수 개의 정점은 세 개의 정점이고, 상기 다각형은 삼각형일 수 있다. In addition, the plurality of vertices may be three vertices, and the polygon may be a triangle.
또한, 상기 (b) 단계는 상기 양 끝점 각각에 대한 동차 좌표 중 적어도 하나와 상기 스캔 라인의 인접 픽셀 간의 동차 좌표의 변화량을 기초로 상기 기준 값을 계산할 수 있다.In addition, in the step (b), the reference value may be calculated based on a change amount of the homogeneous coordinates between at least one of the homogeneous coordinates for each of the end points and an adjacent pixel of the scan line.
또한, 상기 기준 값은 상기 양 끝점 각각에 대한 동차 좌표 중 적어도 하나와 상기 스캔 라인의 인접 픽셀 간의 동차 좌표의 변화량의 비율일 수 있다. The reference value may be a ratio of a change amount of homogeneous coordinates between at least one of the homogeneous coordinates for each of the end points and an adjacent pixel of the scan line.
또한, 상기 양 끝점 각각에 대한 동차 좌표 중 적어도 하나와 상기 스캔 라인의 인접 픽셀 간의 동차 좌표의 변화량은 각각 소정 진수로 표현되고, 상기 기준 값은 상기 표현된 각 소정 진수의 자리수를 이용하여 계산될 수 있다.In addition, the amount of change of the homogeneous coordinates between at least one of the homogeneous coordinates for each of the end points and the adjacent pixels of the scan line is represented by a predetermined number, respectively, and the reference value is calculated using the number of digits of each of the predetermined decimal values expressed. Can be.
또한, 상기 각 소정 진수의 자리수는 상기 표현된 각 소정 진수를 시프트 변환함으로써 얻어질 수 있다.Further, the number of digits in each of the predetermined decimal digits can be obtained by shift converting each of the predetermined decimal digits represented.
또한, 상기 기준 값은 상기 양 끝점 각각에 대한 동차 좌표 중 적어도 하나와 상기 스캔 라인의 인접 픽셀 간의 동차 좌표의 변화량 각각의 로그 값을 이용하여 계산될 수 있다.In addition, the reference value may be calculated using a log value of each change amount of homogeneous coordinates between at least one of the homogeneous coordinates for each of the end points and an adjacent pixel of the scan line.
또한, 상기 (c) 단계는 쌍곡선 보간(hyperbolic interpolation) 방식을 이용함으로써 원근 보정을 적용하여 상기 속성 값을 보간할 수 있다.In the step (c), the attribute value may be interpolated by applying perspective correction by using a hyperbolic interpolation method.
또한, 제1항에 있어서, 상기 (c) 단계는, (c1) 상기 계산된 기준 값에 기초하여, 원근 보정을 적용하여 보간할 픽셀들을 결정하는 단계; (c2) 상기 결정된 결과에 따라, 상기 결정된 픽셀들 각각의 속성 값을 원근 보정을 적용하여 보간하는 단계; 및 (c3) 상기 결정된 픽셀들 이외의 픽셀들 각각의 속성 값을 선형 보간하는 단계를 포함할 수 있다.The method of
또한, 상기 (c2) 단계는, (cc1) 상기 양 끝점 각각에 대하여 속성 값을 동차 좌표로 나눈 값을 이용하여, 상기 결정된 픽셀들 중 어느 하나의 픽셀에 대하여 속성 값을 동차 좌표로 나눈 값을 선형 보간하는 단계; (cc2) 상기 양 끝점 각각에 대한 동차 좌표의 역수를 이용하여, 상기 어느 하나의 픽셀에 대하여 동차 좌표의 역수를 선형 보간하는 단계; 및 (cc3) 상기 선형 보간된, 속성 값을 동차 좌표로 나눈 값을 상기 선형 보간된, 동차 좌표의 역수로 나눔으로써, 원근 보정을 적용하여 보간된 속성 값을 산출하는 단계를 포함할 수 있다. In addition, in the step (c2), the value obtained by dividing the property value by the homogeneous coordinate for one of the determined pixels is determined by using the value obtained by dividing the property value by the homogeneous coordinate for each of the two endpoints. Linear interpolation; (cc2) linearly interpolating the inverse of the homogeneous coordinates for the one pixel using the inverse of the homogeneous coordinates for each of the two endpoints; And (cc3) calculating the interpolated attribute value by applying perspective correction by dividing the linearly interpolated attribute value divided by homogeneous coordinates by the inverse of the linear interpolated homogeneous coordinate.
또한, 상기 (c3) 단계는 상기 양 끝점 각각에 대한 속성 값 및 상기 원근 보정을 적용하여 보간된 속성 값 중 적어도 일부를 이용하여 상기 결정된 픽셀들 이외의 픽셀들 각각의 속성 값을 선형 보간할 수 있다.In addition, the step (c3) may linearly interpolate the attribute values of the pixels other than the determined pixels using at least some of the attribute values for each of the two endpoints and the interpolated attribute values by applying the perspective correction. have.
또한, 상기 속성 값은 텍스쳐 좌표, 분산 색상(diffuse color) 및 반사 색상(specular color) 중 적어도 하나를 포함할 수 있다.In addition, the attribute value may include at least one of a texture coordinate, a diffuse color, and a specular color.
상기 다른 기술적 과제를 해결하기 위하여 본 발명에 따른 3차원 그래픽 처리 장치는 원근 투영된 복수 개의 정점으로 이루어지는 다각형의 스캔 라인의 양 끝점 각각에 대한 동차 좌표를 입력받고, 상기 입력받은 동차 좌표를 이용하여 상기 스캔 라인에서의 원근 왜곡의 정도를 나타내는 기준 값을 계산하는 기준 값 계산부; 및 상기 동차 좌표 및 상기 양 끝점 각각에 대한 속성 값 중 적어도 일부를 이용하여 상기 스캔 라인의 픽셀들 각각의 속성 값을 보간하되, 상기 계산된 기준 값에 따라 픽셀 별로 원근 보정을 선택적으로 적용하여 상기 속성 값을 보간하는 보간부를 포함한다.In order to solve the other technical problem, the 3D graphic processing apparatus according to the present invention receives homogeneous coordinates for each end point of a polygonal scan line composed of a plurality of perspective projections, and uses the received homogeneous coordinates. A reference value calculator configured to calculate a reference value representing a degree of perspective distortion in the scan line; And interpolating the property values of the pixels of the scan line using at least some of the homogeneous coordinates and the property values of each of the endpoints, and selectively applying perspective correction for each pixel according to the calculated reference value. Includes an interpolator that interpolates attribute values.
또한, 상기 보간부는, 상기 계산된 기준 값에 기초하여, 원근 보정을 적용하여 보간할 픽셀들을 결정하는 결정부; 상기 결정된 결과에 따라 상기 결정된 픽셀들 각각의 속성 값을 원근 보정을 적용하여 보간하는 제1 보간부; 및 상기 결정된 픽셀들 이외의 픽셀들 각각의 속성 값을 선형 보간하는 제2 보간부를 포함할 수 있다.The interpolation unit may further include: a determination unit determining pixels to be interpolated by applying perspective correction based on the calculated reference value; A first interpolation unit which interpolates the attribute values of each of the determined pixels according to the determined result by applying perspective correction; And a second interpolator configured to linearly interpolate attribute values of pixels other than the determined pixels.
또한, 상기 제1 보간부는, 상기 양 끝점 각각에 대하여 속성 값을 동차 좌표로 나눈 값을 이용하여, 상기 결정된 픽셀들 중 어느 하나의 픽셀에 대하여 속성 값을 동차 좌표로 나눈 값을 선형 보간하고, 상기 양 끝점 각각에 대한 동차 좌표의 역수를 이용하여, 상기 어느 하나의 픽셀에 대하여 동차 좌표의 역수를 선형 보간하는 선형 보간부; 및 상기 선형 보간된, 속성 값을 동차 좌표로 나눈 값을 상기 선형 보간된, 동차 좌표의 역수로 나눔으로써, 원근 보정을 적용하여 보간된 속성 값을 산출하는 속성 값 산출부를 포함할 수 있다.The first interpolator may linearly interpolate a value obtained by dividing a property value by homogeneous coordinates for any one of the determined pixels using a value obtained by dividing the property value by homogeneous coordinates for each of the two endpoints, A linear interpolator for linearly interpolating the inverse of the homogeneous coordinates with respect to any one pixel by using the inverse of the homogeneous coordinates for each of the two endpoints; And an attribute value calculation unit configured to calculate the interpolated attribute value by applying perspective correction by dividing the linearly interpolated attribute value divided by homogeneous coordinates by the inverse of the linear interpolated homogeneous coordinates.
또한, 상기 제2 보간부는 상기 양 끝점 각각에 대한 속성 값 및 상기 원근 보정을 적용하여 보간된 속성 값 중 적어도 일부를 이용하여 상기 결정된 픽셀들 이외의 픽셀들 각각의 속성 값을 선형 보간할 수 있다.The second interpolator may linearly interpolate attribute values of pixels other than the determined pixels using at least some of the attribute values of each of the endpoints and the interpolated attribute values by applying the perspective correction. .
상기 또 다른 기술적 과제를 해결하기 위하여 상기된 본 발명에 따른 3차원 그래픽 처리 방법을 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체를 제공한다.In order to solve the above another technical problem, a computer-readable recording medium having a program for executing the above-described three-dimensional graphics processing method is provided.
이하에서는 도면을 참조하여 본 발명의 바람직한 실시예들을 상세히 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.
도 3은 본 발명의 바람직한 일 실시예에 따른 3차원 그래픽 처리 장치의 구성을 도시한 블록도로서, 월드 변환부(31), 카메라 변환부(32), 투영 변환부(34), 래스터라이저(34)를 포함한다.3 is a block diagram showing the configuration of a three-dimensional graphics processing apparatus according to an embodiment of the present invention, a
월드 변환부(31)는 로컬 좌표계에서 정의된 3차원 객체를 3차원 공간 상의 월드 좌표계로 변환한다. 월드 변환부(31)는 이동(translation), 회전(rotation), 크기 변환(scaling) 등의 변환을 수행한다.The
카메라 변환부(32)는 월드 좌표계로 변환된 3차원 객체를 시점(카메라)를 기 준으로 한 카메로 좌표계로 변환한다.The
투영 변환부(33)는 카메라 좌표계로 변환된 3차원 객체를 2차원 화면으로 투영한다. 투영 변환부(33)는 원근 투영 행렬을 이용하여 3차원 객체를 이루는 각 정점에 대하여 투영 변환을 수행한다. 투영 변환의 결과 각 정점의 속성 값, 예를 들면 화면 좌표, 텍스쳐 좌표, 분산 색상(diffuse color), 반사 색상(specular color) 등과 동차 좌표 w가 얻어진다. 한편, 동차 좌표 w를 저장하는 저장부를 더 포함하여, 얻어진 동차 좌표를 저장하여 놓을 수도 있다. The
래스터라이저(34)는 투영 변환부로부터의 각 정점의 속성 값 및 동차 좌표를 이용하여 각 픽셀의 최종 속성 값을 지정한다. 래스터라이저(34)에 관하여는 도 4 등을 참조하여 보다 상세히 설명한다.The
도 4는 본 발명의 일 실시예에 따른 래스터라이저(34)의 구성을 도시한 블록도로서, 삼각형 설정부(41), 에지 처리부(42), 스캔라인 처리부(43), 픽셀 처리부(44)를 포함한다.FIG. 4 is a block diagram showing the configuration of the
삼각형 설정부(41)는 입력된 3차원 객체의 정점을 세 개씩 묶어 삼각형을 설정한다. 다양한 모양의 객체들은 어느 하나의 형태를 갖는 폴리곤들의 집합으로 표현될 수 있는데, 계산량을 줄이기 위하여 여러 형태의 폴리곤들 중 가장 단순한 형태인 삼각형이 주로 이용된다. 이하에서는 폴리곤을 삼각형으로 특정하고 본 실시예를 설명하기로 한다. 다만, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 삼각형 이외의 다른 다각형 형태의 폴리곤들도 본 실시예에 적용될 수 있음을 이해할 수 있다. The
에지 처리부(42)는 설정된 삼각형을 이루는 정점의 속성 값 등을 이용하여 삼각형의 에지를 이루는 픽셀의 속성 값 등을 구한다. 에지 처리부(42)에 관하여는 도 5 등을 참조하여 보다 상세히 설명한다.The
스캔라인 처리부(43)는 삼각형의 에지를 이루는 픽셀의 속성 값 등을 이용하여 삼각형의 스캔라인 상의 픽셀에 대하여 속성 값 등을 구한다. 스캔라인 처리부(43)에 관하여는 도 6 등을 참조하여 보다 상세히 설명한다.The
픽셀 처리부(44)는 에지 처리부(42)와 스캔라인 처리부(44)에서 구해진 속성 값 등을 기초로 각 픽셀의 최종 속성 값을 지정한다. 이를 위하여 픽셀 처리부(44)는 텍스쳐 매핑, 알파 테스트, 깊이 테스트, 컬러 블렌딩 등의 각종 처리를 수행한다. The
도 5는 본 발명의 일 실시예에 따른 에지 처리부(42)의 구성을 도시한 블록도로서, 제1 계산부(51), 선형 보간부(52), 제1 속성 값 산출부(53)를 포함한다.FIG. 5 is a block diagram illustrating a configuration of an
제1 계산부는(51)는 삼각형의 각 정점에 대하여 동차 좌표의 역수 및 속성 값을 동차 좌표로 나눈 값을 계산한다. 예를 들어 삼각형의 에지들 중 어느 하나의 에지를 이루는 두 정점을 V1, V2라 하고, 각각의 동차 좌표를 w1, w2라 하고, 각각의 속성 값을 a1, a2라 할 때, 제1 계산부(51)는 1/w1, 1/w2, a1/w1, a2/w2를 계산한다. 이 속성 값 중 텍스쳐 좌표는 (u, v) 형태로 표현될 수 있고, 분산 색상과 반사 색상은 (r, g, b) 형태로 표현될 수 있다. The
그리고, 속성 값을 구하고자 하는 픽셀의 속성 값 및 동차 좌표를 각각 a, w라 하면, 선형 보간부(52)는 1/w1과 1/w2를 이용하여 에지 상의 각 픽셀에 대하여 보간된 1/w 값을 구하고, a1/w1과 a2/w2를 이용하여 에지 상의 각 픽셀에 대하여 보간된 a/w 값을 구한다. If the attribute value and homogeneous coordinates of the pixel for which the attribute value is to be obtained are a and w, respectively, the
마지막으로, 속성 값 산출부(53)는 선형 보간부(52)에서 보간된 a/w를 역시 보간된 1/w로 나눔으로써 에지 상의 픽셀의 속성 값을 구한다.Finally, the
상기된 바와 같은 에지 처리부(42)의 처리로 인하여 삼각형의 에지 상의 픽셀들에 대하여 원근 보정이 적용된 속성 값들 및 동차 좌표 w를 산출할 수 있다. 그리고 에지 처리부(42)에서 산출된 에지 상의 픽셀들 각각의 속성 값 및 동차 좌표는 후술할 스캔라인 처리부(43)로 각 스캔라인 양 끝점의 속성 값 및 동차 좌표로서 입력된다.Due to the processing of the
도 6은 본 발명의 일 실시예에 따른 스캔라인 처리부(43)의 구성을 도시한 블록도로서, 기준 값 계산부(61) 및 보간부(62)를 포함한다.FIG. 6 is a block diagram illustrating a configuration of a
기준 값 계산부(61)는 입력받은 스캔라인의 양 끝점의 동차 좌표 w를 이용하여 스캔라인에서의 원근 왜곡의 정도를 나타내는 기준 값을 계산한다. The
우선, 도 7을 참조하여 본 실시예에 따른 스캔라인에서의 원근 왜곡의 정도를 나타내는 기준에 관하여 설명한다. 원근 왜곡은 시점으로부터의 거리가 멀수록, 그리고 두 점 사이의 시선 방향(z 방향)에 대한 기울기가 클수록 그 정도가 심해진다. 도 7에서, 스캔라인(71) 양 끝점에 해당하는 픽셀들(72, 73) 각각의 동차 좌표를 w1, w2라 하면, 스캔라인의 인접 픽셀 간의 동차 좌표의 변화량 ws은 예를 들어, 다음 수학식을 이용하여 구할 수 있다. First, with reference to FIG. 7, the reference indicating the degree of perspective distortion in the scan line according to the present embodiment will be described. Perspective distortion becomes more severe as the distance from the viewpoint and the inclination to the visual direction (z direction) between two points becomes greater. In FIG. 7, when the homogeneous coordinates of each of the
여기서 n은 픽셀(72)로부터 픽셀(73)까지의 픽셀의 개수에 해당하고, w2가 w1보다 크다고 가정한다.Here, n corresponds to the number of pixels from the
만일 w1 또는 w2가 ws에 비해 상당히 크다면, 픽셀 간의 동차 좌표의 변화가 해당 픽셀의 동차 좌표 자체에 비해 매우 작고, 따라서 시선 방향의 기울기가 매우 작거나 시점으로부터의 거리가 매우 가깝다는 것을 의미한다. 이 경우 원근 왜곡이 거의 발생하지 않으므로 원근 보정의 필요성이 상대적으로 작다고 볼 수 있다. 반면에, w1 또는 w2가 ws에 비해 별로 크지 않다면, 픽셀 간의 동차 좌표의 변화가 해당 픽셀의 동차 좌표 자체에 비해 비교적 크고, 따라서 시선 방향의 기울기가 매우 크거나 시점으로부터의 거리가 매우 멀다는 것을 의미한다. 이 경우 원근 왜곡이 두드러지게 발생하므로 원근 보정의 필요성이 상대적으로 크다고 볼 수 있다. If w1 or w2 are significantly larger than ws, then the change in homogeneous coordinates between pixels is very small compared to the homogeneous coordinates of the pixels themselves, which means that the line of sight inclination is very small or the distance from the viewpoint is very close. . In this case, perspective distortion hardly occurs, so the need for perspective correction is relatively small. On the other hand, if w1 or w2 is not very large compared to ws, then the change in homogeneous coordinates between pixels is relatively large compared to the homogeneous coordinates of the corresponding pixels, so that the line of sight inclination is very large or the distance from the viewpoint is very large. it means. In this case, perspective distortion is prominent, so perspective correction is relatively large.
따라서 w1 또는 w2와 ws의 비율, 즉 w1/ws 또는 w2/ws를 원근 왜곡이 발생하는 정도의 기준으로 삼을 수 있다. 구체적으로는, w1/ws 또는 w2/ws가 크다면 원근 왜곡이 작다고 판단하고, w1/ws 또는 w2/ws가 작다면 원근 왜곡이 크다고 판단할 수 있는 것이다. Therefore, the ratio of w1 or w2 and ws, that is, w1 / ws or w2 / ws, may be used as a reference for the degree of perspective distortion. Specifically, if w1 / ws or w2 / ws is large, it is determined that perspective distortion is small. If w1 / ws or w2 / ws is small, perspective distortion may be large.
나아가, 원근 왜곡이 비교적 작다고 판단된다면, 즉 w1/ws 또는 w2/ws가 크다면, 스캔라인(71) 상의 모든 픽셀들에 대하여 원근 보정을 적용하여 속성 값을 보간하지 않고 일부 픽셀들에 대하여만 원근 보정을 적용하여 속성 값을 보간함으로써 원근 보정으로 인한 계산량을 감소시킬 수 있는 것이다. 한편, 원근 왜곡이 비교적 크다고 판단되는 경우, 즉 w1/ws 또는 w2/ws가 작은 경우라면 원근 보정을 적용하여 보간할 픽셀들의 수를 증가시킬 수 있다.Furthermore, if it is determined that the perspective distortion is relatively small, i.e. if w1 / ws or w2 / ws is large, the perspective correction is applied to all the pixels on the
기준 값 계산부(61)는 우선 스캔라인(71) 양 끝점에 해당하는 픽셀들(72, 73) 각각의 동차 좌표 w1, w2를 이용하여, 예를 들면 상기된 수학식 1을 사용하여 인접 픽셀 간의 동차 좌표의 변화량 ws를 계산한다. 그리고, 기준 값 계산부(61)는 동차 좌표 w1(또는 w2) 및 ws를 이용하여 원근 왜곡의 정도를 나타내는 기준 값을 계산한다. 상술한 바와 같이 기준 값은 w1 또는 w2 중 임의의 값을 이용하여 계산할 수 있는 바, 이하에서는 w1을 사용하는 것을 전제로 설명하며, w1 대신에 w2를 사용할 수도 있음은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 이해할 수 있다.The
이하, 원근 왜곡을 나타내는 기준 값을 무엇으로 삼을 것인지에 관하여 구체적으로 설명한다. 위에서 살펴본 바와 같이 w1을 ws로 나눈 값, 즉 w1/ws를 기준 값으로 삼을 수 있음은 물론이나, 이 경우 나눗셈 연산이 포함되어 있고, 원근 왜곡의 정도를 나타내기 위해서는 w1/ws 값 자체보다는 w1과 ws의 상대적인 차이가 의미있는 지표이므로, 계산량을 줄이기 위해서 w1/ws를 근사화할 필요가 있다. 이를 위한 한 가지 방법으로 로그 연산을 사용하는 방법이 있다. 이 경우 기준 값은 예를 들어 다음 수학식에 따라 계산될 수 있다.Hereinafter, what will be used as the reference value which shows perspective distortion is demonstrated concretely. As mentioned above, w1 divided by ws, that is, w1 / ws can be used as a reference value, but in this case, a division operation is included, and in order to express the degree of perspective distortion, Since the relative difference between w1 and ws is a meaningful indicator, we need to approximate w1 / ws to reduce the computation. One way to do this is to use log operations. In this case, the reference value may be calculated according to the following equation, for example.
여기서, c는 원근 왜곡의 정도를 나타내는 기준 값을 의미하며, n, m은 정수이다.Here, c means a reference value indicating the degree of perspective distortion, n, m is an integer.
여기서, 정수 n, m은 원근 왜곡의 정도를 수치적으로 표현함에 있어서 임의로 선택 가능한 파라미터로서, 뒤에 설명할, 이 기준 값에 따라 원근 보정을 적용할 픽셀을 결정하는 방법과 함께 실험 또는 시뮬레이션 등에 기초하여 적절한 값을 선택할 수 있다.Herein, the integers n and m are parameters that can be arbitrarily selected in numerically expressing the degree of perspective distortion. To select the appropriate value.
w1/ws를 근사화하는 또 한가지 방법으로는 소정 진수, 예를 들어 이진수로 표현된 w1 및 ws의 자리수의 차이를 이용하는 방법이 있다. 이 경우, 기준 값은 예를 들어 다음 수학식에 따라 계산될 수 있다.Another way to approximate w1 / ws is to take advantage of the difference in the number of digits of w1 and ws expressed in a given number, for example binary. In this case, the reference value can be calculated according to the following equation, for example.
여기서, c는 원근 왜곡의 정도를 나타내는 기준 값을 의미하며, p, q는 정수로서 수학식 2의 m, n과 마찬가지로, 임의로 선택 가능한 파라미터이다. shift operation(x)는 이진수로 표현된 x를 우향 자리 이동(right shift)할 경우 0의 결과값을 얻을 때까지의 우향 자리 이동 횟수를 의미한다. 예를 들어, ws가 5이고, 이진수로 0x0101로 표현될 경우 shift operation(5)의 결과 값은 3이 된다. Here, c means a reference value indicating the degree of perspective distortion, p, q is an integer, as in m, n of the equation (2) as an integer, can be arbitrarily selectable parameters. The shift operation (x) means the number of shifts of the right-hand position until a result value of 0 is obtained when the right-handed shift of the x represented by a binary number is performed. For example, if ws is 5 and is represented by 0x0101 in binary, the result of shift operation (5) is 3.
이상, w1/ws를 근사화하기 위한 방법의 예를 두 가지 설명하였으나, 이는 예시적인 것에 불과하며, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자라면 이 외에도 다양한 근사화 방법이 존재할 수 있음을 이해할 것이다. In the above, two examples of a method for approximating w1 / ws have been described, but these are merely exemplary, and those skilled in the art to which the present invention pertains understand that there may be various approximation methods. will be.
보간부(62)는 스캔 라인(71)의 픽셀들 각각의 속성 값을 보간하는데, 특히, 기준 값 계산부(61)에서 계산된 기준 값에 따라 원근 보정을 선택적으로 적용하여 속성 값을 보간한다. 구체적으로, 보간부(62)는 동차 좌표 w1, w2와 스캔 라인 양 끝점에 해당하는 픽셀에 대한 속성 값을 이용하여 원근 보정을 적용하여 속성 값을 보간하거나, 스캔 라인 양 끝점에 해당하는 픽셀에 대한 속성 값 또는 원근 보정을 적용하여 보간된 속성 값을 이용하여 원근 보정을 적용하지 않고 선형 보간 방식을 이용하여 픽셀의 속성 값을 보간한다.The
도 8은 본 발명의 일 실시예에 따른 보간부(62)의 구성을 도시한 블록도로서, 결정부(81), 제1 보간부(82) 및 제2 보간부(83)를 포함한다.8 is a block diagram illustrating a configuration of an
결정부(81)는 기준 값 계산부(61)에서 계산된 기준 값에 기초하여 원근 보정을 적용하여 보간할 픽셀들을 결정한다. 이하, 도 9를 참조하여 보다 상세히 설명한다. 결정부(81)는 스캔 라인 양 끝점에 해당하는 픽셀들(72, 73) 중 어느 하나의 픽셀, 예를 들어 픽셀(72)을 기준으로, 원근 보정을 적용하여 보간할 픽셀들 간의 스텝의 크기를 정함으로써, 원근 보정을 적용하여 보간할 픽셀들을 결정할 수 있다. 이 스텝의 크기를 3으로 정하였을 때, 원근 보정을 적용하여 보간할 픽셀들(74, 75)을 도 9에서 두꺼운 박스로 표시하였다. 즉, 결정부(81)는 스텝의 크기를 3으로 정함으로써, 픽셀(72)로부터 세 번째, 여섯 번째의 픽셀들을 원근 보정을 적용하여 보간할 픽셀들로 결정할 수 있다. 물론, 결정부(81)는 원근 보정을 적용하지 않고 보간할 픽셀들 간의 스텝의 크기를 정함으로써, 원근 보정을 적용하여 보간할 픽셀들을 결정할 수도 있다. The
또한, 결정부(81)는 기준 값 계산부(61)에서 계산된 기준 값이 클수록, 즉 원근 왜곡이 적을수록 원근 보정을 적용하여 보간할 픽셀의 수를 적게 하고, 기준 값 계산부(61)에서 계산된 기준 값이 작을수록, 즉 원근 왜곡이 클수록 원근 보정 을 적용하여 보간할 픽셀의 수를 많게 한다. 예를 들어, 결정부(81)는 기준 값 계산부(61)에서 계산된 기준 값이 클수록 스텝의 크기를 크게 하고, 기준 값이 작을수록 스텝의 크기를 작게 함으로써 원근 보정을 적용하여 보간할 픽셀의 수를 조정할 수 있다. In addition, the
한편, 결정부(81)가 기준 값 계산부(61)에서 계산된 기준 값에 기초하여 원근 보정을 적용하여 보간할 픽셀의 수를 결정하거나, 또는 스텝의 크기를 결정하는 방법으로는, 기준 값의 범위에 따라 픽셀의 수 또는 스텝의 크기가 대응되도록 지정된 룩업 테이블을 마련하여 결정할 수도 있고, 기준 값을 이용하여 미리 정해 놓은 연산을 수행함으로써, 픽셀의 수 또는 스텝의 크기가 산출되도록 할 수도 있다. On the other hand, the
제1 보간부(82)는 결정부(81)에 의해 원근 보정을 적용하여 보간하기로 결정된 픽셀들의 속성 값을 원근 보정을 적용하여, 예를 들면 쌍곡선 보간 방식으로 보간한다.The
제1 보간부(82)는 제2 계산부(84), 선형 보간부(85) 및 속성 값 산출부(86)를 포함하여 이루어진다. 제2 계산부는(84)는 스캔 라인 양 끝점 각각에 해당하는 픽셀에 대하여 동차 좌표의 역수 및, 속성 값을 동차 좌표로 나눈 값을 계산한다. 예를 들어 스캔 라인(71) 양 끝점에 해당하는 픽셀들(72, 73) 각각의 동차 좌표를 w1, w2라 하고, 각각의 속성 값을 a1, a2라 할 때, 제2 계산부(84)는 1/w1, 1/w2, a1/w1, a2/w2를 계산한다. 이 속성 값 중 텍스쳐 좌표는 (u, v) 형태로 표현될 수 있고, 분산 색상과 반사 색상은 (r, g, b) 형태로 표현될 수 있다. The
그리고, 선형 보간부(85)는 결정부(81)에 의해 원근 보정을 적용하여 보간하 기로 결정된 픽셀들, 예를 들면 도 9에 도시된 픽셀들(74, 75) 각각에 대하여 동차 좌표의 역수 및, 속성 값을 동차 좌표로 나눈 값을 보간하여 구한다. 즉, 픽셀(74)의 속성 값 및 동차 좌표를 각각 a, w라 하면, 선형 보간부(52)는 1/w1과 1/w2를 이용하여, 1/w 값을 선형 보간하여 구하고, a1/w1과 a2/w2를 이용하여, a/w 값을 선형 보간하여 구한다. In addition, the
마지막으로, 속성 값 산출부(53)는 선형 보간된, 속성 값을 동차 좌표로 나눈 값을 선형 보간된, 동차 좌표의 역수로 나눔으로써 원근 보정을 적용하여 원근 보정을 적용하여 보간된 속성 값을 산출한다. 예를 들어, 픽셀(74)에 대하여, a/w 값을 1/w로 나눔으로써 원근 보정을 적용하여 보간된 속성 값 a를 구한다. Finally, the attribute
제2 보간부(83)는 결정부(81)에 의해 원근 보정을 적용하여 보간하기로 결정된 픽셀들 이외의 픽셀들을 원근 보정을 적용하지 않고, 선형 보간 방식으로 보간한다. 도 9를 참조하여 보다 상세히 설명한다. 예를 들어, 픽셀들(74, 75)가 원근 보정을 적용하여 보간하기로 결정된 경우, 픽셀들(74, 75) 및 스캔 라인 양 끝점에 해당하는 픽셀들(72, 73) 이외의 픽셀들, 예를 들어 픽셀들(76, 77) 등이 제2 보간부(83)가 보간할 픽셀들이 된다. 이 경우, 제2 보간부(83)는 픽셀(72)의 속성 값과 픽셀(74)의 속성 값을 이용하여 픽셀(76)의 속성 값을 선형 보간한다. 한편, 픽셀(77)에 관하여, 제2 보간부(83)는 속성 값 산출부(86)에서 구해진 픽셀(74)의 속성 값과 픽셀(75)의 속성 값을 이용하여 픽셀(77)의 속성 값을 선형 보간한다.The
상기된 바와 같은 결정부(81), 제1 보간부(82) 및 제2 보간부의 구성에 의하면, 기준 값 계산부(61)에서 결정된 기준 값에 따른 스캔 라인 상의 일부 픽셀 관 하여는 원근 보정을 적용하여 속성 값을 보간하고, 그 나머지 픽셀에 관하여는 선형 보간 방식을 적용하여 속성 값을 보간할 수 있다. 따라서 원근 보정을 적용하기 위해 요구되는 나눗셈 연산이 수행되는 횟수가 감소하기 때문에, 모든 픽셀에 대하여 일괄적으로 원근 보정을 적용하던 방식에 비하여 계산량이 현저히 줄어들게 된다. 게다가, 원근 왜곡의 정도를 고려하여 적응적으로 원근 보정을 적용할 픽셀의 수가 결정되므로, 일괄적으로 원근 보정을 적용하던 방식과 비교할 때 일부 픽셀에 대하여 원근 보정을 적용하지 않음으로 발생할 수 있는 화질의 저하 또한 최소화시킬 수 있다.According to the configuration of the
도 10은 본 발명의 일 실시예에 따른 3차원 그래픽 처리 방법을 나타낸 흐름도이다. 본 실시예에 따른 그래픽 처리 방법은 이상에서 설명된 3차원 그래픽 처리 장치에서 처리되는 단계들로 구성된다. 따라서 이하 생략된 내용이라 하더라도 3차원 그래픽 처리 장치에 관하여 이상에서 기술된 내용은 본 실시예에 따른 3차원 그래픽 처리 방법에도 적용된다.10 is a flowchart illustrating a 3D graphic processing method according to an embodiment of the present invention. The graphics processing method according to the present embodiment is composed of the steps processed in the three-dimensional graphics processing apparatus described above. Therefore, even if omitted below, the contents described above with respect to the 3D graphics processing apparatus are also applied to the 3D graphics processing method according to the present embodiment.
제 101단계에서 3차원 그래픽 처리 장치는 스캔라인 양 끝점 각각에 대한 속성 값 및 동차 좌표를 입력받는다. In
제102단계에서 3차원 그래픽 처리 장치는 입력받은 동차 좌표를 이용하여 해당 스캔라인에서의 원근 왜곡의 정도를 나타내는 기준 값을 계산한다. 이 기준 값은 스캔라인의 양 끝점 각각에 대한 동차 좌표 중 어느 하나와 인접 픽셀 간의 동차 좌표의 변화량을 기초로 계산될 수 있다.In
제103단계에서 3차원 그래픽 처리 장치는 제102단계에서 계산된 기준 값에 따라 해당 스캔라인 상에서 각 픽셀 별로 원근 보정을 선택적으로 적용하여 각 픽셀의 속성 값을 보간한다. 제103단계에서는, 원근 보정을 적용하여 보간할 경우 쌍곡선 보간(hyperbolic interpolation) 방식을 사용하고, 원근 보정을 적용하지 않고 보간할 경우 선형 보간 방식을 사용하여 각 픽셀의 속성 값을 보간할 수 있다.In
제104단계에서 3차원 그래픽 처리 장치는 삼각형 내의 모든 스캔라인에 대하여 제101단계 내지 제103단계의 처리가 완료되지 않았으면 이미 제101단계 내지 제103단계가 완료된 스캔라인 이외의 스캔라인에 대해 제101단계 내지 제103단계를 수행하기 위해 제 101단계로 돌아가고, 모든 스캔라인에 대해 완료되었으면 종료한다.In
도 11은 본 발명의 일 실시예에 따라 제103단계를 보다 자세히 나타낸 흐름도이다.11 is a
제111단계에서 3차원 그래픽 처리 장치는 102단계에서 계산된 기준 값에 기초하여, 스캔라인 상의 픽셀들 중 원근 보정을 적용하여 보간할 픽셀들을 결정한다. 이때, 스캔라인 양 끝점에 해당하는 픽셀들 중 어느 하나의 픽셀을 기준으로, 원근 보정을 적용하여 보간할 픽셀 또는 원근 보정을 적용하지 않고 보간할 픽셀들 간의 스텝의 크기를 정함으로써, 원근 보정을 적용하여 보간할 픽셀들을 결정할 수 있다.In
제112단계에서 3차원 그래픽 처리 장치는 제111단계에서 결정된 결과에 따라, 스캔라인 상의 픽셀들 중 일부 픽셀들에 대하여 원근 보정을 적용하여 각 픽셀의 속성 값을 보간한다. In
제113단계에서 3차원 그래픽 처리 장치는 제111단계에서 결정된 결과에 따라, 112단계에서 보간된 픽셀들 이외의 픽셀들에 대하여 각 픽셀의 속성 값을 스캔라인 양 끝점에 해당하는 픽셀의 속성 값 및 112단계에서 보간된 픽셀의 속성 값을 이용하여 선형 보간한다. In
도 12는 본 발명의 일 실시예에 따라 제112단계를 보다 자세히 나타낸 흐름도이다.12 is a
제121단계에서 3차원 그래픽 처리 장치는 스캔라인의 양 끝점에 대하여, 속성 값을 동차 좌표로 나눈 값 및 동차 좌표의 역수를 구한다.In
제122단계에서 3차원 그래픽 처리 장치는 111단계에서 결정된 결과에 따라 원근 보정을 적용하여 보간하기로 결정된 픽셀들 중 어느 하나에 대하여, 속성 값을 동차 좌표로 나눈 값 a/w를 선형 보간한다.In
제123단계에서 3차원 그래픽 처리 장치는 상기 어느 하나의 픽셀에 대하여, 동차 좌표의 역수 1/w을 선형 보간한다.In
제124단계에서 3차원 그래픽 처리 장치는 선형 보간된, 속성 값을 동차 좌표로 나눈 값 a/w를 선형 보간된, 동차 좌표의 역수 1/w로 나눔으로써 상기 어느 하나의 픽셀에 대하여 원근 보정을 적용하여 보간된 속성 값을 산출한다. In
제125단계에서 3차원 그래픽 처리 장치는 제111단계에서 결정된 결과에 따라 원근 보정을 적용하여 보간하기로 결정된 픽셀들 모두에 대하여 제122단계 내지 제124단계의 처리가 완료되지 않았으면 이미 제122단계 내지 제124단계가 완료된 픽셀 이외의 픽셀에 대해 제122단계 내지 제124단계를 수행하기 위해 제122단계로 돌 아가고, 결정된 픽셀들 모두에 대하여 완료되었으면 종료한다.In
상기된 바와 같은 그래픽 처리 방법에 의하면, 제102단계에서 결정된 기준 값에 따른 스캔 라인 상의 일부 픽셀 관하여는 원근 보정을 적용하여 속성 값을 보간하고, 그 나머지 픽셀에 관하여는 선형 보간 방식을 적용하여 속성 값을 보간할 수 있다. 따라서 원근 보정을 적용하기 위해 요구되는 나눗셈 연산이 수행되는 횟수가 감소하기 때문에, 모든 픽셀에 대하여 일괄적으로 원근 보정을 적용하던 방식에 비하여 계산량이 현저히 줄어들게 된다. 게다가, 원근 왜곡의 정도를 고려하여 적응적으로 원근 보정을 적용할 픽셀의 수가 결정되므로, 일괄적으로 원근 보정을 적용하던 방식과 비교할 때 일부 픽셀에 대하여 원근 보정을 적용하지 않음으로 발생할 수 있는 화질의 저하 또한 최소화시킬 수 있다.According to the graphic processing method as described above, the attribute value is interpolated by applying perspective correction to some pixels on the scan line according to the reference value determined in
한편, 상술한 본 발명의 실시예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 컴퓨터로 읽을 수 있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다. 상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 저장매체(예를 들면, 롬, 플로피 디스크, 하드 디스크 등), 광학적 판독 매체(예를 들면, 시디롬, 디브이디 등) 및 캐리어 웨이브(예를 들면, 인터넷을 통한 전송)와 같은 저장매체를 포함한다.Meanwhile, the above-described embodiments of the present invention can be written as a program that can be executed in a computer, and can be implemented in a general-purpose digital computer that operates the program using a computer-readable recording medium. The computer-readable recording medium may be a magnetic storage medium (for example, a ROM, a floppy disk, a hard disk, etc.), an optical reading medium (for example, a CD-ROM, DVD, etc.) and a carrier wave (for example, the Internet). Storage medium).
이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관 점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.So far I looked at the center of the preferred embodiment for the present invention. Those skilled in the art will appreciate that the present invention can be implemented in a modified form without departing from the essential features of the present invention. Therefore, the disclosed embodiments should be considered in descriptive sense only and not for purposes of limitation. The scope of the present invention is shown in the claims rather than the foregoing description, and all differences within the scope will be construed as being included in the present invention.
본 발명에 따르면, 원근 왜곡이 발생하는 정도를 고려하여 원근 보정을 선택적으로 적용하여 픽셀의 속성 값을 보간하기 때문에 원근 보정을 적용할 경우에 필요한 나눗셈 연산의 횟수가 감소하고, 따라서 처리 시간과 소비 전력을 감소시킬 수 있다. 결과적으로 본 발명에 따르면, 동일한 화질의 3차원 그래픽 화면을 보다 성능이 낮은 하드웨어를 이용하여 구현할 수 있으며, 동일한 하드웨어의 성능을 전제로 할 때 보다 좋은 화질의 3차원 그래픽 콘텐츠를 제작할 수 있도록 하는 효과가 있다. According to the present invention, since the attribute value of the pixel is interpolated by selectively applying perspective correction in consideration of the degree of perspective distortion, the number of division operations required when applying the perspective correction is reduced, thus processing time and consumption are reduced. Power can be reduced. As a result, according to the present invention, it is possible to implement a three-dimensional graphic screen of the same image quality using lower-performance hardware, and to produce a three-dimensional graphic content of better image quality when the performance of the same hardware on the premise There is.
Claims (25)
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US11/802,912 US8072464B2 (en) | 2006-05-26 | 2007-05-25 | 3-dimensional graphics processing method, medium and apparatus performing perspective correction |
JP2007139674A JP5060830B2 (en) | 2006-05-26 | 2007-05-25 | Three-dimensional graphic processing method and apparatus for performing perspective correction |
EP07108916A EP1860614A1 (en) | 2006-05-26 | 2007-05-25 | 3-Dimensional Graphics Processing Method, Medium and Apparatus Performing Perspective Correction |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR20060047541 | 2006-05-26 | ||
KR1020060047541 | 2006-05-26 |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20070113978A true KR20070113978A (en) | 2007-11-29 |
KR100908123B1 KR100908123B1 (en) | 2009-07-16 |
Family
ID=39091699
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020070047834A KR100908123B1 (en) | 2006-05-26 | 2007-05-16 | 3D graphics processing method and apparatus for performing perspective correction |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100908123B1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101259550B1 (en) * | 2010-06-03 | 2013-04-30 | 한국전자통신연구원 | Method And Apparatus Contrasting Image Through Perspective Distortion Correction |
US8705852B2 (en) | 2011-01-27 | 2014-04-22 | Samsung Electronics Co., Ltd. | Image processing apparatus and method for defining distortion function for synthesized image of intermediate view |
US9117382B2 (en) | 2012-09-28 | 2015-08-25 | Intel Corporation | Device and method for automatic viewing perspective correction |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6469700B1 (en) * | 1998-06-24 | 2002-10-22 | Micron Technology, Inc. | Per pixel MIP mapping and trilinear filtering using scanline gradients for selecting appropriate texture maps |
KR100283071B1 (en) * | 1998-12-18 | 2001-04-02 | 이계철 | Fast Texture Mapping Method |
KR100742155B1 (en) * | 2005-12-30 | 2007-07-24 | 엠텍비젼 주식회사 | Method and apparatus for making scan line |
-
2007
- 2007-05-16 KR KR1020070047834A patent/KR100908123B1/en active IP Right Grant
Also Published As
Publication number | Publication date |
---|---|
KR100908123B1 (en) | 2009-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5060830B2 (en) | Three-dimensional graphic processing method and apparatus for performing perspective correction | |
US7924278B2 (en) | Real-time GPU rendering of piecewise algebraic surfaces | |
RU2754721C2 (en) | Device and method for generating an image of the intensity of light radiation | |
JPH04222074A (en) | Inclination computing method for texture map | |
JP7096661B2 (en) | Methods, equipment, computer programs and recording media to determine the LOD for texturing a cubemap | |
US7420557B1 (en) | Vertex processing when w=0 | |
JP5512218B2 (en) | Graphics processing system | |
US20090195555A1 (en) | Methods of and apparatus for processing computer graphics | |
US8477148B2 (en) | Graphics processing systems | |
Schütz et al. | High-quality point-based rendering using fast single-pass interpolation | |
US11087511B1 (en) | Automated vectorization of a raster image using a gradient mesh with arbitrary topology | |
KR100908123B1 (en) | 3D graphics processing method and apparatus for performing perspective correction | |
JP7460641B2 (en) | Apparatus and method for generating a light intensity image - Patents.com | |
KR101118597B1 (en) | Method and System for Rendering Mobile Computer Graphic | |
KR100818286B1 (en) | Method and apparatus for rendering 3 dimensional graphics data considering fog effect | |
Popescu et al. | Forward rasterization | |
Prantl et al. | Screen Space Curvature and Ambient Occlusion | |
CN116524102A (en) | Cartoon second-order direct illumination rendering method, device and system | |
CN114170368A (en) | Method and system for rendering quadrilateral wire frame of model and model rendering equipment | |
Carr et al. | Real-Time Procedural Solid Texturing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20130624 Year of fee payment: 5 |
|
FPAY | Annual fee payment |
Payment date: 20140619 Year of fee payment: 6 |
|
FPAY | Annual fee payment |
Payment date: 20150624 Year of fee payment: 7 |
|
FPAY | Annual fee payment |
Payment date: 20160617 Year of fee payment: 8 |
|
FPAY | Annual fee payment |
Payment date: 20170619 Year of fee payment: 9 |
|
FPAY | Annual fee payment |
Payment date: 20180620 Year of fee payment: 10 |