CN103455356B - 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 PDF

Info

Publication number
CN103455356B
CN103455356B CN201310406709.7A CN201310406709A CN103455356B CN 103455356 B CN103455356 B CN 103455356B CN 201310406709 A CN201310406709 A CN 201310406709A CN 103455356 B CN103455356 B CN 103455356B
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.)
Expired - Fee Related
Application number
CN201310406709.7A
Other languages
Chinese (zh)
Other versions
CN103455356A (en
Inventor
王秀敏
张麒
单良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Jiliang University
Original Assignee
China Jiliang University
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 China Jiliang University filed Critical China Jiliang University
Priority to CN201310406709.7A priority Critical patent/CN103455356B/en
Publication of CN103455356A publication Critical patent/CN103455356A/en
Application granted granted Critical
Publication of CN103455356B publication Critical patent/CN103455356B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

The concurrently loading of 3D model and rendering intent on multinuclear mobile device
Technical field
The invention belongs to field of embedded software.3D model on more particularly, to a kind of mobile device in multinuclear concurrently loads And rendering intent.
Background technology
With the continuous development of embedded technology, the mobile device headed by smart mobile phone, panel computer has obtained rapidly Development.The central processing unit of mobile device went so far as present double-core, four cores even from former single core Eight cores.In 3D application aspect, multinuclear mobile device not only can show the 3D figure of complexity, or even can run large-scale 3D trip Play.
For the 3D of complex scene applies, need to load and render multiple 3D models.Existing method is first by institute Some 3D model files are loaded onto in internal memory in a serial fashion, then render one by one in a serial fashion.But move in multinuclear In dynamic equipment, the 3D processing method of this serial can not play the advantage of polycaryon processor to improve 3D processing speed.
Content of the invention
The technical problem solving required for the present invention is to provide the 3D model on a kind of mobile device in multinuclear concurrently to add Carry and rendering intent.
The technical scheme that present invention solution technical problem is taken is as follows:
In the CPU core calculation loading and first judging before rendering 3D model current mobile device.Core cpu with current device Number to create thread pool as the capacity of thread pool.Then each the 3D model file being respectively stored on external equipment is created respectively Build 3D model data loading tasks.Data loading tasks are used for loading the vertex data of 3D model file, normal vector data, texture Coordinate data, face data, material quality data are to internal memory.It is respectively created rendering task for each 3D model again.Finally again by all numbers It is submitted in the buffer queue of thread pool according to loading tasks, data loading tasks are concurrently executed by thread pool.Appoint etc. data loading After business is fully completed, rendering task is submitted in the buffer queue of thread pool, rendering task is concurrently executed by thread pool.? After afterwards etc. all rendering tasks are finished, destroying threads pond free system resources.
The present invention has the advantages that with respect to prior art:The present invention is according to the central processing unit core of mobile device Calculation is creating thread pool.Thread pool concurrently to execute asynchronous 3D model file number with the several worker thread of central processing unit core According to loading tasks, asynchronous 3D model rendering task.Whole process has given full play to the process performance of multinuclear mobile device.And it is every Individual task all executes in an asynchronous manner, eliminates the synchronization overhead between each task.Multinuclear therefore can be greatly improved move Equipment loads and renders the speed of 3D model.
Brief description
Fig. 1 is the flow chart of the present invention.
Specific embodiment
Below in conjunction with accompanying drawing, the invention will be further described.
As shown in figure 1, the concurrently loading of 3D model and rendering intent comprise the steps on multinuclear mobile device:
Step one:Obtain the CPU core calculation of current mobile device, specifically:
The operating system being used according to mobile device, directly uses the API of operating system offer or by judging literary composition The number of files of the CPU information CPU core calculation to obtain current mobile device is deposited in part system.Operating system includes but is not limited to IOS system and android system.
For the mobile device of IOS, the core number of CPU can be obtained using " sysctlbyname " function;
For the mobile device of Android operation system, by judging "/sys/devices/system/cpu/ " catalogue The core number to obtain CPU for the number of files of lower record CPU information.The number of files of record CPU information is the core number of CPU;
Step 2:Create the thread pool that capacity is CPU core calculation, specifically:
Create the thread pool number variable nThread of an integer, the CPU core calculation being obtained by the first step is assigned to variable nThread;
Thread pool class in the application development tool kit of the operating system being used using mobile device creates capacity Thread pool for nThread, operating system includes but is not limited to IOS system and android system;
For the mobile device of IOS, using " NSOperation " in IOS application development tool kit To create thread pool, to use
″queue setMaxConcurrentOperationCount:NThread " sentence arrange thread pool capacity be nThread;
For the mobile device of Android operation system, can use in Android application development tool kit " Executors " class come to help create thread pool.Specifically used " Executors.newFixedThreadPool (nThread) " To create the thread pool that capacity is nThread;
Step 3:It is respectively created asynchronous data loading tasks for each 3D model file, specifically:
First traversal is stored in the 3D model file on external equipment, and obtain each model file deposits path, and is placed in In array;
Create asynchronous data loading tasks again, specific tasks flow process is:
Flow process one:File I/O is opened according to the file path of the 3D model file being stored in array;
Described 3D model file form includes OBJ form and 3DS form;
Flow process two:Extract the data of the 3D model file being stored on external equipment, including:Vertex data, normal vector data, Texture coordinate data, face data, material quality data;
Flow process three:The 3D model data of extraction is individually packaged into a data object;
The data loading tasks number altogether creating is equal to the number of 3D model file;
Step 4:It is respectively created asynchronous rendering task for each 3D model, rendering task flow process is specifically:
Flow process one:Using the 3D model data in the 3D model data objects of step 3 encapsulation, it is paintbrush binding number of vertex According to, normal vector data, texture coordinate data, face data, and material characteristic is set;
Flow process two:The gl.glDrawElements function of OpenGl ES is called to render 3D model.
The rendering task number altogether creating is equal to the number of 3D model file;
Step 5:All of asynchronous data loading tasks are concurrently executed by thread pool, specifically:
The all asynchronous data loading tasks being created by step 3 are submitted to the slow of the thread pool being created by step 2 Rush in queue;
Start thread pool, be executed concurrently all asynchronous data loading tasks in buffer queue.
Step 6:All of asynchronous rendering task is concurrently executed by thread pool, specifically:
After being all finished etc. the asynchronous data loading tasks of step 5, all of rendering task is submitted to by step In the buffer queue of two thread pools being created;
Start thread pool, be executed concurrently all asynchronous rendering tasks in buffer queue;
After being finished etc. all asynchronous rendering tasks, destroying threads pond free system resources.

Claims (1)

1. the concurrently loading of 3D model and rendering intent on multinuclear mobile device, its feature comprises the following steps:
Step one:Obtain the CPU core calculation of current mobile device, specifically:
The operating system being used according to mobile device, directly uses the API of operating system offer or by judging file system The number of files of the CPU information CPU core calculation to obtain current mobile device is deposited in system;
Step 2:Create the thread pool that capacity is CPU core calculation, specifically:
Create the thread pool number variable of integer, the value of this variable is set to the CPU core calculation being obtained by step one;
Using the thread pool number variable of integer as the capacity parameter of thread pool, the operating system being used using mobile device should Create the thread pool that capacity is CPU core calculation with the thread pool class in program development tools bag;
Step 3:It is respectively created asynchronous data loading tasks for each 3D model file, specifically:
First traversal is stored in the 3D model file on external equipment, and obtain each model file deposits path, and is placed in array In;
Create asynchronous data loading tasks again, tool flow of task is:
Flow process one:File I/O is opened according to the file path of the 3D model file being stored in array;
Flow process two:Extract the data of the 3D model file being stored on external equipment, including:Vertex data, normal vector data, texture Coordinate data, face data, material quality data;
Flow process three:The 3D model data of extraction is individually packaged into a data object;
Step 4:It is respectively created asynchronous rendering task for each 3D model, rendering task flow process is specifically:
Flow process one:Using the 3D model data in the 3D model data objects of step 3 encapsulation, it is paintbrush binding vertex data, method Vector data, texture coordinate data, face data, and material characteristic is set;
Flow process two:The gl.glDrawElements function of OpenGl ES is called to render 3D model;
Step 5:All of asynchronous data loading tasks are concurrently executed by thread pool, specifically:
The all asynchronous data loading tasks being created by step 3 are submitted to the buffering team of the thread pool being created by step 2 In row;
Start thread pool, be executed concurrently all asynchronous data loading tasks in buffer queue;
Step 6:All of asynchronous rendering task is concurrently executed by thread pool, specifically:
After being all finished etc. the asynchronous data loading tasks of step 5, all of rendering task is submitted to by step 2 institute In the buffer queue of thread pool creating;
Start thread pool, be executed concurrently all asynchronous rendering tasks in buffer queue;
After being finished etc. all asynchronous rendering tasks, destroying threads pond free system resources.
CN201310406709.7A 2013-09-05 2013-09-05 Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device Expired - Fee Related CN103455356B (en)

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 CN103455356A (en) 2013-12-18
CN103455356B true 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)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105791254B (en) * 2014-12-26 2020-01-03 阿里巴巴集团控股有限公司 Network request processing method and device and terminal
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
CN111465966B (en) 2018-05-31 2023-06-02 华为技术有限公司 Apparatus and method for command stream optimization and enhancement
CN112596811B (en) * 2020-12-17 2022-08-05 杭州艾芯智能科技有限公司 Method, system, computer equipment and storage medium for reducing memory overhead by dynamic data loading
CN115035228B (en) * 2022-06-08 2023-01-17 北京领为军融科技有限公司 Rendering method for generating texture by reading satellite film file in real time through asynchronous io

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156705A (en) * 2011-01-26 2011-08-17 北京数码大方科技有限公司 CAD (Computer Aided Design) document loading method and device
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8271986B2 (en) * 2003-12-31 2012-09-18 Intel Corporation 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
US8413166B2 (en) * 2011-08-18 2013-04-02 International Business Machines Corporation Multithreaded physics engine with impulse propagation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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)

* Cited by examiner, † Cited by third party
Title
The Design of OpenMP Tasks;Eduard Ayguade等;《Parallel and Distributed Systems, IEEE Transactions on》;20090331;第20卷(第3期);第404-418页 *
多核并行技术在三维场景加载中的应用;李喆等;《计算机工程》;20110331;第37卷(第6期);第245-246页 *

Also Published As

Publication number Publication date
CN103455356A (en) 2013-12-18

Similar Documents

Publication Publication Date Title
CN103455356B (en) Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device
EP3964270A1 (en) Virtual object display method and apparatus, electronic device, and storage medium
JP5629705B2 (en) Physics simulation on graphics processor
CN102147722B (en) Realize multiline procedure processor and the method for central processing unit and graphic process unit function
CN101777007B (en) Parallel function simulation system for on-chip multi-core processor and method thereof
US9886735B2 (en) Hybrid engine for central processing unit and graphics processor
CN102591709B (en) Shapefile master-slave type parallel writing method based on OGR (open geospatial rule)
KR101511273B1 (en) System and method for 3d graphic rendering based on multi-core processor
CN107170050A (en) The 3D scenes method for building up and system of Internet of Things pel
CN106251392A (en) For the method and apparatus performing to interweave
CN104268047B (en) Electronic equipment performance testing method and device
JP2014517961A5 (en)
Tang et al. Multi-core collision detection between deformable models
KR101670958B1 (en) Data processing method and apparatus in heterogeneous multi-core environment
CN107369200A (en) A kind of 3D scene special effects processing method and storage device
CN104574461A (en) Graph modeling method and device
Lu et al. Modeling and simulation of aircraft assembly line based on quest
CN103544729A (en) Animation data processing method and system
CN104123177B (en) A kind of multithreaded data synchronization method of no lock
Moreland et al. Visualization for exascale: Portable performance is critical
EP2715564B1 (en) Mesh sequence file format
CN109426529B (en) Method, device and terminal for drawing graphics based on X window system
CN106504301A (en) A kind of method for drafting for corresponding vector data by multi-core CPU
CN110413914A (en) Rendering method, device, equipment and storage medium based on WebGL
CN111179383A (en) Rendering lens recombination method and device for CG animation production

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 for 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

Granted publication date: 20170208

Termination date: 20170905

CF01 Termination of patent right due to non-payment of annual fee