CN107516337A - CPU optimization methods based on Unity3D - Google Patents
CPU optimization methods based on Unity3D Download PDFInfo
- Publication number
- CN107516337A CN107516337A CN201710799829.6A CN201710799829A CN107516337A CN 107516337 A CN107516337 A CN 107516337A CN 201710799829 A CN201710799829 A CN 201710799829A CN 107516337 A CN107516337 A CN 107516337A
- Authority
- CN
- China
- Prior art keywords
- cpu
- scene
- unity3d
- batch processing
- processing method
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/50—Lighting effects
- G06T15/60—Shadow generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Image Generation (AREA)
Abstract
The invention discloses a kind of CPU optimization methods based on Unity3D.It includes creating initial scene using Unity3D, CPU optimization data are obtained using dynamic batch processing method when generating object, CPU optimization data are obtained using static batch processing method to the object in scene, CPU optimization data are obtained using scene setting and light method to set up, analysis contrast is carried out to CPU optimizations data, obtains CPU optimum results.The present invention creates initial scene by Unity3D, and dynamic batch processing method, static batch processing method, scene setting and light method to set up are respectively adopted under different scenes and obtains CPU optimization data, CPU prioritization schemes are obtained by carrying out analysis contrast to CPU optimizations data, so as to realize scene optimization, CPU spending is reduced, lifts CPU performance.
Description
Technical field
The invention belongs to applied technical field of the computer technology in scene construction optimization, more particularly to one kind to be based on
Unity3D CPU optimization methods.
Background technology
Unity3D softwares are a multi-platform scene exploitation software, support a variety of scripts, including JavaScript,
C#, Boo, support the issue of the platforms such as Web Player, PC, ios, Android, Windows Store Apps, initial Unity3D
It is mainly used in development of games field, its powerful physical engine and particIe system, the field in real world can be emulated well
Scape, it is not limited solely to development of games field, system emulation, industrial design and building visualization etc. field also have compared with
Good application value.
Nowadays, with the development for setting about swimming page trip and end trip, seem layer for the optimization problem in various scene of game
Go out not poor, the relatively low computer of mobile phone and configuration for some low sides is then with greater need for there is further optimization.It is directed to simultaneously
The upgrading of existing hardware and model scene etc. are perfect in workmanship, and while the experience of audio visual, also optimization problem is proposed
Further requirement.By optimization, user of service can be caused further to experience more preferable impression, also to pass through software development
The various products gone out have more reliable income.
In CPU operations, main performance is excessive Draw Calls.Draw Call are that CPU calls underlying graphics
Interface.Than if any thousands of individual objects, rendering for each is required for physical layer interface of calling, and calling CPU each time
It is required for doing many work, then CPU necessarily can't bear the heavy load.But for GPU, the workload of graphics process is the same
's.So the optimization to Draw Call, mainly aims at and liberates expenses of the CPU on graphic interface is called as far as possible.So pin
Thinking to Draw call is exactly that each object reduces render times as far as possible, and multiple objects preferably render together.Pass through batch processing
(Saved by batching) (dynamic batch processing, static batch processing) can merge some objects, so as to be retouched with one
Calling is painted to be rendered, reduces Draw call.Meanwhile in the case where not influenceing the rendering of scene, few use is reflective, cloudy as far as possible
Shadow, excessive reflective and shade can aggravate CPU expense.
The content of the invention
The present invention goal of the invention be:In order to solve problem above present in prior art, the present invention proposes one kind
CPU optimization methods based on Unity3D.
The technical scheme is that:A kind of CPU optimization methods based on Unity3D, comprise the following steps:
A, initial scene is created using Unity3D;
B, CPU optimization data are obtained using dynamic batch processing method when generating object;
C, CPU optimization data are obtained using static batch processing method to the object in scene;
D, CPU optimization data are obtained using scene setting and light method to set up;
E, analysis contrast is carried out to the CPU optimizations data in step B, C, D, obtains CPU optimum results.
Further, the step B is moved when generating object using dynamic batch processing method specifically by using code
The object that state generation different system carries, and the object of different size unlike material is generated simultaneously.
Further, the step C to the object in scene using static batch processing method specifically by using code
Dynamic control chooses stationary body in window panel.
Further, the step D is specially day sylphon in scene set using scene setting and light method to set up
Existence or non-existence, object in scene be present or produce shade in the absence of object, light irradiation object or do not produce shade.
The beneficial effects of the invention are as follows:The present invention creates initial scene by Unity3D, and is adopted respectively under different scenes
CPU optimization data are obtained with dynamic batch processing method, static batch processing method, scene setting and light method to set up, are passed through
Analysis contrast is carried out to CPU optimizations data and obtains CPU prioritization schemes, so as to realize scene optimization, CPU spending is reduced, is lifted
CPU performance.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the CPU optimization methods based on Unity3D of the present invention.
Fig. 2 is the initial scene graph and datagram of the present invention.
Identical square scene and datagram when Fig. 3 is present invention progress dynamic batch processing.
Different square scenes and datagram when Fig. 4 is present invention progress dynamic batch processing.
Same sphere scene and datagram when Fig. 5 is present invention progress dynamic batch processing.
Different spheroid scenes and datagram when Fig. 6 is present invention progress dynamic batch processing.
Scene and datagram when Fig. 7 is present invention progress static batch processing.
Scene and datagram when Fig. 8 is present invention progress scene setting and light setting.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, not
For limiting the present invention.
As shown in figure 1, the schematic flow sheet of the CPU optimization methods based on Unity3D for the present invention.One kind is based on
Unity3D CPU optimization methods, comprise the following steps:
A, initial scene is created using Unity3D;
B, CPU optimization data are obtained using dynamic batch processing method when generating object;
C, CPU optimization data are obtained using static batch processing method to the object in scene;
D, CPU optimization data are obtained using scene setting and light method to set up;
E, analysis contrast is carried out to the CPU optimizations data in step B, C, D, obtains CPU optimum results.
In step, the present invention creates initial scene using Unity3D, and initial scene here includes Unity3D systems
The day sylphon (Skybox) carried, there are a main camera (Main Camera), and a parallel light source
(Directional Light), does not have other objects now in scene.The Stats in Game view windows is opened, such as Fig. 2 institutes
Show, for the initial scene graph and datagram of the present invention.
In stepb, the present invention obtains CPU optimization data when generating object using dynamic batch processing method, is specially
The object carried by using code dynamic generation different system, and the object of different size unlike material is generated simultaneously, observe
CPU expense.
By 100 systemic presupposition object squares (Cube) of code building, the size given tacit consent to for square and silent
The material recognized is set, without change, as shown in figure 3, identical square scene and number when dynamic batch processing is carried out for the present invention
According to figure.
By 100 systemic presupposition object squares (Cube) of code building, for square carry out part change size and
Material corresponding to change, the scaling volume (Scale) of which part square are changed to X=1.2, Y=1.2, Z=1.2, partial block
Material without using acquiescence material, using the blueness in material ball as material, as shown in figure 4, for the present invention progress dynamic batch
Different square scenes and datagram during processing.
By 100 systemic presupposition object spheroids (Sphere) of code building, the size given tacit consent to for square and
The material of acquiescence is set, without change, as shown in figure 5, same sphere scene when dynamic batch processing is carried out for the present invention with
Datagram.
By 100 systemic presupposition object spheroids (Sphere) of code building, for square carry out part change size with
And material corresponding to change, the scaling volume (Scale) of which part square are changed to X=1.2, Y=1.2, Z=1.2, part side
The material of block is without using acquiescence material, using the blueness in material ball as material, as shown in fig. 6, entering Mobile state for the present invention
Different spheroid scenes and datagram during batch processing.
In step C, the present invention obtains CPU optimization data to the object in scene using static batch processing method, specifically
To choose stationary body by using code dynamic control or in window panel, CPU expense is observed.
A scene newly is established, is put into three squares (Cube) in the scene, three spheroids (Sphere) is put into, is running
Six objects in scene are chosen into static in panel (Inspector) is inspected before startup project, while by the light of acquiescence
Line is arranged to irradiation and does not produce shade, and without day sylphon, as shown in fig. 7, scene when static batch processing is carried out for the present invention with
Datagram.
In step D, the present invention obtains CPU optimization data using scene setting and light method to set up, specially sets
Put sylphon existence or non-existence in day in scene, object in scene be present or in the absence of object, light irradiation object produce shade or
Shade is not produced, CPU expense in the case of observation is corresponding.
A scene newly is established, is put into three squares (Cube) in the scene, is put into three spheroids (Sphere), in scene
Illumination and day sylphon using acquiescence, as shown in figure 8, scene and number when carrying out scene setting and light setting for the present invention
According to figure.
In step E, the present invention is directed to specific scene, by the scene in comparison step 1, step 2, step 3, enters
Row data analysis contrasts, and obtains CPU prioritization scheme.
One of ordinary skill in the art will be appreciated that embodiment described here is to aid in reader and understands this hair
Bright principle, it should be understood that protection scope of the present invention is not limited to such especially statement and embodiment.This area
Those of ordinary skill can make according to these technical inspirations disclosed by the invention various does not depart from the other each of essence of the invention
The specific deformation of kind and combination, these deform and combined still within the scope of the present invention.
Claims (4)
1. a kind of CPU optimization methods based on Unity3D, it is characterised in that comprise the following steps:
A, initial scene is created using Unity3D;
B, CPU optimization data are obtained using dynamic batch processing method when generating object;
C, CPU optimization data are obtained using static batch processing method to the object in scene;
D, CPU optimization data are obtained using scene setting and light method to set up;
E, analysis contrast is carried out to the CPU optimizations data in step B, C, D, obtains CPU optimum results.
2. the CPU optimization methods based on Unity3D as claimed in claim 1, it is characterised in that the step B is in product
Using dynamic batch processing method specifically by the object carried using code dynamic generation different system during body, and generate simultaneously
The object of different size unlike material.
3. the CPU optimization methods based on Unity3D as claimed in claim 1, it is characterised in that the step C is in scene
Object using static batch processing method specifically by choosing stationary body using code dynamic control or in window panel.
4. the CPU optimization methods based on Unity3D as claimed in claim 1, it is characterised in that the step D uses scene
Set and light method to set up is specially sylphon existence or non-existence in day in scene set, object be present in scene or be not present
Object, light irradiation object produce shade or do not produce shade.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710799829.6A CN107516337A (en) | 2017-09-07 | 2017-09-07 | CPU optimization methods based on Unity3D |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710799829.6A CN107516337A (en) | 2017-09-07 | 2017-09-07 | CPU optimization methods based on Unity3D |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107516337A true CN107516337A (en) | 2017-12-26 |
Family
ID=60725092
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710799829.6A Pending CN107516337A (en) | 2017-09-07 | 2017-09-07 | CPU optimization methods based on Unity3D |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107516337A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022099362A1 (en) * | 2020-11-10 | 2022-05-19 | Optrix Pty Ltd | Systems and methods for optimised rendering |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102520951A (en) * | 2011-12-13 | 2012-06-27 | 天津大学 | Flash-based three-dimensional game scene management system |
CN204156999U (en) * | 2014-05-09 | 2015-02-11 | 北京乐成光视科技发展有限公司 | A kind of bore hole 3D display system based on Unity3D game engine |
CN105413176A (en) * | 2015-11-10 | 2016-03-23 | 内蒙古工业大学 | 3D engine system applied to games |
CN107038745A (en) * | 2017-03-21 | 2017-08-11 | 中国农业大学 | A kind of 3D tourist sights roaming interaction method and device |
-
2017
- 2017-09-07 CN CN201710799829.6A patent/CN107516337A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102520951A (en) * | 2011-12-13 | 2012-06-27 | 天津大学 | Flash-based three-dimensional game scene management system |
CN204156999U (en) * | 2014-05-09 | 2015-02-11 | 北京乐成光视科技发展有限公司 | A kind of bore hole 3D display system based on Unity3D game engine |
CN105413176A (en) * | 2015-11-10 | 2016-03-23 | 内蒙古工业大学 | 3D engine system applied to games |
CN107038745A (en) * | 2017-03-21 | 2017-08-11 | 中国农业大学 | A kind of 3D tourist sights roaming interaction method and device |
Non-Patent Citations (3)
Title |
---|
佚名: "[Unity优化] Unity CPU性能优化", 《HTTP://WWW.CNBLOGS.COM/CHWEN/P/4396515.HTML》 * |
佚名: "【Unity】13.2 通过Lighting Window设置相关参数", 《HTTPS://WWW.CNBLOGS.COM/RAINMJ/P/5507296.HTML》 * |
佚名: "深入浅出:CPU,GPU,内存的优化", 《HTTPS://BLOG.CSDN.NET/CORDOVA/ARTICLE/DETAILS/52241249》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022099362A1 (en) * | 2020-11-10 | 2022-05-19 | Optrix Pty Ltd | Systems and methods for optimised rendering |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110838162B (en) | Vegetation rendering method and device, storage medium and electronic equipment | |
US10282813B2 (en) | Flex rendering based on a render target in graphics processing | |
US11900233B2 (en) | Method and system for interactive imitation learning in video games | |
KR102327144B1 (en) | Graphic processing apparatus and method for performing tile-based graphics pipeline thereof | |
CN111145326B (en) | Processing method of three-dimensional virtual cloud model, storage medium, processor and electronic device | |
US9691172B2 (en) | Furry avatar animation | |
CN108986200B (en) | Preprocessing method and system for graphic rendering | |
WO2020093825A1 (en) | Virtual scene recognition and interaction key position matching method for application program, and computing device | |
CN104966312A (en) | Method for rendering 3D model, apparatus for rendering 3D model and terminal equipment | |
CN104922906B (en) | Action executes method and apparatus | |
CN109102560A (en) | Threedimensional model rendering method and device | |
CN106056660A (en) | Mobile terminal simulation particle system method | |
US10685472B1 (en) | Animation brushes | |
CN112258653A (en) | Rendering method, device and equipment of elastic object and storage medium | |
CN111539905A (en) | Method, apparatus, device and storage medium for generating image | |
CN101615300A (en) | A kind of screen space micro-structure surface object ambient light occlusion method | |
CN111583378A (en) | Virtual asset processing method and device, electronic equipment and storage medium | |
CN114332323A (en) | Particle effect rendering method, device, equipment and medium | |
CN107516337A (en) | CPU optimization methods based on Unity3D | |
CN111340684B (en) | Method and device for processing graphics in game | |
CN104008565A (en) | System and method for playing Flash bitmap animation by using cocos2d-x and HE engines | |
CN108492371B (en) | Three-dimensional building model dynamic visualization method for fire | |
CN103310409A (en) | Quick triangle partitioning method of Tile-based rendering architecture central processing unit (CPU) | |
JP5864474B2 (en) | Image processing apparatus and image processing method for processing graphics by dividing space | |
CN107515993A (en) | GPU optimization methods based on Unity3D welding simulations |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171226 |
|
RJ01 | Rejection of invention patent application after publication |