CN103455356A - Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device - Google Patents
Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device Download PDFInfo
- Publication number
- CN103455356A CN103455356A CN2013104067097A CN201310406709A CN103455356A CN 103455356 A CN103455356 A CN 103455356A CN 2013104067097 A CN2013104067097 A CN 2013104067097A CN 201310406709 A CN201310406709 A CN 201310406709A CN 103455356 A CN103455356 A CN 103455356A
- Authority
- CN
- China
- Prior art keywords
- thread pool
- data
- model
- tasks
- asynchronous
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Landscapes
- Image Generation (AREA)
Abstract
The invention relates to a concurrence loading and rendering method of 3D (three-dimensional) models on a multi-core mobile device, comprising the following steps of taking a CPU (Central Processing Unit) core number of the current device as the capacity of a thread pool to create the thread pool; respectively creating 3D model data loading tasks for each 3D model file stored on a secondary storage device; respectively creating a rendering task for each 3D model; submitting all data loading tasks to a buffering queue of the thread pool, and carrying out concurrent execution on the data loading tasks by the thread pool; after the data loading tasks are all executed, submitting the rendering tasks into the buffering queue of the thread pool and carrying out concurrent execution on the rendering tasks by the thread pool; finally, after all rendering tasks are completed, destroying the thread pool and releasing system resources.
Description
Technical field
The invention belongs to field of embedded software.Relate in particular to a kind of concurrent loading of 3D model and rendering intent on the multinuclear mobile device.
Background technology
Along with the development of embedded technology, with the mobile device headed by smart mobile phone, panel computer, obtained swift and violent development.The central processing unit of mobile device from before core go so far as present double-core, four cores or even eight cores.In the 3D application facet, the multinuclear mobile device not only can be showed complicated 3D figure, even can move large-scale 3D game.
3D application for complex scene, need to load and play up a plurality of 3D models.Existing method is that first by all 3D model files, the mode with serial is loaded in internal memory, then in the mode of serial, plays up one by one.Yet, in the multinuclear mobile device, the advantage that the 3D disposal route of this serial can not be brought into play polycaryon processor improves the 3D processing speed.
Summary of the invention
The technical matters that will solve required for the present invention is to provide a kind of concurrent loading of 3D model and rendering intent on the multinuclear mobile device.
The technical scheme that technical solution problem of the present invention is taked is as follows:
First judge the core cpu number of current mobile device before loading and playing up the 3D model.The core cpu number of current device of usining creates thread pool as the capacity of thread pool.Then be respectively each the 3D model file be stored on external equipment and create respectively 3D model data loading tasks.The data loading tasks is used for loading the vertex data, normal vector data, texture coordinate data, face data, material quality data of 3D model file to internal memory.Create respectively rendering task for each 3D model again.Finally more all data loading tasks are submitted in the buffer queue of thread pool, by the concurrent executing data loading tasks of thread pool.After all completing etc. the data loading tasks, rendering task is submitted in the buffer queue of thread pool, by the concurrent execution rendering task of thread pool.After finally waiting all rendering tasks to be finished, destroy the thread pool free system resources.
The present invention has following beneficial effect with respect to prior art: the present invention creates thread pool according to the central processing unit core number of mobile device.Thread pool comes the asynchronous 3D model file of concurrent execution data loading tasks, asynchronous 3D model rendering task with the several worker threads of central processing unit core.Whole process has been given full play to the handling property of multinuclear mobile device.And each task is carried out with asynchronous system, has eliminated the synchronization overhead between each task.Therefore can greatly improve the speed that the multinuclear mobile device loaded and played up the 3D model.
The accompanying drawing explanation
Fig. 1 is process flow diagram of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the invention will be further described.
As shown in Figure 1, on the multinuclear mobile device, concurrent loading and the rendering intent of 3D model comprises the steps:
Step 1: obtain the core cpu number of current mobile device, specifically:
The operating system of using according to mobile device, the API directly provided by operating system or obtain the core cpu number of current mobile device by the number of files of depositing CPU information in the judgement file system.Operating system includes but not limited to IOS system and Android system.
For the mobile device of IOS operating system, can use " sysctlbyname " function to obtain the core number of CPU;
For the mobile device of Android operating system, obtain the core number of CPU by the number of files that records CPU information under judgement "/sys/devices/system/cpu/ " catalogue.The number of files that records CPU information is the core number of CPU;
Step 2: the thread pool that the establishment capacity is the core cpu number, specifically:
Create the thread pool number variable nThread of an integer, the core cpu number that will be obtained by the first step is assigned to variable nThread;
Thread pool class in the application development kit of the operating system of using mobile device to use creates the thread pool that capacity is nThread, and operating system includes but not limited to IOS system and Android system;
For the mobile device of IOS operating system, use " NSOperation " in IOS application development kit to create thread pool, use
The capacity that " queue setMaxConcurrentOperationCount:nThread " statement arranges thread pool is nThread;
For the mobile device of Android operating system, can use " Executors " class in Android application development kit to help create thread pool.Concrete use " Executors.newFixedThreadPool (nThread) " carrys out the thread pool that the establishment capacity is nThread;
Step 3: for each 3D model file creates respectively the asynchronous data loading tasks, specifically:
First traversal is stored in the 3D model file on external equipment, obtains the path of depositing of each model file, and is placed in array;
Create the asynchronous data loading tasks, the specific tasks flow process is again:
Flow process one: according to the file path that is stored in the 3D model file in the array I/O that opens file;
Described 3D model file form comprises OBJ form and 3DS form;
Flow process two: extract the data that are stored in the 3D model file on external equipment, comprising: vertex data, normal vector data, texture coordinate data, face data, material quality data;
Flow process three: the 3D model data of extraction is packaged into separately to a data object;
The data loading tasks number altogether created equals the number of 3D model file;
Step 4: for each 3D model creates respectively asynchronous rendering task, the rendering task flow process specifically:
Flow process one: the 3D model data in the 3D model data object that uses step 3 to encapsulate is paintbrush binding vertex data, the normal vector data, and texture coordinate data, face data, and the material characteristic is set;
Flow process two: the gl.glDrawElements function that calls OpenGl ES is played up the 3D model.
The rendering task number altogether created equals the number of 3D model file;
Step 5: all asynchronous data loading tasks by the concurrent execution of thread pool, specifically:
All asynchronous data loading tasks that will be created by step 3 are submitted in the buffer queue of the thread pool created by step 2;
Start thread pool, carry out concomitantly all asynchronous data loading tasks in buffer queue.
Step 6: all asynchronous rendering task by the concurrent execution of thread pool, specifically:
After all being finished etc. the asynchronous data loading tasks of step 5, all rendering tasks are submitted in the buffer queue of the thread pool created by step 2;
Start thread pool, carry out concomitantly all asynchronous rendering tasks in buffer queue;
After all asynchronous rendering tasks are finished, destroy the thread pool free system resources.
Claims (1)
1. concurrent loading and the rendering intent of 3D model on the multinuclear mobile device, its feature comprises the following steps:
Step 1: obtain the core cpu number of current mobile device, specifically:
The operating system of using according to mobile device, the API directly provided by operating system or obtain the core cpu number of current mobile device by the number of files of depositing CPU information in the judgement file system.
Step 2: the thread pool that the establishment capacity is the core cpu number, specifically:
Create the thread pool number variable of integer, the core cpu number that the value of this variable is set to be obtained by step 1;
Using the thread pool number variable of integer as the capacity parameter of thread pool, and the thread pool class in the application development kit of the operating system of using with mobile device is carried out the thread pool that the establishment capacity is the core cpu number.
Step 3: for each 3D model file creates respectively the asynchronous data loading tasks, specifically:
First traversal is stored in the 3D model file on external equipment, obtains the path of depositing of each model file, and is placed in array;
Create the asynchronous data loading tasks, the tool flow of task is again:
Flow process one: according to the file path that is stored in the 3D model file in the array I/O that opens file;
Flow process two: extract the data that are stored in the 3D model file on external equipment, comprising: vertex data, normal vector data, texture coordinate data, face data, material quality data;
Flow process three: the 3D model data of extraction is packaged into separately to a data object.
Step 4: for each 3D model creates respectively asynchronous rendering task, the rendering task flow process specifically:
Flow process one: the 3D model data in the 3D model data object that uses step 3 to encapsulate is paintbrush binding vertex data, the normal vector data, and texture coordinate data, face data, and the material characteristic is set;
Flow process two: the gl.glDrawElements function that calls OpenGl ES is played up the 3D model.
Step 5: all asynchronous data loading tasks by the concurrent execution of thread pool, specifically:
All asynchronous data loading tasks that will be created by step 3 are submitted in the buffer queue of the thread pool created by step 2;
Start thread pool, carry out concomitantly all asynchronous data loading tasks in buffer queue.
Step 6: all asynchronous rendering task by the concurrent execution of thread pool, specifically:
After all being finished etc. the asynchronous data loading tasks of step 5, all rendering tasks are submitted in the buffer queue of the thread pool created by step 2;
Start thread pool, carry out concomitantly all asynchronous rendering tasks in buffer queue;
After all asynchronous rendering tasks are finished, destroy the thread pool free system resources.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310406709.7A CN103455356B (en) | 2013-09-05 | 2013-09-05 | Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310406709.7A CN103455356B (en) | 2013-09-05 | 2013-09-05 | Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103455356A true CN103455356A (en) | 2013-12-18 |
CN103455356B CN103455356B (en) | 2017-02-08 |
Family
ID=49737763
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310406709.7A Expired - Fee Related CN103455356B (en) | 2013-09-05 | 2013-09-05 | Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103455356B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105094920A (en) * | 2015-08-14 | 2015-11-25 | 网易(杭州)网络有限公司 | Game rendering method and device |
CN105245372A (en) * | 2015-10-12 | 2016-01-13 | 浪潮软件集团有限公司 | Optimization method for loading network resources based on cache and asynchronous mechanism |
CN105741227A (en) * | 2016-01-26 | 2016-07-06 | 网易(杭州)网络有限公司 | Rending method and apparatus |
CN105791254A (en) * | 2014-12-26 | 2016-07-20 | 阿里巴巴集团控股有限公司 | Network request processing method, device and terminal |
CN105979242A (en) * | 2015-11-23 | 2016-09-28 | 乐视网信息技术(北京)股份有限公司 | Video playing method and device |
CN106559447A (en) * | 2015-09-25 | 2017-04-05 | 中兴通讯股份有限公司 | The method for processing business and system of JSLEE containers |
WO2019228497A1 (en) * | 2018-05-31 | 2019-12-05 | Huawei Technologies Co., Ltd. | Apparatus and method for command stream optimization and enhancement |
CN112596811A (en) * | 2020-12-17 | 2021-04-02 | 杭州艾芯智能科技有限公司 | Method, system, computer equipment and storage medium for reducing memory overhead by dynamic data loading |
CN115035228A (en) * | 2022-06-08 | 2022-09-09 | 北京领为军融科技有限公司 | Rendering method for generating texture by reading satellite film file in real time through asynchronous io |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050198644A1 (en) * | 2003-12-31 | 2005-09-08 | Hong Jiang | Visual and graphical data processing using a multi-threaded architecture |
CN102156705A (en) * | 2011-01-26 | 2011-08-17 | 北京数码大方科技有限公司 | CAD (Computer Aided Design) document loading method and device |
US20110216078A1 (en) * | 2010-03-04 | 2011-09-08 | Paul Blinzer | Method, System, and Apparatus for Processing Video and/or Graphics Data Using Multiple Processors Without Losing State Information |
CN102722549A (en) * | 2012-05-28 | 2012-10-10 | 中国科学院遥感应用研究所 | Cluster-based real-time rendering service of remote sensing data set |
CN102736947A (en) * | 2011-05-06 | 2012-10-17 | 新奥特(北京)视频技术有限公司 | Multithread realization method for rasterization stage in graphic rendering |
CN102799456A (en) * | 2012-07-24 | 2012-11-28 | 上海晨思电子科技有限公司 | Method and device for uploading resource files by game engine, and computer |
CN102831307A (en) * | 2012-05-31 | 2012-12-19 | 山东电力集团公司青岛供电公司 | Three-dimensional GIS (Geographic Information System) technology based power grid visualization system and method |
US20130046518A1 (en) * | 2011-08-18 | 2013-02-21 | International Business Machines Corporation | Multithreaded physics engine with impulse propagation |
-
2013
- 2013-09-05 CN CN201310406709.7A patent/CN103455356B/en not_active Expired - Fee Related
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050198644A1 (en) * | 2003-12-31 | 2005-09-08 | Hong Jiang | Visual and graphical data processing using a multi-threaded architecture |
US20110216078A1 (en) * | 2010-03-04 | 2011-09-08 | Paul Blinzer | Method, System, and Apparatus for Processing Video and/or Graphics Data Using Multiple Processors Without Losing State Information |
CN102156705A (en) * | 2011-01-26 | 2011-08-17 | 北京数码大方科技有限公司 | CAD (Computer Aided Design) document loading method and device |
CN102736947A (en) * | 2011-05-06 | 2012-10-17 | 新奥特(北京)视频技术有限公司 | Multithread realization method for rasterization stage in graphic rendering |
US20130046518A1 (en) * | 2011-08-18 | 2013-02-21 | International Business Machines Corporation | Multithreaded physics engine with impulse propagation |
CN102722549A (en) * | 2012-05-28 | 2012-10-10 | 中国科学院遥感应用研究所 | Cluster-based real-time rendering service of remote sensing data set |
CN102831307A (en) * | 2012-05-31 | 2012-12-19 | 山东电力集团公司青岛供电公司 | Three-dimensional GIS (Geographic Information System) technology based power grid visualization system and method |
CN102799456A (en) * | 2012-07-24 | 2012-11-28 | 上海晨思电子科技有限公司 | Method and device for uploading resource files by game engine, and computer |
Non-Patent Citations (2)
Title |
---|
EDUARD AYGUADE等: "The Design of OpenMP Tasks", 《PARALLEL AND DISTRIBUTED SYSTEMS, IEEE TRANSACTIONS ON》 * |
李喆等: "多核并行技术在三维场景加载中的应用", 《计算机工程》 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105791254A (en) * | 2014-12-26 | 2016-07-20 | 阿里巴巴集团控股有限公司 | Network request processing method, device and terminal |
CN105094920A (en) * | 2015-08-14 | 2015-11-25 | 网易(杭州)网络有限公司 | Game rendering method and device |
CN105094920B (en) * | 2015-08-14 | 2018-07-03 | 网易(杭州)网络有限公司 | A kind of game rendering intent and device |
CN106559447A (en) * | 2015-09-25 | 2017-04-05 | 中兴通讯股份有限公司 | The method for processing business and system of JSLEE containers |
CN105245372A (en) * | 2015-10-12 | 2016-01-13 | 浪潮软件集团有限公司 | Optimization method for loading network resources based on cache and asynchronous mechanism |
CN105979242A (en) * | 2015-11-23 | 2016-09-28 | 乐视网信息技术(北京)股份有限公司 | Video playing method and device |
CN105741227A (en) * | 2016-01-26 | 2016-07-06 | 网易(杭州)网络有限公司 | Rending method and apparatus |
WO2019228497A1 (en) * | 2018-05-31 | 2019-12-05 | Huawei Technologies Co., Ltd. | Apparatus and method for command stream optimization and enhancement |
US11837195B2 (en) | 2018-05-31 | 2023-12-05 | Huawei Technologies Co., Ltd. | Apparatus and method for command stream optimization and enhancement |
CN112596811A (en) * | 2020-12-17 | 2021-04-02 | 杭州艾芯智能科技有限公司 | Method, system, computer equipment and storage medium for reducing memory overhead by dynamic data loading |
CN115035228A (en) * | 2022-06-08 | 2022-09-09 | 北京领为军融科技有限公司 | Rendering method for generating texture by reading satellite film file in real time through asynchronous io |
Also Published As
Publication number | Publication date |
---|---|
CN103455356B (en) | 2017-02-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103455356A (en) | Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device | |
WO2020220915A1 (en) | Virtual object display method and apparatus, electronic device, and storage medium | |
CN106991011B (en) | CPU multithreading and GPU (graphics processing unit) multi-granularity parallel and cooperative optimization based method | |
US8269782B2 (en) | Graphics processing apparatus | |
CN110458280B (en) | Convolutional neural network acceleration method and system suitable for mobile terminal | |
CN102147722B (en) | Realize multiline procedure processor and the method for central processing unit and graphic process unit function | |
CN106462395B (en) | Thread in multiline procedure processor framework waits | |
CN110516303A (en) | Bridge construction management method for visualizing and device based on lightweight BIM | |
US20090002380A1 (en) | Graphics Processing Apparatus, Graphics Library Module And Graphics Processing Method | |
CN104268047B (en) | Electronic equipment performance testing method and device | |
CN104375804B (en) | Multithreading executes processor and its operating method | |
CN114463160B (en) | Parallel processing method and device for graphics pipeline and readable storage medium | |
CN102799456A (en) | Method and device for uploading resource files by game engine, and computer | |
CN104102488A (en) | Multithread parallelization based 3D (three dimensional) engine system | |
CN105247478B (en) | For storing the method and relevant apparatus of order | |
CN103021023A (en) | Three-dimensional scene construction method based on browser | |
CN102984124B (en) | A kind of method and system that client gaming program is quickly implanted browser | |
JP2014517961A5 (en) | ||
KR101670958B1 (en) | Data processing method and apparatus in heterogeneous multi-core environment | |
Tang et al. | Multi-core collision detection between deformable models | |
CN105488840A (en) | Information processing method and electronic equipment | |
CN107704568A (en) | A kind of method and device of test data addition | |
CN103714569A (en) | Rendering instruction processing method, device and system | |
CN104142852A (en) | Method for achieving graph acceleration of android simulator on computer | |
CN105117217A (en) | Cross-platform game rendering method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C53 | Correction of patent of invention or patent application | ||
CB02 | Change of applicant information |
Address after: 315470 Zhejiang Province, Yuyao City Simen Town Guangming Road No. 126 Applicant after: China Jiliang University Address before: Hangzhou City, Zhejiang province 310018 Xiasha Higher Education Park source Street No. 258 Applicant before: China Jiliang University |
|
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170208 Termination date: 20170905 |