KR20110069259A - Parallel collision detection method based on inter conllision detection and computer readable media thereof - Google Patents

Parallel collision detection method based on inter conllision detection and computer readable media thereof Download PDF

Info

Publication number
KR20110069259A
KR20110069259A KR1020090125919A KR20090125919A KR20110069259A KR 20110069259 A KR20110069259 A KR 20110069259A KR 1020090125919 A KR1020090125919 A KR 1020090125919A KR 20090125919 A KR20090125919 A KR 20090125919A KR 20110069259 A KR20110069259 A KR 20110069259A
Authority
KR
South Korea
Prior art keywords
collision
thread
bvh
threads
nodes
Prior art date
Application number
KR1020090125919A
Other languages
Korean (ko)
Other versions
KR101084980B1 (en
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 KR1020090125919A priority Critical patent/KR101084980B1/en
Publication of KR20110069259A publication Critical patent/KR20110069259A/en
Application granted granted Critical
Publication of KR101084980B1 publication Critical patent/KR101084980B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/10Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/21Collision detection, intersection

Abstract

PURPOSE: A parallel collision detection method based on inter collision detection and a computer readable media thereof are provided to minimize the locking by distributing the task efficiently when the collision detection of an object is executed using a plurality of threads. CONSTITUTION: The bounding volume hierarchy(BVH) for objects is created based on the geometric information of objects(S110). The main BVH is created based on the BVHs of the objects (S120). The subtrees in which the reciprocity irrelevant nodes are the root are extracted from the main BVH(S130). The nodes composed in the subtrees are distributed to each of threads(S140). An inter collision test pair set(ICTPS), which is a set of the node pairs composed in the subtrees, are created for performing the collision detection between the objects for the parent node of the nodes(S150).

Description

상호충돌검사 기반 병렬충돌검사 방법 및 컴퓨터 판독가능 매체{PARALLEL COLLISION DETECTION METHOD BASED ON INTER CONLLISION DETECTION AND COMPUTER READABLE MEDIA THEREOF}PARALLEL COLLISION DETECTION METHOD BASED ON INTER CONLLISION DETECTION AND COMPUTER READABLE MEDIA THEREOF}

본 발명은 영상처리에 관한 것으로서, 보다 구체적으로는 영상에서 물체의 충돌 감지에 관한 것이다.The present invention relates to image processing, and more particularly, to collision detection of an object in an image.

물체의 충돌 감지란 기하학 데이터로 이루어진 가상세계에서 기하학 데이터로 표현된 두 물체 사이의 충돌(물체간 충돌, Inter-collision) 또는 한 물체의 두 부분의 충돌(자기 충돌, Intra-collision or self-collision)을 검출하는 것을 의미한다. 일반적으로, 효율적인 충돌 검사를 위해 바운딩 볼륨 체계(bounding volume hierarchies, BVH), KD-Tree 등의 계층적인 자료 구조를 이용하며, 물체를 구성하는 기초 다각형(elementary polygonal)간 충돌여부 확인을 위해 수학적 방법을 사용한다. 충돌 검사 방법은 이산적 그리고 연속적 검출 방법으로 나눌 수 있다. 정확한 충돌 검사를 위해서는 연속적 충돌 검사를 수행해야 하지만 많은 연산량을 요구한다는 단점을 가지고 있다.Collision detection of objects refers to collisions between two objects represented as geometric data (inter-collision) or collisions of two parts of an object (magnetic collision, intra-collision or self-collision) in a virtual world of geometric data. ) Means detecting. In general, it uses hierarchical data structures such as bounding volume hierarchies (BVH) and KD-Tree for efficient collision detection, and mathematical methods to check for collisions between elementary polygons constituting an object. Use Collision checking methods can be divided into discrete and continuous detection methods. Accurate collision checking requires continuous collision checking, but has a disadvantage of requiring a large amount of computation.

이러한 연속적 충돌 검사의 단점을 극복하기 위해서 많은 방법들이 제시되 었으며, 멀티코어 중앙처리장치(CPU) 또는 그래픽처리장치(GPU)를 이용하는 병렬처리 알고리즘들도 제시되어 있다. 하지만, 기존 병렬처리 알고리즘들은 멀티코어 CPU 또는 GPU 중 하나만 이용하는 방법으로서 실시간 처리를 요구하는 분야에 사용하기에는 성능(속도) 면에서 충분하지 못하다. Many methods have been proposed to overcome the shortcomings of such continuous collision checking, and parallel processing algorithms using a multicore CPU or a graphics processor are also presented. However, the existing parallel processing algorithms use only one of a multicore CPU or a GPU, and are not sufficient in terms of performance (speed) for use in a field requiring real time processing.

BVH 등의 계층적 자료구조를 이용하는 환경에서 여러 개의 코어를 동시에 사용해서 충돌 검사를 수행할 경우, 자료구조를 갱신 및 탐색하는 동안 둘 이상의 스레드(thread)가 같은 데이터에 접근하는 경우가 발생한다. 이와 같은 잘못된 데이터 접근 및 갱신을 방지하기 위하여 록킹(Locking) 메커니즘을 사용한다. 록킹 메커니즘이란 한 스레드가 어떤 데이터에 접근할 때 다른 스레드의 접근을 막는 것을 의미하며, 이런 경우 접근이 막힌 스레드는 접근이 풀릴 때까지 다른 태스크(task)를 처리하지 않고 기다리게 된다. When collision checking is performed using multiple cores simultaneously in an environment using hierarchical data structures such as BVH, two or more threads may access the same data while updating and searching data structures. Locking mechanisms are used to prevent such invalid data access and update. The locking mechanism means that when one thread accesses data, the other thread blocks access. In this case, the blocked thread waits without processing another task until the access is released.

기존의 멀티코어를 이용한 충돌 검사 방법들은 이런 록킹 메커니즘을 사용하기 때문에 사용 가능한 코어를 최대한으로 사용하지 못한다는 문제점을 가지고 있다. 이러한 문제점은 충돌은 한 부분에 집중적으로 발생하는 경향을 의미하는 충돌의 국지 발생 특성(Locality)에 의해, 그리고 멀티 코어를 이용함에 따라 더욱더 심화된다. Existing multi-core collision detection methods use this locking mechanism and thus do not use the available cores to the maximum. This problem is exacerbated by the locality of the collision, which means that the collision tends to be concentrated in one part, and with the use of multicore.

본 발명은 속도가 향상되고 CPU의 스레드 개수가 증가하는 경우에 충돌 검사 방법의 높은 확장성을 보장할 수 있는 충돌 검사 방법을 제공하는 것을 목적으로 한다.An object of the present invention is to provide a collision checking method that can ensure high scalability of the collision checking method when the speed is improved and the number of threads of the CPU is increased.

또한, 본 발명은 CPU의 스레드 개수가 증가할수록 충돌 검사의 속도가 향상되는 충돌 검사 방법을 제공하는 것을 목적으로 한다.Another object of the present invention is to provide a collision checking method in which the speed of collision checking is improved as the number of CPU threads increases.

또한, 본 발명은 복수의 스레드를 이용하여 물체 충돌 검사를 수행함에 있어, 효율적인 일 분배 방법을 통해 록킹을 최소화할 수 있는 충돌 검사 방법을 제공하는 것을 목적으로 한다.In addition, an object of the present invention is to provide a collision inspection method that can minimize locking through an efficient work distribution method in performing an object collision inspection using a plurality of threads.

청구항 1의 발명은 컴퓨터 시스템에서 수행되는 씬(scene)에 포함된 물체 사이의 충돌을 검출하기 위한 방법으로서, 각 물체들의 기하학적 정보에 기초하여 상기 각 물체들에 대한 바운딩 볼륨 체계(bounding volume hierarchies, BVH)를 생성하는 단계, 상기 각 물체들의 BVH들에 기초한 메인 BVH를 생성하는 단계, 상기 메인 BVH에서 상호 무관성이 성립하는 노드들을 루트로 하는 복수의 서브트리를 추출하는 단계, 상기 복수의 서브트리에 구성된 노드들을 복수의 스레드(thread)에 각각 분배하는 단계, 및 상기 복수의 서브트리에 구성된 노드들을 자식 노드로 하는 부모 노드에 대한 물체 간 충돌검사를 수행하기 위하여, 상기 복수의 서브트리에 구성된 노드 쌍의 집합인 ICTPS(inter collision test pair set)를 생성하는 단계를 포함한다.The invention of claim 1 is a method for detecting a collision between objects included in a scene performed in a computer system, comprising: bounding volume hierarchies for each of the objects based on geometrical information of the objects; Generating a main BVH based on the BVHs of the respective objects, extracting a plurality of subtrees rooted at nodes having mutual independence in the main BVH, the plurality of subs Distributing nodes configured in the tree to a plurality of threads, and performing object-to-object collision checking on a parent node having nodes configured in the plurality of subtrees as child nodes. Generating an inter collision test pair set (ICTPS) that is a set of configured node pairs.

청구항 2의 발명은 상기 메인 BVH에 포함된 상기 기초 다각형은 삼각형(triangle)인 것을 특징으로 한다.The invention of claim 2 is characterized in that the elementary polygon included in the main BVH is a triangle.

청구항 3의 발명은 상기 복수의 스레드 중 요청 스레드는 배분 스레드에게 태스크 재분배 요청을 하고, 상기 배분 스레드는 상기 태스크 재분배 요청에 의해, 자신에게 할당된 충돌 검사 대상 기초 다각형의 정보를 상기 요청 스레드에게 주며, 상기 요청 스레드는 상기 복수의 스레드 중 자신의 태스크를 끝내고 더 이상 태스크가 없는 스레드를 의미하고, 상기 배분 스레드는 복수의 스레드 중 태스크를 가지고 있는 스레드를 의미하는 것을 특징으로 한다.The present invention of claim 3, wherein the requesting thread of the plurality of threads makes a task redistribution request to a distributing thread, and the distributing thread gives the requesting thread information on the collision checking target polygon allocated to itself by the task redistribution request. The request thread means a thread that finishes its task among the plurality of threads and no longer has a task, and the distribution thread means a thread having a task among the plurality of threads.

청구항 4의 발명은 컴퓨터에 의해 실행 가능한 프로그램을 탑재하는 컴퓨터 판독가능 매체로서, 상기 프로그램은, 컴퓨터 시스템에서 수행되는 씬(scene)에 포함된 물체 사이의 충돌을 검출하는 방법으로서 청구항 1 내지 3의 발명 중 어느 한 발명에 따른 충돌 검출 방법을 실행하기 위한 프로그램이다.The invention of claim 4 is a computer readable medium carrying a program executable by a computer, wherein the program is a method of detecting a collision between objects included in a scene executed in a computer system. A program for executing a collision detection method according to any one of the inventions.

본 발명에 의하면, 충돌 검사 작업의 속도를 향상시킬 수 있고, CPU의 스레드 개수가 증가하는 경우에 충돌 검사 방법의 높은 확장성을 보장할 수 있다.According to the present invention, the speed of the collision checking operation can be improved, and the high scalability of the collision checking method can be ensured when the number of threads of the CPU increases.

또한, 본 발명에 의하면 CPU의 스레드 개수가 증가할수록 충돌 검사의 속도가 향상된다. In addition, according to the present invention, as the number of threads of the CPU increases, the speed of collision checking is improved.

또한, 복수의 스레드를 갖는 CPU를 이용하여 물체 충돌 검사를 수행함에 있어 핵심 루프에서 록킹을 사용하지 않도록 해주며, 효과적인 태스크 분배를 가능하다.In addition, when performing object collision check using a CPU having a plurality of threads, it is possible to avoid locking in a core loop and to effectively distribute tasks.

본 발명에서는 계층적 자료구조 갱신 및 탐색 작업을 효율적으로 CPU 스레드에게 분배하는 새로운 태스크 분배 방법을 포함한다.The present invention includes a new task distribution method that efficiently distributes hierarchical data structure update and search operations to CPU threads.

본 발명에서는 기존 기술의 문제점을 해결하기 위해 다음과 같은 방법을 사용할 수 있다.In the present invention, the following method can be used to solve the problems of the existing technology.

1) 계층적 자료구조의 생성 및 갱신과 탐색을 위해서 멀티코어 CPU를 사용할 수 있다.1) Multicore CPUs can be used to create, update, and search hierarchical data structures.

2) 계층적 자료구조의 갱신 및 탐색 작업을 여러 개의 CPU 스레드가 록킹 메커니즘 없이 동신에 수행할 수 있도록 태스크를 나누고, 각 스레드에 할당해 줄 수 있다.2) Tasks can be divided and allocated to each thread so that hierarchical data structures can be updated and searched by multiple CPU threads without a locking mechanism.

3) 여러 개의 CPU 코어가 모두 최대로 이용되게 하기 위해서 태스크가 많은 스레드와 태스크가 적은 스레드들 사이에 태스크를 적은 비용으로 주고 받을 수 있게 할 수 있다.3) In order to maximize the utilization of multiple CPU cores, a task can be able to send and receive tasks at low cost between many threads and fewer threads.

이하, 첨부된 도면을 참조하여 본 발명을 상세히 설명한다. 본 발명을 설명함에 있어 주지기술이 본 발명의 구성이 일부인 경우 그 주지기술에 대해서는 상세한 설명을 생략하도록 한다. 이렇게 하더라도 당업자는 본 발명을 정확하게 이해하고 용이하게 재현할 수 있을 것이다.Hereinafter, with reference to the accompanying drawings will be described in detail the present invention. In the description of the present invention, if the known technology is a part of the configuration of the present invention, a detailed description thereof will be omitted. Even so, those skilled in the art will be able to correctly understand and easily reproduce the present invention.

[실시예][Example]

도 1은 본 발명의 실시예에 따른 충돌 검사 방법의 순서도이다. 본 발명의 실시예에 따른 충돌 검사 방법은, 컴퓨터 시스템에서 수행되는, 씬(scene)에 포함된 두 물체 사이의 충돌 또는 한 물체내의 두 부분의 충돌을 검출하는 방법에 관한 것이며, 보다 구체적으로 물체 간 충돌 검사를 위한 태스크 분배 방법에 관한 것이다. 여기서 컴퓨터 시스템은 CPU를 포함할 수 있다. 1 is a flow chart of a collision detection method according to an embodiment of the present invention. A collision detection method according to an embodiment of the present invention relates to a method for detecting a collision between two objects included in a scene or a collision between two parts in an object, which is performed in a computer system, and more specifically, an object. Task distribution method for collision detection between. Wherein the computer system may comprise a CPU.

먼저 첫 번째 단계 S110에서, 씬(scene)에 포함된 물체의 기하학적 정보로부터 각 물체의 바운딩 볼륨 체계(bounding volume hierarchies, 이하 BVH라고 함)를 생성한다. BVH는 연속충돌 검사에서 가속화를 위하여 사용되는 기법으로서 바운딩 볼륨(bounding volume, BV)을 계층적(예를 들어 트리 구조로)으로 나타낸 데이터 구조이다. 바운딩 볼륨은 물체의 부피 일부 또는 전부를 감싸는 영역을 의미한다. 여러 종류의 바운딩 볼륨이 공지되어 있으며, 본 발명에서는 그 중 가장 널리 사용되고 있는 축-정렬 바운딩 박스(axis-aligned bounding boxes, AABBs)를 사용하는 경우를 가정하고 이후의 설명을 계속한다. AABB가 아니더라도 구(spheres), 오리엔티드 바운딩 박스(oriented bounding boxes, OBBs 등의 BV를 이용해서 본 발명을 실시할 수도 있다. 정리하면, BVH는 씬 내에 포함된 물체들을 바운딩 볼륨으로 구분하고, 그 바운딩 볼륨을 또 다시 복수(예를 들어 2개)의 바운딩 볼륨으로 쪼개는 것을 반복하여 최종적으로 바운딩 볼륨을 기초 다각형으로 쪼갠 것을 계층화된 데이터 구조로 나타낸 것이다. BVH가 트리 구조인 경우, 말단 노드에 기초 다각형들이 존재하게 된다. First, in a first step S110, bounding volume hierarchies (hereinafter referred to as BVH) of each object are generated from the geometric information of the objects included in the scene. BVH is a technique used for acceleration in continuous collision checking, which is a data structure representing a bounding volume (BV) hierarchically (for example, in a tree structure). Bounding volume refers to an area surrounding some or all of the volume of an object. Several types of bounding volumes are known, and the following description assumes the use of the most widely used axis-aligned bounding boxes (AABBs). Although not AABB, the present invention may also be implemented using BVs such as spheres, oriented bounding boxes (OBBs), etc. In summary, BVH divides objects contained in the scene into bounding volumes, Repeated division of the bounding volume into multiple (e.g., two) bounding volumes, resulting in a hierarchical data structure that finally breaks the bounding volume into underlying polygons, based on the end node if BVH is a tree structure. Polygons will exist.

그 다음 단계 S120에서, 각 물체의 BVH로부터 하나의 메인 BVH를 생성한다. 각 BVH들의 루트(root) 노드들을 묶는 상위 노드들을 추가하여 하나의 메인 BVH를 생성할 수 있다. 이렇게 함으로써, 여러 물체들을 하나의 물체로 취급하면서 물체 간 충돌을 물체 내부의 충돌과 마찬가지로 취급할 수 있다.In step S120, one main BVH is generated from the BVH of each object. One main BVH may be created by adding upper nodes that bind root nodes of respective BVHs. By doing so, it is possible to treat collisions between objects in the same way as collisions inside objects while treating several objects as one object.

한편, 도시하지 않았으나, 물체 모델이 변형(deforming)되고 있는 경우에는 BVH를 업데이트할 수 있다. BVH를 업데이트하는 방법으로는 재생성이 필요한 부분만 재생성하고 그렇지 않은 부분은 갱신만 하는 선택적 재구성(selective reconstruction) 방법을 사용할 수 있다. 그 구체적 방법은, [YCM07] YOON S., CURTIS S., MANOCHA D.: Ray tracing dynamic scenes using selective restructuring. Eurographics Symp. on Rendering (2007), 73?84. 3에 개시된 방법을 이용할 수 있다. BVH 전체 또는 일부를 수시로 업데이트할 수도 있고, 필요에 따라 선택적으로 BVH를 재구성할 수도 있다. Although not shown, the BVH may be updated when the object model is being deformed. As a method of updating the BVH, a selective reconstruction method of regenerating only a portion that needs to be regenerated and updating only a portion that is not necessary may be used. The specific method is described in [YCM07] YOON S., CURTIS S., MANOCHA D .: Ray tracing dynamic scenes using selective restructuring. Eurographics Symp. on Rendering (2007), 73-84. The method disclosed in 3 can be used. The whole or part of the BVH may be updated from time to time, and the BVH may be selectively reconfigured as needed.

그 다음 단계 S130에서, 하나의 메인 BVH에서 서로 상호 무관성이 성립하는 복수의 서브트리를 추출한다. 이를 위해 먼저, 물체 내 충돌 검사를 물체 간 충돌 검사로 바꾸어 준다. 이를 표현하기 위하여, 도 2에 도시된 바와 같이, 한 물체를 표현한 계층적 자료구조에서 한 부모 노드 N이 없다고 가정하면, 그 부모 노드 N의 바로 하위에 존재하는 자식 노드 A, B는 각각의 물체가 되고, 그 자식 노드 A, B 사이의 충돌은 물체 간 충돌 검사와 같게 된다는 성질을 갖게 된다. 이와 같이, 물체 간 충돌 검사를 위해 가정한 자식 노드 A, B는 하나의 서브트리가 되며, 서로 상호 무관성(Disjoint property)을 갖는다. Then, in step S130, a plurality of subtrees having mutual independence at one main BVH are extracted. To do this, first replace the collision detection within the object with the collision detection between objects. To represent this, as shown in FIG. 2, assuming that there is no one parent node N in the hierarchical data structure representing an object, child nodes A and B that are immediately below the parent node N are each object. The collision between the child nodes A and B becomes the same as the collision inspection between objects. As such, the child nodes A and B assumed for collision checking between objects become one subtree, and have mutually independent relations.

상호 무관성은 두 상호 충돌 검사를 구성하는 물체들이 서로 계층적 자료구 조 상에서 부모-자식 관계가 없는 경우 충돌 검사를 수행하는 동안 방문하는 노드들은 겹치는 경우가 없다는 성질이다. 예를 들어 도 3에 도시된 바와 같이, 물체 C, D, E 및 F는 서로 부모-자식 관계가 없으므로, (C, D)를 루트 노드로 갖는 서브트리와 (E, F)를 루트 노드로 갖는 서브트리 사이의 물체 간 충돌 검사 동안에는 서로 접근하는 노드가 완전히 독립적이라는 것이다. 다른 예로, 도 4에 도시된 노드 n4, n5, n6, n7은 서로 상호 무관성이 성립한다. 만약, 할당된 노드들 사이에 상호무관 성질이 성립한다면 록킹 메커니즘을 사용하지 않고 레이지 BV 재구성(Lazy BVH reconstruction)을 사용하면서 BVH를 탐색할 수 있게 된다. 레이지 BV 재구성이란, 노드의 상태를 현재 상태에 맞추어 업데이트하는 작업이, 계측적(hierarchy) 탐색 중 해당 노드가 처음 방문될 때 수행된다는 의미이다. 노드의 업데이트 작업은 write operation이 필요하기 때문에 록킹이 필요하지만, 본 발명에서 제안하는 상호 무관성을 이용한 태스트 분배 방법에 따르면, 하나의 노드를 여러 스레드가 방문하는 경우가 없기 때문에 록킹 메커니즘을 사용할 필요가 없다.Mutual independence is that if the objects that make up the two collision tests have no parent-child relationship on the hierarchical data structure, the nodes visited during the collision check are not overlapped. For example, as shown in FIG. 3, the objects C, D, E, and F do not have parent-child relationships with each other, and thus, a subtree having (C, D) as the root node and (E, F) as the root node. During collision checking between objects between subtrees, the nodes approaching each other are completely independent. As another example, nodes n4, n5, n6, and n7 shown in FIG. 4 have mutual independence. If mutually independent properties are established between allocated nodes, BVH can be searched using Lazy BVH reconstruction without using a locking mechanism. Lazy BV reconstruction means that updating a node's state to the current state is performed when the node is first visited during a hierarchy search. Locking is necessary because the update operation of a node requires a write operation. However, according to the task distribution method using mutual independence proposed by the present invention, a locking mechanism needs to be used because multiple threads do not visit a node. There is no.

최초 할당되는 노드들 사이에 상호 무관성이 있도록 하기 위해서, 넓이우선(breadth-first) 탐색을 수행해서 이 성질이 만족하는 노드를 사용 가능한 스레드 수만큼 추출할 수 있다. 예를 들어 도 4에 나타낸 바와 같이, 사용 가능한 스레드 수가 4개인 경우, BVH의 루트에서 같은 깊이를 갖는 노드의 개수가 4가 되는 노드들을 선택할 수 있다. 이렇게 선택한 노드들(n4, n5, n6, n7)과 그 자식 노드들을 로우-레벨(low-level) 노드라고 칭하며, 나머지는 하이-레벨(high-level) 노드라고 한다. 즉, 도 4의 예에서 n1, n2, n3가 하이-레벨 노드이고 나머지는 로우-레 벨 노드이다. To ensure that there is no correlation between the nodes that are initially allocated, breadth-first searches can be performed to extract the number of available threads for nodes that satisfy this property. For example, as shown in FIG. 4, when the number of available threads is four, it is possible to select nodes whose number of nodes having the same depth is four at the root of the BVH. The selected nodes n4, n5, n6, and n7 and their child nodes are called low-level nodes, and the rest are called high-level nodes. That is, in the example of FIG. 4, n1, n2, n3 are high-level nodes and the rest are low-level nodes.

그 다음 단계 S140에서, 복수의 서브트리에 구성된 노드들을 자식 노드로 하는 부모 노드 각각에 대하여 물체 간 충돌 검사를 처리하기 위해, 태스크 분배가 이루어진다. 이때, 복수의 서브트리에 구성된 노드들을 복수의 CPU 스레드에 각각 할당한다. 예를 들어 도 4를 참조하면, 추출한 서브트리들이 n4, n5, n6, n7 루트 노드로 구성되어 있을 경우, 각각의 노드들는 CPU 스레드(Thread 1, Thread 2, Thread 3, Thread 4)에 각각 할당될 수 있다. 즉, n4는 Thread 1으로, n5는 Thread 2로, n6는 Thread 3로, n7은 Thread 4로 각각 할당될 수 있다. 이러한 과정은 충돌검사 태스크의 초기 분배 과정에 해당하며, 이후, 동적 태스크 재분배가 추가로 이루어 질 수 있다. 동적 태스크 재분배에 대해서는 후술하도록 한다.Then, in step S140, task distribution is performed to process the object-to-object collision check for each parent node having nodes configured in the plurality of subtrees as child nodes. At this time, the nodes configured in the plurality of subtrees are allocated to the plurality of CPU threads, respectively. For example, referring to FIG. 4, when the extracted subtrees are composed of n4, n5, n6, and n7 root nodes, each node is allocated to CPU threads (Thread 1, Thread 2, Thread 3, Thread 4), respectively. Can be. That is, n4 may be assigned to Thread 1, n5 to Thread 2, n6 to Thread 3, and n7 to Thread 4. This process corresponds to the initial distribution process of the collision detection task, after which the dynamic task redistribution may be additionally performed. The dynamic task redistribution will be described later.

그 다음 단계 S150에서, 부모 노드 사이의 충돌검사를 수행하기 위하여, 자식 노드 쌍들로 구성된 집합인 ICTPS(inter collision test pair set)를 생성한다. 도 4를 참조하면, 부모 노드 n2에 대하여 ICTPS를 처리(ICTPS(n2))(S151)한다고 할 경우, ICTPS(n2)는 n2의 자식 노드 n4와 n5를 루트로 가지는 서브트리 사이의 충돌 검사이므로, n4 또는 n5 노드로 구성된 노드 쌍들의 집합을 생성(S152)할 수 있다. 또한, ICTPS(n3)의 경우(S151), n3의 자식 노드 n6 또는 n7로 구성된 노드 쌍들의 집합을 생성(S152)할 수 있다. 이러한 ICTPS은 여러 개의 CPU 스레드에서 동시에 처리될 수 있다.Next, in step S150, to perform collision checking between the parent nodes, an inter collision test pair set (ICTPS), which is a set composed of pairs of child nodes, is generated. Referring to FIG. 4, in the case of processing ICTPS for a parent node n2 (ICTPS (n2)) (S151), since ICTPS (n2) is a collision check between a child node n4 of n2 and a subtree having n5 as a root, In operation S152, a set of node pairs composed of n4 or n5 nodes may be generated. In addition, in the case of ICTPS n3 (S151), a set of node pairs composed of the child nodes n6 or n7 of n3 may be generated (S152). These ICTPS can be processed simultaneously by multiple CPU threads.

이상의 단계는 CPU에서 처리될 수 있다.The above steps can be processed in the CPU.

이후, GPU를 통해 TCTPS를 기반으로 충돌검사를 수행할 수 있다. Thereafter, collision checking may be performed based on TCTPS through the GPU.

이와 같이 복수의 CPU 스레드를 이용하여 상호 무관성이 성립하는 복수의 서브트리를 개별적으로 처리함으로써 CPU의 스레드 개수가 증가할수록 충돌 검사의 속도가 향상될 수 있다. As described above, by processing a plurality of subtrees that are independent of each other using a plurality of CPU threads, the speed of collision checking may be improved as the number of CPU threads increases.

동적 태스크 재분배(dynamic task reassignment)Dynamic task reassignment

복수의 스레드를 이용하는 경우 다이나믹 태스크 재분배를 이용하여 CPU 자원을 가장 효율적으로 이용할 수 있다.When using multiple threads, dynamic task redistribution can be used to most efficiently use CPU resources.

복수의 스레드 중 자신의 태스크를 빨리 끝내고 더 이상 태스크가 없는 스레드를 '요청 스레드'라고 하고, 태스크를 충분히 가지고 있는 스레드를 '배분 스레드'라고 부르기로 한다. 태스크 유닛 큐(task unit queue)의 프론트(front)(여기서 상호 무관성이 성립하는 노드들로 구성된 서브트리)에 있는 노드(이하, 프론트 노드라고 함)들 중 태스크가 많은 스레드를 배분 스레드로 선택한다. 이에 따라 요청 스레드는 태스크 재분배 요청을 한다. The task is to quickly finish its task among multiple threads, call a thread that no longer has a task, and call a thread that has enough tasks. Select a thread with a large number of tasks among the nodes in the front of the task unit queue (here, a subtree of nodes with mutual independence) referred to as the front node. do. Accordingly, the request thread makes a task redistribution request.

다음, 배분 스레드가 선택되면, 배분 스레드는 요청 스레드의 태스크 재분배 요청에 의해 프론트 노드를 요청 스레드에게 줌으로써 동적 태스크 재분배가 이루어진다. 이러한 동적 태스크 분배 방법의 이론적 근거는 태스크 유닛 큐 내의 모든 노드들은 상호 무관성을 만족한다는 것이다. 그리고 태스크 유닛 큐의 프론트 노드를 요청 스레드에 주는 이유는 프론트 노드의 서브트리에 가장 많은 태스크가 있다고 볼 수 있기 때문이다. 이와 같은 동적 태스크 재분배를 이용하여 8개의 CPU 코어를 이용해서 최대 7배의 성능향상을 얻을 수 있었다.Next, when the distribution thread is selected, the distribution thread is dynamic task redistribution by giving the front thread to the requesting thread by the task redistribution request of the requesting thread. The theoretical basis of this dynamic task distribution method is that all nodes in the task unit queue satisfy mutual independence. The reason for giving the front node of the task unit queue to the request thread is that there are the most tasks in the front tree's subtree. Using this dynamic task redistribution, up to seven times better performance can be achieved using eight CPU cores.

요청 스레드는 분배 스레드의 스케줄링 큐에 태스크 요청 메시지를 입력한다. 분배 스레드의 스케줄링 큐에 접근하기 위해서는 분배 스레드의 록킹이 필요하지만 여러 스레드가 같은 스레드의 스케줄링 큐에 접근하는 경우는 드물기 때문에 성능에 큰 영향을 미치지 않는다. 요청 메시지를 분배 스레드의 스케줄링 큐에 입력한 후에 요청 스레드는 슬립(sleep) 상태가 된다.The request thread enters a task request message into the scheduling queue of the distribution thread. The locking of the distribution thread is required to access the scheduling queue of the distribution thread. However, since multiple threads rarely access the scheduling queue of the same thread, it does not affect performance. After entering the request message into the scheduling thread of the distribution thread, the request thread goes to sleep.

각 스레드는 하나의 충돌 검사 작업을 끝낸 후에 자신의 스케줄링 큐를 확인한다. 만약 태스크 분배 요청이 있다면 태스크 유닛 큐의 프론트 노드를 요청 노드에 제공한다. 그 다음 슬립 상태인 요청 스레드에게 웨이크업(wake up) 메시지를 전송하고, 요청 스레드는 웨이크업 메시지를 받으면 다시 충돌 검사 작업을 재개할 수 있다.Each thread checks its own scheduling queue after one collision check. If there is a task distribution request, the front node of the task unit queue is provided to the requesting node. It then sends a wake-up message to the requesting thread that is sleeping, and when the requesting thread receives the wake-up message, it can resume collision checking.

본 발명에 의하면 충돌 검사 작업의 속도를 향상시킬 수 있고, CPU의 스레드 개수가 증가하는 경우에 충돌 검사 방법의 높은 확장성을 보장할 수 있다. According to the present invention, it is possible to improve the speed of the collision checking operation and ensure high scalability of the collision checking method when the number of threads of the CPU increases.

또한, CPU의 스레드 개수가 증가할수록 충돌 검사의 속도가 향상될 수 있다. In addition, as the number of threads of the CPU increases, the speed of collision checking may be improved.

또한, 복수의 스레드를 갖는 CPU를 이용하여 물체 충돌 검사를 수행함에 있어 핵심 루프에서 록킹을 사용하지 않도록 해주며, 효과적인 태스크 분배를 가능하다.In addition, when performing object collision check using a CPU having a plurality of threads, it is possible to avoid locking in a core loop and to effectively distribute tasks.

이상에서 설명한 충돌 검출 방법은, 컴퓨터에 의해 그 방법을 실행할 수 있는 프로그램이 탑재된 컴퓨터 판독가능 매체로서 구현될 수 있다. 따라서, 상술한 충돌 검출 방법을 실행할 수 있는 프로그램이 포함된 플로피 디스크, CD-ROM, RAM, EEPROM, 마이크로 프로세서, 광자기 디스크, 하드 디스크 등의 프로그램 저장 디바이스 또한 본 발명의 권리 범위에 속하는 것으로 이해되어야 한다.The collision detection method described above can be implemented as a computer readable medium on which a program capable of executing the method by a computer is mounted. Therefore, it is understood that a program storage device such as a floppy disk, a CD-ROM, a RAM, an EEPROM, a microprocessor, a magneto-optical disk, a hard disk, and the like, including a program capable of executing the above-described collision detection method, also belongs to the scope of the present invention. Should be.

이상에서 보는 바와 같이, 본 발명이 속하는 기술 분야의 당업자는 본 발명이 그 기술적 사상이나 필수적 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. As described above, those skilled in the art will understand that the present invention can be implemented in other specific forms without changing the technical spirit or essential features.

그러므로 이상에서 기술한 실시 예들은 모든 면에서 예시적인 것이며 한정적인 것이 아닌 것으로서 이해해야만 하고, 본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 등가개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.Therefore, the above-described embodiments are to be understood as illustrative and not restrictive in all respects, and the scope of the present invention is indicated by the appended claims rather than the foregoing description, and the meaning and scope of the claims and All changes or modifications derived from the equivalent concept should be interpreted as being included in the scope of the present invention.

도 1은 본 발명의 실시예에 따른 충돌 검사 방법의 순서도.1 is a flow chart of a collision detection method according to an embodiment of the present invention.

도 2는 물체 내 충돌 검사를 물체 간 충돌 검사로 바꾸는 방법을 개념적으로 나타낸 도면.2 conceptually illustrates a method of replacing an intra-object collision test with an inter-object collision test;

도 3은 노드 간 상호 무관성을 설명하기 위해 나타낸 도면.3 is a diagram for explaining mutual independence between nodes;

도 4는 BVH 트리 구조와 초기 태스크를 분배하는 방법을 설명하기 위한 도면.4 is a diagram for explaining a method of distributing a BVH tree structure and an initial task.

도 5는 본 발명에 따른 충돌 검사 방법이 수행되는 컴퓨터 시스템의 블록도와 그 구성요소간 데이터 전송 경로를 나타낸 도면.5 is a block diagram of a computer system in which a collision detection method according to the present invention is performed and a diagram illustrating a data transmission path between the components thereof.

Claims (4)

컴퓨터 시스템에서 수행되는, 씬(scene)에 포함된 물체 사이의 충돌을 검출하기 위한 방법으로서, A method for detecting a collision between objects included in a scene, performed in a computer system, 각 물체들의 기하학적 정보에 기초하여 상기 각 물체들에 대한 바운딩 볼륨 체계(bounding volume hierarchies, BVH)를 생성하는 단계;Generating bounding volume hierarchies (BVH) for each of the objects based on the geometric information of the objects; 상기 각 물체들의 BVH들에 기초한 메인 BVH를 생성하는 단계;Generating a main BVH based on BVHs of the respective objects; 상기 메인 BVH에서 상호 무관성이 성립하는 노드들을 루트로 하는 복수의 서브트리를 추출하는 단계;Extracting a plurality of subtrees rooted at nodes having mutual independence in the main BVH; 상기 복수의 서브트리에 구성된 노드들을 복수의 스레드(thread)에 각각 분배하는 단계; 및Distributing nodes configured in the plurality of subtrees to a plurality of threads, respectively; And 상기 복수의 서브트리에 구성된 노드들을 자식 노드로 하는 부모 노드에 대한 물체 간 충돌검사를 수행하기 위하여, 상기 복수의 서브트리에 구성된 노드 쌍의 집합인 ICTPS(inter collision test pair set)를 생성하는 단계Generating an inter-collision test pair set (ICTPS), which is a set of node pairs configured in the plurality of subtrees, in order to perform an object-to-object collision test for a parent node having nodes configured in the plurality of subtrees as child nodes; 를 포함하는 충돌 검출 방법.Collision detection method comprising a. 제1항에 있어서,The method of claim 1, 상기 메인 BVH에 포함된 상기 기초 다각형은 삼각형(triangle)인, 충돌 검출 방법.And wherein the elementary polygon contained in the main BVH is a triangle. 제1항에 있어서,The method of claim 1, 상기 복수의 스레드 중 요청 스레드는 배분 스레드에게 태스크 재분배 요청을 하고,The requesting thread of the plurality of threads makes a task redistribution request to the distribution thread, 상기 배분 스레드는 상기 태스크 재분배 요청에 의해, 자신에게 할당된 충돌 검사 대상 기초 다각형의 정보를 상기 요청 스레드에게 주며,The distribution thread, by the task redistribution request, gives the request thread the information of the collision checking target polygon allocated to itself, 상기 요청 스레드는,The request thread, 상기 복수의 스레드 중 자신의 태스크를 끝내고 더 이상 태스크가 없는 스레드를 의미하고,Means a thread that finishes its own task of the plurality of threads and no more tasks, 상기 배분 스레드는,The distribution thread, 복수의 스레드 중 태스크를 가지고 있는 스레드를 의미하는, 충돌 검사 방법.A collision checking method, meaning a thread having a task among a plurality of threads. 컴퓨터에 의해 실행 가능한 프로그램을 탑재하는 컴퓨터 판독가능 매체로서, A computer readable medium carrying a program executable by a computer, 상기 프로그램은,The program, 컴퓨터 시스템에서, 씬(scene)에 포함된 물체 사이의 충돌을 검출하는 방법으로서 제1항 내지 제3항 중 어느 한 항에 따른 충돌 검출 방법을 실행하기 위한 프로그램인, 컴퓨터 판독가능 매체.A computer-readable medium in a computer system, a program for executing a method of detecting a collision according to any one of claims 1 to 3 as a method for detecting a collision between objects included in a scene.
KR1020090125919A 2009-12-17 2009-12-17 Parallel collision detection method based on inter conllision detection and computer readable media thereof KR101084980B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020090125919A KR101084980B1 (en) 2009-12-17 2009-12-17 Parallel collision detection method based on inter conllision detection and computer readable media thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020090125919A KR101084980B1 (en) 2009-12-17 2009-12-17 Parallel collision detection method based on inter conllision detection and computer readable media thereof

Publications (2)

Publication Number Publication Date
KR20110069259A true KR20110069259A (en) 2011-06-23
KR101084980B1 KR101084980B1 (en) 2011-11-21

Family

ID=44401117

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020090125919A KR101084980B1 (en) 2009-12-17 2009-12-17 Parallel collision detection method based on inter conllision detection and computer readable media thereof

Country Status (1)

Country Link
KR (1) KR101084980B1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013109602A1 (en) * 2012-01-16 2013-07-25 Intel Corporation Time-continuous collision detection using 3d rasterization
CN103337091A (en) * 2013-05-30 2013-10-02 杭州电子科技大学 Flexible scene continuous collision detection method based on thickness
KR101500814B1 (en) * 2012-12-27 2015-03-10 이화여자대학교 산학협력단 Apparatus and method for generating bounding volume using intersection of spheres
US9098917B2 (en) 2012-07-19 2015-08-04 Samsung Electronics Co., Ltd. Method and system for accelerating collision resolution on a reconfigurable processor
WO2023174346A1 (en) * 2022-03-16 2023-09-21 中兴通讯股份有限公司 Collision detection method, electronic device, and computer readable medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101013784B1 (en) 2009-08-31 2011-02-14 이화여자대학교 산학협력단 Hybrid parrallel continuous collision detection using cpu and gpu

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013109602A1 (en) * 2012-01-16 2013-07-25 Intel Corporation Time-continuous collision detection using 3d rasterization
US9196083B2 (en) 2012-01-16 2015-11-24 Intel Corporation Time-continuous collision detection using 3D rasterization
US9098917B2 (en) 2012-07-19 2015-08-04 Samsung Electronics Co., Ltd. Method and system for accelerating collision resolution on a reconfigurable processor
KR101500814B1 (en) * 2012-12-27 2015-03-10 이화여자대학교 산학협력단 Apparatus and method for generating bounding volume using intersection of spheres
CN103337091A (en) * 2013-05-30 2013-10-02 杭州电子科技大学 Flexible scene continuous collision detection method based on thickness
WO2023174346A1 (en) * 2022-03-16 2023-09-21 中兴通讯股份有限公司 Collision detection method, electronic device, and computer readable medium

Also Published As

Publication number Publication date
KR101084980B1 (en) 2011-11-21

Similar Documents

Publication Publication Date Title
Lauterbach et al. gProximity: hierarchical GPU‐based operations for collision and distance queries
US9911212B2 (en) Resetting of dynamically grown accelerated data structure
US9305392B2 (en) Fine-grained parallel traversal for ray tracing
TWI498728B (en) Methods and apparatus for interactive debugging on a non-preemptible graphics processing unit
CN103765376B (en) Graphic process unit with clog-free parallel architecture
US8587588B2 (en) Ray-aggregation for ray-tracing during rendering of imagery
Hapala et al. Efficient stack-less bvh traversal for ray tracing
US20140165049A1 (en) Compiler-controlled region scheduling for simd execution of threads
US20130046518A1 (en) Multithreaded physics engine with impulse propagation
US20110063285A1 (en) Rendering of stereoscopic images with multithreaded rendering software pipeline
JP2009259240A (en) Retargetting application program for execution by general purpose processor
KR101084980B1 (en) Parallel collision detection method based on inter conllision detection and computer readable media thereof
US8564600B2 (en) Streaming physics collision detection in multithreaded rendering software pipeline
US11315303B2 (en) Graphics processing
US20140168228A1 (en) Fine-grained parallel traversal for ray tracing
Yu et al. A robust Delaunay-AFT based parallel method for the generation of large-scale fully constrained meshes
KR101013784B1 (en) Hybrid parrallel continuous collision detection using cpu and gpu
CN103136035B (en) For mixing the method and apparatus of the thread management of the program of thread mode
Vinkler et al. Massively parallel hierarchical scene processing with applications in rendering
US20230023323A1 (en) Intersection testing in a ray tracing system
de Moraes Zamith et al. Parallel processing between GPU and CPU: Concepts in a game architecture
Erbes Efficient parallel proximity queries and an application to highly complex motion planning problems with many narrow passages
US11704860B2 (en) Accelerated processing via a physically based rendering engine
US20220366628A1 (en) Accelerated processing via a physically based rendering engine
Yasar et al. PGAbB: A Block-Based Graph Processing Framework for Heterogeneous Platforms

Legal Events

Date Code Title Description
A201 Request for 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: 20141029

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20151208

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20161026

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20171027

Year of fee payment: 7

LAPS Lapse due to unpaid annual fee