KR101210796B1 - Real time polygonal ambient occlusion method using depth texture - Google Patents

Real time polygonal ambient occlusion method using depth texture Download PDF

Info

Publication number
KR101210796B1
KR101210796B1 KR1020120074419A KR20120074419A KR101210796B1 KR 101210796 B1 KR101210796 B1 KR 101210796B1 KR 1020120074419 A KR1020120074419 A KR 1020120074419A KR 20120074419 A KR20120074419 A KR 20120074419A KR 101210796 B1 KR101210796 B1 KR 101210796B1
Authority
KR
South Korea
Prior art keywords
sampling
depth
ambient
shadow
texel
Prior art date
Application number
KR1020120074419A
Other languages
Korean (ko)
Inventor
신병석
이상길
Original Assignee
인하대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 인하대학교 산학협력단 filed Critical 인하대학교 산학협력단
Priority to KR1020120074419A priority Critical patent/KR101210796B1/en
Application granted granted Critical
Publication of KR101210796B1 publication Critical patent/KR101210796B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/80Shading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

PURPOSE: A real time polygonal ambient occlusion method using depth texture is provided to implement a short process time and save resource consumption by sampling depth texture and by an additional calculation. CONSTITUTION: After a depth buffer(110) is generated using a graphics library, a depth texture is generated(110). The sampling of a depth value of a current texel on the depth texture and a neighbor texel of the same is performed(120). The current texel corresponds to a pixel to calculate shadow. By connecting positions of texels having the smallest depth value(130) in the sampling direction, one ambient polygon is generated(130). The shadow of the pixel is calculated using the width of the ambient polygon (140). [Reference numerals] (110) To generate depth texture using a graphics library; (120) To perform the sampling of a depth value of a current texel corresponding to pixel, of which shadow is to be calculated, and its neighbor texel; (130) To generate ambient polygon by connecting positions of texels having the smallest depth value in sampling direction; (140) To calculate the shadow of the pixel using the width of the ambient polygon; (AA) Start; (BB) End

Description

깊이 텍스처를 이용한 실시간 다각형 앰비언트 오클루전 방법{REAL TIME POLYGONAL AMBIENT OCCLUSION METHOD USING DEPTH TEXTURE}REAL TIME POLYGONAL AMBIENT OCCLUSION METHOD USING DEPTH TEXTURE}

본 발명의 실시예들은 사실적인 영상을 렌더링(rendering) 하기 위한 조명 알고리즘(illumination algorithm)인 앰비언트 오클루전(ambient occlusion) 방법에 관한 것이다.Embodiments of the present invention relate to an ambient occlusion method, which is an illumination algorithm for rendering a realistic image.

본 발명의 배경이 되는 기술은 다음의 논문에 개시되어 있다.
1) ZHUKOV S., IONES A., KRONIN G.: An ambient light illumination model. In Proc. Eurographics Workshop Rendering Techniques (1998), pp. 45-55.
2) MITTRING M.: Finding next gen: Cryengine 2. In Proc.ACM SIGGRAPH 2007 Courses (2007), pp. 97-121.
3) BAVOIL L., SAINZ M., DIMITROV R.: Image-space horizon-based ambient occlusion. In ACM SIGGRAPH 2008 talks (2008).
컴퓨터 그래픽스 분야에서 사실적인 영상을 렌더링하는 것은 가장 중요한 목표이자 과제이다. 이를 위해, 가장 필수적인 요소 중 하나가 전역 조명(global illumination)이며, 간접 조명(indirect illumination)을 비롯하여 반사, 굴절, 산란, 커스틱(caustic) 등의 다양한 효과를 적용하여 실감나는 장면의 표현이 가능하다. 전역 조명에 관련된 방법들로는 래디오시티(radiosity)나 광선 추적법(ray tracing), 경로 추적법(path tracing), 포톤 매핑(photon mapping) 등이 있다.
The background technology of the present invention is disclosed in the following paper.
1) ZHUKOV S., IONES A., KRONIN G .: An ambient light illumination model. In Proc. Eurographics Workshop Rendering Techniques (1998), pp. 45-55.
2) MITTRING M .: Finding next gen: Cryengine 2. In Proc. ACM SIGGRAPH 2007 Courses (2007), pp. 97-121.
3) BAVOIL L., SAINZ M., DIMITROV R .: Image-space horizon-based ambient occlusion. In ACM SIGGRAPH 2008 talks (2008).
In the field of computer graphics, rendering realistic images is the most important goal and task. To do this, one of the most essential elements is global illumination, and indirect illumination and various effects such as reflection, refraction, scattering, and caustic can be used to express realistic scenes. Do. Methods related to global illumination include radiosity, ray tracing, path tracing, and photon mapping.

그러나, 종래의 방법들은 물리적 연산이 복잡하고 방대하여 많은 자원을 소모하기 때문에 사용자와 상호 작용이 가능한 실시간 렌더링이 어렵다. 더욱이, 그래픽 처리장치(GPU)를 사용하여 수행 속도를 향상시키는 방법들이 등장함에 따라 복잡한 장면에 대하여 빠른 연산이 가능하게 되었지만, 그래픽 처리장치에 구축되어 있는 일반적인 렌더링 파이프라인에 적합하지 않다.However, the conventional methods are difficult to perform real-time rendering that can interact with the user because physical operations are complicated and huge and consume a lot of resources. Moreover, with the advent of methods to improve performance using graphics processing units (GPUs), fast computations on complex scenes are possible, but they are not suitable for the general rendering pipeline built into graphics processing units.

이에 따라, 전역 조명의 모든 효과를 낼 수는 없지만 빠르고 효율적으로 음영을 생성할 수 있는 조명 알고리즘으로서, 앰비언트 오클루전(ambient occlusion)이 주목 받고 있다. 따라서, 본 명세서에서는 영상 렌더링을 위한 앰비언트 오클루전 방법을 제안한다.As a result, ambient occlusion has attracted attention as an illumination algorithm that is not able to produce all the effects of global illumination, but can generate shadows quickly and efficiently. Accordingly, the present specification proposes an ambient occlusion method for image rendering.

앰비언트 오클루전 기술을 기반으로 한 새로운 조명 알고리즘인 다각형 앰비언트 오클루전 방법을 제공한다.Polygon's ambient occlusion method is a new lighting algorithm based on ambient occlusion technology.

깊이 텍스처(depth texture)의 샘플링을 통하여 주변광 다각형(ambient polygon)을 생성하여 음영을 계산하는 다각형 앰비언트 오클루전 방법을 제공한다.A polygonal ambient occlusion method is provided for calculating shadows by generating an ambient polygon by sampling depth textures.

본 발명에 따른 그래픽 처리 장치에서의 다각형 앰비언트 오클루전(polygonal ambient occlusion) 방법은, 스크린 공간(screen space)에서의 화소(pixel)의 깊이 값을 나타내는 깊이 텍스처(depth texture)를 생성하는 단계; 음영을 계산할 화소에 대응되는 상기 깊이 텍스처 상의 현재 텍셀(texel)을 기준으로 상기 현재 텍셀과 이웃하는 이웃 텍셀들의 깊이 값을 샘플링(sampling) 하는 단계; 상기 깊이 값에 따라 상기 현재 텍셀과 상기 이웃 텍셀들을 연결하여 주변광 다각형(ambient polygon)을 생성하는 단계; 및 상기 주변광 다각형의 넓이를 이용하여 상기 화소의 음영을 계산하는 단계를 포함할 수 있다.A polygonal ambient occlusion method in a graphics processing apparatus according to the present invention may include generating a depth texture representing a depth value of a pixel in screen space; Sampling depth values of neighboring texels neighboring the current texel based on a current texel on the depth texture corresponding to the pixel whose shadow is to be calculated; Generating an ambient polygon by connecting the current texel and the neighboring texels according to the depth value; And calculating a shadow of the pixel by using an area of the polygon of the ambient light.

상기 이웃 텍셀들의 깊이 값을 샘플링 하는 단계는, 상기 현재 텍셀을 중심으로 하여 다수의 방향으로 샘플링을 진행할 수 있다.In the sampling of the depth values of the neighboring texels, sampling may be performed in a plurality of directions about the current texel.

상기 주변광 다각형을 생성하는 단계는, 상기 샘플링이 진행되는 다수의 방향에 대하여 각 방향에서 샘플링 된 깊이 값 중 가장 낮은 깊이 값을 가지는 이웃 텍셀을 연결하여 하나의 주변광 다각형을 생성할 수 있다.The generating of the ambient light polygon may generate one ambient light polygon by connecting neighboring texels having the lowest depth value among the depth values sampled in each direction with respect to the plurality of directions in which the sampling is performed.

상기 화소의 음영을 계산하는 단계는, 상기 샘플링이 진행된 샘플링 최대 넓이에 대하여 상기 주변광 다각형의 넓이가 차지하는 비율로 음영 값을 계산할 수 있다.In calculating the shadow of the pixel, the shadow value may be calculated by a ratio of the width of the ambient light polygon to the maximum sampling width of the sampling.

상기 샘플링 최대 넓이는 수학식 1 또는 수학식 2를 이용하여 계산하고, 상기 음영 값은 수학식 3을 이용하여 계산할 수 있다.The maximum sampling area may be calculated using Equation 1 or Equation 2, and the shadow value may be calculated using Equation 3.

수학식 1:Equation (1)

Figure 112012054587310-pat00001
Figure 112012054587310-pat00001

수학식 2:Equation 2:

Figure 112012054587310-pat00002
Figure 112012054587310-pat00002

(여기서, m은 샘플링 최대 넓이, n은 샘플링 방향의 수, r은 샘플링 최대 길이)Where m is the maximum sampling width, n is the number of sampling directions, and r is the maximum sampling length.

수학식 3:Equation 3:

Figure 112012054587310-pat00003
Figure 112012054587310-pat00003

(여기서, A는 앰비언트 오클루전의 음영 값이며, n은 샘플링 방향의 수, i는 샘플링 방향의 순서, p는 현재 텍셀의 위치, p i i번째 샘플링 방향에서 가장 낮은 깊이 값을 갖는 텍셀의 위치, m은 샘플링 최대 넓이)Where A is the shadow value of the ambient occlusion, n is the number of sampling directions, i is the order of the sampling direction, p is the position of the current texel, p i is the value of the texel with the lowest depth value in the i th sampling direction. Position, m is the maximum sampling width)

본 실시예에 따른 다각형 앰비언트 오클루전 방법은 하나의 깊이 텍스처를 이용하여 빠르게 음영을 계산할 수 있다. 스크린 공간 기반의 앰비언트 오클루전 방법은 게임과 같이 실시간 렌더링이 필수적인 분야에 적합하며, 최대한 빠른 시간 내에 사실적인 음영을 생성할 수 있다. 게임의 경우 앰비언트 오클루전 방법은 하나의 중간 단계 혹은 후처리(post-processing)로 추가되기 때문에, 실시간 수행의 보장을 위하여 본 발명에 따른 다각형 앰비언트 오클루전 방법이 적합하다.The polygonal ambient occlusion method according to the present embodiment can quickly calculate the shadow using one depth texture. The screen-space based ambient occlusion method is suitable for applications where real-time rendering is required, such as games, and can produce realistic shadows as quickly as possible. In the case of games, since the ambient occlusion method is added as one intermediate step or post-processing, the polygonal ambient occlusion method according to the present invention is suitable for ensuring real time performance.

본 발명에 따른 다각형 앰비언트 오클루전 방법은, 타 스크린 공간 기반의 방법들과 달리 복잡한 각도 연산이나 다른 기술의 추가 등이 필요로 하지 않으며, 오직 깊이 텍스처의 샘플링과 간단한 추가 연산 만으로 수행 가능하므로 짧은 처리 시간과 적은 자원 소모가 장점이다.Unlike other screen space based methods, the polygonal ambient occlusion method according to the present invention does not require complicated angle calculations or the addition of other techniques, and can be performed only by sampling of depth textures and simple addition operations. The processing time and low resource consumption are advantages.

도 1은 본 발명의 일 실시예에 있어서, 깊이 텍스처를 이용하여 실시간으로 음영을 계산하는 실시간 다각형 앰비언트 오클루전 방법을 도시한 흐름도다.
도 2는 본 발명의 일 실시예에 있어서, 깊이 텍스처의 샘플링을 통하여 주변광 다각형의 조각이 생성되는 과정을 설명하기 위한 예시 도면이다.
도 3은 본 발명의 일 실시예에 있어서, 3차원으로 표현된 주변광 다각형을 도시한 예시 도면이다.
1 is a flowchart illustrating a real-time polygonal ambient occlusion method of calculating a shadow in real time using a depth texture according to an embodiment of the present invention.
FIG. 2 is an exemplary diagram for describing a process of generating a fragment of an ambient light polygon through sampling of a depth texture according to an embodiment of the present invention.
3 is an exemplary diagram illustrating an ambient light polygon represented in three dimensions in an embodiment of the present invention.

이하, 본 발명의 실시예를 첨부된 도면을 참조하여 상세하게 설명한다.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

본 실시예에 따른 다각형 앰비언트 오클루전 방법을 설명하기에 앞서, 본 발명과 관련된 기술과, 일반적인 앰비언트 오클루전 방법을 설명하기로 한다.Prior to describing the polygonal ambient occlusion method according to the present embodiment, a technique related to the present invention and a general ambient occlusion method will be described.

먼저, 앰비언트 오클루전은 한 지점이 주변 물체에 의해 차폐된 정도에 따라 음영을 구하는 방법이며, 전역 조명 방법의 근사이다. 하늘에서 내려오는 태양 빛과 같은 간접 조명을 표현하기 위해 얼마나 가까운 위치에 물체가 있는지 확인하며, 이에 따라 주변광(ambient light)을 결정하여 사실적인 음영을 표현할 수 있다. 초기의 앰비언트 오클루전으로는 물체 표면의 모든 위치에서 반구 방향으로 가상의 광선을 발사하여, 물체에 차폐되는 광선과 차폐되지 않는 광선의 수를 가시 함수(visibility function)로 계산할 수 있다.First, ambient occlusion is a method of obtaining shadows according to the extent to which a point is shielded by surrounding objects, and is an approximation of the global illumination method. It determines how close the object is to represent indirect lighting, such as sun light coming down from the sky, and thus determines the ambient light to represent realistic shadows. In earlier ambient occlusions, virtual rays can be fired in all hemispheres from any location on the object's surface to calculate the number of rays shielded and unshielded by the object as a visibility function.

Figure 112012054587310-pat00004
Figure 112012054587310-pat00004

여기서, Ω는 반구 방향으로 전진하는 차폐 계산에 대한 적분이며, n은 위치 p의 법선 벡터, w는 차폐 계산 방향의 벡터이다.Is the integral to the shielding calculation advancing in the hemisphere direction, n is the normal vector of the position p , and w is the vector of the shielding calculation direction.

수학식 1은 표면의 한 지점 p에서 반구 방향으로 광선을 진행할 때 광선이 차폐물에 닿을 경우, 가시함수 V가 0, 닿지 않는 경우 1이 되어 몬테칼로 적분(Monte Carlo integration)으로 음영을 계산하는 것을 나타낸다. 이때, 함수 max는 내적을 이용한 감쇠 요소이다.Equation (1) if the ray hits the shield, when holding a light hemispherically direction at a point p on the surface, when visibility function V is 0, no chance is one that calculates a shadow by Monte Carlo integration (Monte Carlo integration) Indicates. In this case, the function max is an attenuation factor using the inner product.

상기한 앰비언트 오클루전 방법은 전역 조명에 비해 비용이 저렴하고 구현이 간단하며, 영상의 화질을 향상시킬 수 있다. 더욱이, 최근 중앙처리장치(CPU)와 그래픽 처리장치(GPU)의 발전으로 처리 시간이 단축되고 있으며, 스크린 공간(screen-space) 기반의 연구가 활성화 되면서 컴퓨터 게임 등의 분야에 널리 사용되고 있다.The above-mentioned ambient occlusion method is cheaper than global illumination and is simple to implement, and may improve image quality. In addition, processing time has recently been shortened by the development of a central processing unit (CPU) and a graphics processing unit (GPU), and is widely used in the field of computer games such as screen-space based research.

대표적인 스크린 공간 기반의 연구로는 스크린 공간 앰비언트 오클루전(screen space ambient occlusion)이 있으며, 이는 그래픽 처리장치 상에서 2차원 기반으로 수행되어 처리 시간이 오래 걸리던 기존 앰비언트 오클루전의 문제를 해결하고자 제안된 것이다. 일반적으로, 스크린 공간 앰비언트 오클루전은 장면 안의 3차원 모델로 음영을 계산하지 않고, 영상 처리를 빠른 속도로 수행하기 위하여 깊이 버퍼(depth buffer)를 사용한다. 스크린 공간 앰비언트 오클루전은 깊이 버퍼를 사용함으로써 2차원 정보만으로 음영을 계산할 수 있으며, 장면의 복잡도나 움직이는 물체 등에 독립적으로 동작하는 장점이 있다. 다시 말해, 스크린 공간 앰비언트 오클루전은 음영을 계산할 위치에 해당하는 화소(pixel)의 주변에 샘플링(sampling) 할 이웃 화소들의 좌표를 무작위로 정한 후 이들이 깊이 버퍼에 저장된 깊이 값들 보다 큰 값을 가지는지 작은 값을 가지는지에 대한 비율을 계산하여 이를 바탕으로 음영의 정도를 결정한다. 이와 같이, 스크린 공간 앰비언트 오클루전은 깊이 버퍼 안의 깊이 값들 간의 비교 연산을 통해 수행되며, 선처리(pre-computation) 없이 실시간에 동작하기 때문에 컴퓨터 게임 등의 분야에 널리 사용되고 있다.Representative screen space-based research is screen space ambient occlusion, which is proposed to solve the problem of the existing ambient occlusion which is a long processing time because it is performed on a two-dimensional basis on the graphic processing unit. will be. In general, screen space ambient occlusion uses a depth buffer to perform image processing at high speed without calculating shadows with a three-dimensional model in a scene. Screen space ambient occlusion can calculate shadows using only two-dimensional information by using the depth buffer, and has the advantage of operating independently of the complexity of the scene or moving objects. In other words, screen-space ambient occlusion randomly determines the coordinates of neighboring pixels to sample around the pixel corresponding to the position where the shadow is to be calculated, and then they have a value larger than the depth values stored in the depth buffer. Calculate the ratio of small or small values to determine the degree of shading. As described above, screen space ambient occlusion is performed through a comparison operation between depth values in a depth buffer, and is widely used in fields such as computer games because it operates in real time without pre-computation.

또 다른 스크린 공간 기반의 연구로는 지평선 분할 앰비언트 오클루전(horizon-split ambient occlusion)이 있다. 지평선 분할 앰비언트 오클루전은 분할된 반구(hemisphere)를 이용하여 지평선 각도(horizon angle)를 계산한 후, 지평선 각도를 연결하면 하나의 연결된 지평선(horizon line)이 생성되는데, 이를 이용하여 음영의 정도를 계산할 수 있다.
Another screen space-based study is horizon-split ambient occlusion. Horizon Segment Ambient Occlusion calculates the horizon angle using a divided hemisphere, and then connects the horizon angles to create one connected horizon line. Can be calculated.

이하에서는, 본 발명의 실시예에 따른 다각형 앰비언트 오클루전 방법을 상세히 설명하기로 한다.Hereinafter, a polygonal ambient occlusion method according to an embodiment of the present invention will be described in detail.

본 발명은 하나의 깊이 텍스처를 이용하여 음영을 빠르게 계산하는 다각형 앰비언트 오클루전 방법에 대한 것이다. 이 방법은 스크린 공간 기반의 방법이며, 깊이 버퍼를 이용하여 생성된 깊이 텍스처만을 사용하며, 기존의 스크린 공간 기반 방법들과 달리 법선 벡터(normal vector)를 사용하지 않는 장점이 있다. 본 발명은 깊이 텍스처를 일종의 높이맵(heightfield)과 같이 간주하는 것에서 시작되며, 즉 깊이 텍스처 안의 깊이 값이 0에 가까울수록 높이가 높은 지형에 해당한다고 판단한다.The present invention is directed to a polygonal ambient occlusion method for quickly calculating shadows using one depth texture. This method is screen space based and uses only depth textures created using the depth buffer, and unlike conventional screen space based methods, it does not use normal vectors. The present invention begins by considering the depth texture as a kind of heightfield, i.e., the closer the depth value in the depth texture is to 0, the higher the terrain.

도 1은 본 발명의 일 실시예에 있어서, 깊이 텍스처를 이용하여 실시간으로 음영을 계산하는 실시간 다각형 앰비언트 오클루전 방법을 도시한 흐름도이다.1 is a flowchart illustrating a real-time polygonal ambient occlusion method of calculating a shadow in real time using a depth texture according to an embodiment of the present invention.

먼저, 깊이 텍스처를 생성하는 단계(110)에서는 그래픽스 라이브러리를 이용하여 깊이 버퍼를 생성한 후 이를 깊이 텍스처로 만든다. 즉, 단계(110)에서는 스크린 공간에서의 화소의 깊이 값이 저장된 깊이 버퍼를 이용하여 깊이 텍스처를 생성할 수 있다. 깊이 버퍼는 장면 안의 3차원 모델들의 축약으로 간주될 수 있기 때문에 종래에 널리 사용되고 있으며, 그 생성 역시 종래의 함수를 이용하여 간단히 구현 가능하다.First, in step 110 of creating a depth texture, a depth buffer is generated using a graphics library, and then a depth texture is created. That is, in step 110, a depth texture may be generated using a depth buffer in which the depth value of the pixel in the screen space is stored. Depth buffers are widely used in the prior art because they can be regarded as abbreviations of three-dimensional models in the scene, and their generation can also be simply implemented using conventional functions.

다음은, 음영을 계산할 화소에 대응되는 깊이 텍스처 상의 현재 텍셀과 그 이웃 텍셀들의 깊이 값을 샘플링 하는 단계(120)이다. 종래의 스크린 공간 기반의 방법들에서는 깊이 텍스처에서 샘플링 할 좌표를 결정할 때 무작위 방식을 사용하였으나, 다각형 앰비언트 오클루전 방법에서는 고정된 좌표를 사용한다. 일 예로, 본 실시예에서는 현재 텍셀을 중심으로 하여 방사형으로 샘플링이 수행되며, 샘플링이 진행되는 최대 거리는 일정한 샘플링 반지름 값(r)이다. n개의 샘플링 방향을 사용한다면, 인접한 두 샘플링 방향은 현재 텍셀을 중심으로 n/2π의 각도 차이가 있다. 한 방향으로 샘플링이 진행될 때, 일정한 간격마다 샘플링이 수행되며, 각 간격에 해당하는 위치와 가장 인접한 좌표의 텍셀을 선택하여 그 깊이 값을 가져온다.Next, in operation 120, the depth value of the current texel and its neighboring texels on the depth texture corresponding to the pixel whose shadow is to be calculated is sampled. In the conventional screen space based methods, a random method is used to determine coordinates to sample in a depth texture, but a polygonal ambient occlusion method uses fixed coordinates. For example, in the present embodiment, sampling is performed radially around the current texel, and the maximum distance at which sampling is performed is a constant sampling radius value r . If n sampling directions are used, two adjacent sampling directions have an angle difference of n / 2π around the current texel. When sampling is performed in one direction, sampling is performed at regular intervals, and the depth value is selected by selecting the texel of the coordinates closest to each position.

다음은, 각 샘플링 방향마다 가장 작은 깊이 값을 가지는 텍셀의 위치들을 연결하여 하나의 주변광 다각형을 생성하는 단계(130)이다. 본 발명에서 깊이 텍스처는 높이맵과 같이 간주되기 때문에, 깊이 텍스처 안의 깊이 값들은 일종의 높이와 같이 정의된다. 따라서, 깊이 값이 0에 가깝다면 높이 값이 높은 지형이라고 판단되며, 이는 차폐 정도와 관련이 있다. 한 지점을 중심으로 하는 일정한 지역을 보았을 때, 지역 내에서 가장 높은 높이를 가지는 위치가 중심 지점에 가까이 있다면 차폐의 정도가 많아 짙은 음영이 질 가능성이 크다. 또한, 가장 높은 높이를 가지는 위치가 중심 지점과 멀다면, 다른 경우에 비하여 차폐의 정도가 낮기 때문에 음영이 지지 않을 가능성이 크다. 이를 전제로 하여, 각 샘플링 방향의 샘플링 된 깊이 값들 중 가장 깊이 값이 낮은 텍셀은 차폐의 정도가 많다고 가정하며, 상기 텍셀들의 위치를 연결하여 만들어진 하나의 다각형이 주변광 다각형이다. 따라서, 주변광 다각형의 넓이는 차폐되지 않은 공간이라고 간주된다. 주변광 다각형은 샘플링 방향의 수와 같은 수의 조각으로 구성되며, 각 조각은 두 개의 샘플링 방향과 현재 텍셀로 이루어진다.Next, in operation 130, one ambient light polygon is generated by connecting positions of the texels having the smallest depth value in each sampling direction. Since the depth texture is regarded as a height map in the present invention, the depth values in the depth texture are defined as a kind of height. Therefore, if the depth value is close to zero, it is determined that the terrain has a high height value, which is related to the degree of shielding. When looking at a certain area centered on a point, if the location with the highest height in the area is close to the center point, there is a high degree of shielding, which is likely to result in dark shades. In addition, if the position having the highest height is far from the center point, it is likely that the shadow is not shaded because the degree of shielding is lower than in other cases. On the premise of this, it is assumed that the texel having the lowest depth value among the sampled depth values in each sampling direction has a high degree of shielding, and one polygon formed by connecting the positions of the texels is an ambient light polygon. Therefore, the width of the ambient light polygon is considered to be an unshielded space. The ambient light polygon consists of the same number of pieces as the number of sampling directions, and each piece consists of two sampling directions and the current texel.

도 2는 3개의 샘플링 방향에 대하여 도시한 것으로, 회색 사각형은 해당 방향에 대하여 샘플링 된 텍셀의 위치이다. 회색 사각형 중 검정 별 표식은 현재 텍셀을 나타내며, 검정 점 표식은 해당 방향에서 샘플링 된 깊이 값 중 가장 낮은 깊이 값을 가지는 텍셀의 위치이다. 두 개의 점 표식과 한 개의 별 표식을 연결하면 하나의 조각이 생성되며, 이와 같이 모든 표식에 대해 조각을 생성하고 이를 합치면 하나의 주변광 다각형이 만들어진다. 도 3는 주변광 다각형을 3차원으로 도시한 것이다. 생성된 주변광 다각형은 일종의 지평선(horizon line)을 평면에 투영시킨 것과 유사하다.FIG. 2 shows three sampling directions, where the gray square is the position of the texel sampled for that direction. The black star marker in the gray square represents the current texel, and the black dot marker is the position of the texel having the lowest depth value among the sampled depth values in the corresponding direction. Connecting two point markers and one star marker creates one piece, and when you create a piece for all the markers and combine them, you create one ambient light polygon. 3 illustrates the ambient light polygon in three dimensions. The generated ambient light polygons are similar to a type of horizon line projected onto a plane.

마지막 단계는 상기 주변광 다각형의 넓이를 이용하여 음영을 계산하는 단계(140)이다. 주변광 다각형의 넓이는 차폐되지 않은 공간으로 간주할 수 있기 때문에, 샘플링이 이루어진 전체 넓이로 나누어 그 비율로 음영의 정도를 결정할 수 있다.The final step is to calculate the shadow using the area of the ambient light polygon (140). Since the area of the ambient light polygon can be regarded as an unshielded space, the degree of shading can be determined by dividing it by the total area of the sampling.

Figure 112012054587310-pat00005
Figure 112012054587310-pat00005

수학식 2에서, m은 주변광 다각형의 최대 넓이(즉, 샘플링 최대 넓이)이며, n은 샘플링 방향의 수, r은 샘플링 최대 길이(샘플링 반지름)이다. 주변광 다각형의 최대 넓이는 수학식 2와 같이 두 가지로 정의될 수 있으며, 한 가지는 샘플링 최대 길이 r을 반지름으로 하는 원의 넓이이며, 다른 한 가지는 현재 텍셀의 위치를 꼭지점으로 하고 샘플링 최대 길이 r을 양변으로 하는 조각들의 넓이 총합이다.In Equation 2, m is the maximum width of the ambient light polygon (ie, the sampling maximum width), n is the number of sampling directions, and r is the maximum sampling length (sampling radius). The maximum width of the ambient light polygon can be defined in two ways as shown in Equation 2, one of which is the width of a circle whose radius is the maximum sampling length r , and the other is the maximum sampling length r that is the vertex of the current texel. The sum of the widths of the pieces with both sides.

Figure 112012054587310-pat00006
Figure 112012054587310-pat00006

수학식 3에서, A는 앰비언트 오클루전의 음영 값이며, n은 샘플링 방향의 수, i는 샘플링 방향의 순서, p는 현재 텍셀의 위치, p i i번째 샘플링 방향에서 가장 낮은 깊이 값을 갖는 텍셀의 위치, m은 수학식 2에서 계산된 주변광 다각형의 최대 넓이이다. 여기서, p i 는 도 1에서 검정 점 표식에 해당하며, p는 별 모양 표식에 해당한다. 이와 같이, 두 변과 사이각을 이용하여 삼각형의 넓이를 구하는 방식으로 각 조각의 넓이를 계산하고, 그 합을 전체 넓이 m으로 나누면 최종 음영의 정도를 구할 수 있다.In Equation 3, A is the shadow value of the ambient occlusion, n is the number of sampling directions, i is the order of the sampling direction, p is the position of the current texel, p i has the lowest depth value in the i- th sampling direction The position of the texel, m, is the maximum width of the ambient light polygon calculated in Equation 2. Here, p i corresponds to the black point marker in FIG. 1, p corresponds to the star marker. In this way, the area of each piece is calculated by calculating the area of the triangle using the two sides and the angle, and the sum is divided by the total area m to obtain the final degree of shading.

요컨대, 본 발명에 따른 깊이 텍스처를 이용한 다각형 앰비언트 오클루전 방법은 다음과 같다. 한 화소의 음영을 계산하기 위하여, 해당 화소에 대응되는 깊이 텍스처 상의 현재 텍셀의 깊이 값과, 그 이웃 텍셀들의 깊이 값을 샘플링 한다. 깊이 텍스처 샘플링 시 이웃 텍셀은 현재 텍셀을 중심으로 하였을 때 방사형으로 퍼지는 샘플링 방향과 겹치는 텍셀로 정의될 수 있다. 이미지 공간 상에서, 각 샘플링 방향에 대하여 해당 방향에서 샘플링된 깊이 값 중 가장 낮은 깊이 값을 가지는 텍셀의 위치를 저장하며, 모든 샘플링 방향에 대하여 상기 텍셀들의 위치를 연결하여 하나의 다각형을 생성한다. 이를, 주변광 다각형이라 정하며, 이 다각형의 크기를 차폐되지 않은 공간이라 간주하여 음영을 계산하게 된다. 상기한 방법은 깊이 텍스처의 샘플링이 대부분의 연산을 차지하게 되므로 그 수행 속도가 타 방법들에 비하여 현저히 빠르다는 장점이 있다.In short, the polygonal ambient occlusion method using the depth texture according to the present invention is as follows. In order to calculate the shadow of one pixel, the depth value of the current texel on the depth texture corresponding to the pixel and the depth value of the neighboring texels are sampled. In the depth texture sampling, a neighboring texel may be defined as a texel overlapping a radially spreading sampling direction when the current texel is centered. In the image space, the position of the texel having the lowest depth value among the depth values sampled in the corresponding direction for each sampling direction is stored, and one polygon is generated by connecting the positions of the texels for all the sampling directions. This is called an ambient light polygon, and the shadow is calculated by considering the size of the polygon as an unshielded space. Since the sampling of the depth texture takes most of the calculation, the above method has an advantage that the execution speed is significantly faster than other methods.

상기한 다각형 앰비언트 오클루전 방법은 컴퓨터 그래픽스 분야에서 사실적인 영상을 렌더링 하기 위한 그래픽 처리 장치에 적용될 수 있으며, 다각형 앰비언트 오클루전 방법에 포함된 각각의 과정(도 1의 110~140)은 상기 그래픽 처리 장치에 의해 수행될 수 있다.The polygonal ambient occlusion method may be applied to a graphic processing device for rendering a realistic image in the field of computer graphics, and each process (110 to 140 of FIG. 1) included in the polygonal ambient occlusion method is described above. It may be performed by the graphics processing device.

본 발명에 따른 다각형 앰비언트 오클루전 방법이 수행되는 그래픽 처리 장치에 대한 도식은 생략하였으나, 처리기와 메모리를 포함하여 구성될 수 있다. 이때, 메모리는 스크린 공간에서의 화소의 깊이 값을 나타내는 깊이 텍스처를 생성한 후, 음영을 계산할 화소에 대응되는 깊이 텍스처 상의 현재 텍셀을 기준으로 현재 텍셀과 이웃하는 이웃 텍셀들의 깊이 값을 샘플링 하고, 샘플링 된 깊이 값에 따라 현재 텍셀과 이웃 텍셀들을 연결하여 주변광 다각형을 생성하며, 주변광 다각형의 넓이를 이용하여 상기 화소의 음영을 계산하는 명령어를 포함하는 프로그램이 저장될 수 있다. 그리고, 처리기는 상기 메모리에 저장된 프로그램의 명령어에 따라 처리하는 장치로서, CPU 등의 마이크로프로세서가 포함될 수 있다.Although a schematic diagram of a graphic processing apparatus in which the polygonal ambient occlusion method according to the present invention is performed is omitted, it may include a processor and a memory. In this case, the memory generates a depth texture representing the depth value of the pixel in the screen space, and then samples the depth value of the neighboring texels adjacent to the current texel based on the current texel on the depth texture corresponding to the pixel whose shadow is to be calculated. A program including an instruction for connecting the current texel and the neighboring texels to generate an ambient light polygon according to the sampled depth value and calculating a shadow of the pixel using the width of the ambient light polygon may be stored. In addition, the processor is a device for processing according to an instruction of a program stored in the memory, and may include a microprocessor such as a CPU.

이와 같이, 본 실시예에 따르면, 하나의 깊이 텍스처를 이용하여 빠르게 음영을 계산하는 다각형 앰비언트 오클루전 방법을 제공할 수 있다. 본 발명에 따른 실시간 다각형 앰비언트 오클루전 방법은 깊이 텍스처의 샘플링을 통하여 여러 조각으로 구성된 하나의 주변광 다각형을 생성하며, 상기 주변광 다각형의 넓이를 차폐되지 않은 공간으로 간주하여 음영의 정도를 구할 수 있다. 따라서, 본 발명은 별도의 추가 방법 없이 텍스처 샘플링과 간단한 추가 연산만으로 수행 가능하므로 기존의 방법들보다 월등히 빠른 수행 속도를 보인다.As described above, according to the present embodiment, it is possible to provide a polygonal ambient occlusion method for quickly calculating a shadow using one depth texture. The real-time polygonal ambient occlusion method according to the present invention generates one ambient light polygon composed of several pieces by sampling depth textures, and calculates the degree of shading by considering the area of the ambient light polygon as an unshielded space. Can be. Therefore, the present invention can be performed only by texture sampling and simple additional operation without any additional method, and thus shows much faster execution speed than existing methods.

본 발명의 실시예에 따른 방법들은 다양한 컴퓨터 시스템을 통하여 수행될 수 있는 프로그램 명령(instruction) 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 또한, 상술한 파일 시스템은 컴퓨터 판독이 가능한 기록 매체에 기록될 수 있다.Methods according to an embodiment of the present invention may be implemented in program instruction form that can be executed by various computer systems and recorded in a computer readable medium. The computer readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the medium may be those specially designed and constructed for the present invention or may be available to those skilled in the art of computer software. In addition, the above-described file system can be recorded in a computer-readable recording medium.

이상과 같이 본 발명은 비록 한정된 실시예와 도면에 의해 설명되었으나, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상의 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다.As described above, the present invention has been described by way of limited embodiments and drawings, but the present invention is not limited to the above embodiments, and those skilled in the art to which the present invention pertains various modifications and variations from such descriptions. This is possible.

그러므로, 본 발명의 범위는 설명된 실시예에 국한되어 정해져서는 아니 되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등한 것들에 의해 정해져야 한다.Therefore, the scope of the present invention should not be limited to the described embodiments, but should be determined by the equivalents of the claims, as well as the claims.

Claims (5)

그래픽 처리 장치에서의 다각형 앰비언트 오클루전(polygonal ambient occlusion) 방법에 있어서,
스크린 공간(screen space)에서의 화소(pixel)의 깊이 값을 나타내는 깊이 텍스처(depth texture)를 생성하는 단계;
음영을 계산할 화소에 대응되는 상기 깊이 텍스처 상의 현재 텍셀(texel)을 기준으로 상기 현재 텍셀과 이웃하는 이웃 텍셀들의 깊이 값을 샘플링(sampling) 하는 단계;
상기 이웃 텍셀들의 깊이 값에 따라 상기 현재 텍셀과 상기 이웃 텍셀들을 연결하여 주변광 다각형(ambient polygon)을 생성하는 단계; 및
상기 주변광 다각형의 넓이를 이용하여 상기 화소의 음영을 계산하는 단계
를 포함하고,
상기 화소의 음영을 계산하는 단계는,
상기 샘플링이 진행된 샘플링 최대 넓이에서 상기 주변광 다각형의 넓이가 차지하는 비율로 음영 값을 계산하는 것으로,
상기 샘플링 최대 넓이는 수학식 1 또는 수학식 2를 이용하여 계산하고,
상기 음영 값은 수학식 3을 이용하여 계산하는 것
을 특징으로 하는 다각형 앰비언트 오클루전 방법.
수학식 1:
Figure 112012082532467-pat00013

수학식 2:
Figure 112012082532467-pat00014

(여기서, m은 샘플링 최대 넓이, n은 샘플링 방향의 수, r은 샘플링 최대 길이)
수학식 3:
Figure 112012082532467-pat00015

(여기서, A는 앰비언트 오클루전의 음영 값이며, n은 샘플링 방향의 수, i는 샘플링 방향의 순서, p는 현재 텍셀의 위치, pi i번째 샘플링 방향에서 가장 낮은 깊이 값을 갖는 텍셀의 위치, m은 샘플링 최대 넓이)
In the polygonal ambient occlusion method in the graphics processing apparatus,
Generating a depth texture indicative of a depth value of a pixel in screen space;
Sampling depth values of neighboring texels neighboring the current texel based on a current texel on the depth texture corresponding to the pixel whose shadow is to be calculated;
Generating an ambient polygon by connecting the current texel and the neighboring texels according to a depth value of the neighboring texels; And
Calculating a shadow of the pixel using an area of the ambient light polygon
Including,
Calculating the shade of the pixel,
Computing a shadow value by the ratio occupied by the width of the ambient light polygon from the maximum sampling width of the sampling proceeds,
The maximum sampling width is calculated using Equation 1 or Equation 2,
The shadow value is calculated using Equation 3
Polygonal ambient occlusion method characterized in that.
Equation 1:
Figure 112012082532467-pat00013

Equation 2:
Figure 112012082532467-pat00014

Where m is the maximum sampling width, n is the number of sampling directions, and r is the maximum sampling length.
Equation 3:
Figure 112012082532467-pat00015

Where A is the shadow value of the ambient occlusion, n is the number of sampling directions, i is the order of the sampling direction, p is the position of the current texel, p i is the value of the texel with the lowest depth value in the i th sampling direction. Position, m is the maximum sampling width)
제1항에 있어서,
상기 이웃 텍셀들의 깊이 값을 샘플링 하는 단계는,
상기 현재 텍셀을 중심으로 하여 방사형을 이루는 n개(단, n은 2이상의 정수임)의 방향으로 샘플링을 진행하는 것
을 특징으로 하는 다각형 앰비언트 오클루전 방법.
The method of claim 1,
Sampling the depth values of the neighboring texels,
Sampling in the direction of n radial lines (n is an integer of 2 or more) centering on the current texel
Polygonal ambient occlusion method characterized in that.
제2항에 있어서,
상기 주변광 다각형을 생성하는 단계는,
상기 샘플링이 진행되는 상기 n개의 방향에 대하여 각 방향에서 샘플링 된 깊이 값 중 가장 낮은 깊이 값을 가지는 이웃 텍셀을 연결하여 하나의 주변광 다각형을 생성하는 것
을 특징으로 하는 다각형 앰비언트 오클루전 방법.
The method of claim 2,
Generating the ambient light polygon,
Generating one ambient light polygon by connecting neighboring texels having the lowest depth value among the depth values sampled in each direction with respect to the n directions in which the sampling is performed;
Polygonal ambient occlusion method characterized in that.
삭제delete 삭제delete
KR1020120074419A 2012-07-09 2012-07-09 Real time polygonal ambient occlusion method using depth texture KR101210796B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020120074419A KR101210796B1 (en) 2012-07-09 2012-07-09 Real time polygonal ambient occlusion method using depth texture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020120074419A KR101210796B1 (en) 2012-07-09 2012-07-09 Real time polygonal ambient occlusion method using depth texture

Publications (1)

Publication Number Publication Date
KR101210796B1 true KR101210796B1 (en) 2012-12-11

Family

ID=47907362

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020120074419A KR101210796B1 (en) 2012-07-09 2012-07-09 Real time polygonal ambient occlusion method using depth texture

Country Status (1)

Country Link
KR (1) KR101210796B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000036058A (en) 1998-07-17 2000-02-02 Namco Ltd Picture generation device and information storage medium
KR100888528B1 (en) 2006-12-14 2009-03-11 인스티튜트 포 인포메이션 인더스트리 Apparatus, method, application program and computer readable medium thereof capable of pre-storing data for generating self-shadow of a 3D object
US20090153557A1 (en) 2007-12-14 2009-06-18 Rouslan Dimitrov Horizon split ambient occlusion

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000036058A (en) 1998-07-17 2000-02-02 Namco Ltd Picture generation device and information storage medium
KR100888528B1 (en) 2006-12-14 2009-03-11 인스티튜트 포 인포메이션 인더스트리 Apparatus, method, application program and computer readable medium thereof capable of pre-storing data for generating self-shadow of a 3D object
US20090153557A1 (en) 2007-12-14 2009-06-18 Rouslan Dimitrov Horizon split ambient occlusion

Similar Documents

Publication Publication Date Title
US10573058B2 (en) Stable ray tracing
US11816782B2 (en) Rendering of soft shadows
JP6910130B2 (en) 3D rendering method and 3D rendering device
US11302058B2 (en) System for non-planar specular reflections in hybrid ray tracing
US8379021B1 (en) System and methods for rendering height-field images with hard and soft shadows
US10049486B2 (en) Sparse rasterization
CN114581589A (en) Image processing method and related device
US8743114B2 (en) Methods and systems to determine conservative view cell occlusion
JP5873672B2 (en) Method for estimating the amount of light received at a point in a virtual environment
Mara et al. Toward practical real-time photon mapping: Efficient gpu density estimation
US10776996B2 (en) Method and apparatus for processing image
US10417813B2 (en) System and method for generating temporally stable hashed values
KR20120047778A (en) Method for estimation of occlusion in a virtual environment
Szirmay-Kalos et al. Volumetric ambient occlusion for real-time rendering and games
KR102558739B1 (en) 3d graphic rendering method and apparatus
Venceslas et al. Real time rendering of atmospheric scattering and volumetric shadows
KR101208826B1 (en) Real time polygonal ambient occlusion method using contours of depth texture
KR101080508B1 (en) Multi-level progrssive photon mapping method
KR101210796B1 (en) Real time polygonal ambient occlusion method using depth texture
Kolivand et al. Shadow mapping or shadow volume?
Szirmay-Kalos et al. Volumetric ambient occlusion
Simion et al. Practical gpu and voxel-based indirect illumination for real time computer games
Wahlén Global Illumination in Real-Time using Voxel Cone Tracing on Mobile Devices
Lee et al. Contour‐based polygonal ambient occlusion using a single‐depth texture
Knuth et al. A Hybrid Ambient Occlusion Technique for Dynamic Scenes

Legal Events

Date Code Title Description
A201 Request for examination
A302 Request for accelerated examination
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: 20151001

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20170829

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee