CN104156999A - Three-dimensional scene rendering method - Google Patents

Three-dimensional scene rendering method Download PDF

Info

Publication number
CN104156999A
CN104156999A CN201410398934.5A CN201410398934A CN104156999A CN 104156999 A CN104156999 A CN 104156999A CN 201410398934 A CN201410398934 A CN 201410398934A CN 104156999 A CN104156999 A CN 104156999A
Authority
CN
China
Prior art keywords
record
triangular facet
triangular
information
dimensional scenic
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
Application number
CN201410398934.5A
Other languages
Chinese (zh)
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.)
Vtron Technologies Ltd
Original Assignee
Vtron Technologies Ltd
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 Vtron Technologies Ltd filed Critical Vtron Technologies Ltd
Priority to CN201410398934.5A priority Critical patent/CN104156999A/en
Publication of CN104156999A publication Critical patent/CN104156999A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a three-dimensional scene rendering method. Reduction of the number of material utilization times in three-dimensional scene rendering is realized, and meanwhile, the number of times of interaction between a program and a graphics card is reduced, the number of state changes is reduced, and the efficiency of three-dimensional scene rendering is improved. The method disclosed by the embodiment of the invention comprises the following steps: S1, classification containers are traversed, and records corresponding to the materials of a three-dimensional scene are extracted; S2, all triangular surfaces corresponding to the materials are drawn according to the records; and S3, the triangular surfaces of the materials of all types are rendered one by one.

Description

A kind of three-dimensional scenic rendering intent
Technical field
The present invention relates to Computer display technical field, relate in particular to a kind of three-dimensional scenic rendering intent.
Background technology
Three-dimensional refers to the space system that has added again a direction vector formation in planar system, and along with scientific and technological development, the digitized 3 D stereo 3D technology based on computer/internet reaches its maturity.In the fast development through for many years and widespread use, current 3D technology has obtained significant maturation with universal, and a 3D tide with 3D replacement 2D, " solid " replacement " plane ", " virtual " simulation " reality " just rapidly starts in every field.3D application program is by loading and play up huger data, and the scene that reaches demonstration is the effect of closer to reality more.These data mainly comprise model, landform, texture, illumination etc.When playing up scene, conventionally take object as unit, first use the summit of object to set up the profile of object, these profiles generally show as 3 jiaos of nets (triangular facet set), in each triangular facet of the triangulation network, apply afterwards material and show an object, object is played up until the object in whole scene has all been shown one by one, by constructing like this effect of emulation.
This traditional take played up object as unit mode, relatively meets more conventional emulation thinking.Such as showing a room, general method is first the wall in room and ceiling to be shown, afterwards again the demonstration piecemeal of the object in room.Similar sketch, draws out object one by one.It is very consuming time that traditional method is given the process of each triangular facet application material, because computing machine need respectively each face vertex data and the material quality data video card that sends to computing machine, and process fusion and the illumination of texture for each face, application material each time all needs render engine, for example OpenGL (Open Graphics Library) or DX (DirectX), carry out the change of a next state, these operation consumptions CPU (central processing unit, Central Processing Unit) and GPU (graphic process unit, Graphic Processing Unit) resource, although in little scene application, the object quantity that need to play up is few, therefore the display speed of program is not low.But in large scene, play up object quantity more, and that each object may comprise is thousands of, the triangular facet of greater number even, mean and need the change of big data quantity rendering state, therefore what adopt that each traditional object plays up one by one is the processing resource that relatively expends CPU and GPU, causes the processing time to be expended very much.
Based on above-mentioned mention play up many data volumes of object time, expend the processing resource of CPU and GPU, causing the processing time is the technical matters expending very much, the present invention proposes the number of times that reduces material application, can reduce the interaction times of program and video card, reduce the varied number of state, thereby improved the rendering efficiency of three-dimensional scenic.
Summary of the invention
The embodiment of the present invention provides a kind of three-dimensional scenic rendering intent, realize the number of times that reduces material application when playing up three-dimensional scenic, meanwhile, correspondingly reduced the interaction times of program and video card, reduce the varied number of state, thereby improved the rendering efficiency of three-dimensional scenic.
The embodiment of the present invention provides a kind of three-dimensional scenic rendering intent, and step comprises:
S1: traversal classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic;
S2: all triangular facets corresponding with described material are drawn according to described record;
S3: repeating step S1 plays up one by one to the triangular facet of the material of all categories.
Preferably,
Before described step S1, also comprise:
The described classification container that creates the described record for storing described material and answering in contrast, described record includes object information and triangular facet information.
Preferably,
Before described step S1, also comprise:
According to the mode that increases progressively traversal, all objects of described three-dimensional scenic are traveled through one by one, and travel through one by one triangular facet corresponding to object described in each;
Described triangular facet to described all objects is classified with described material.
Preferably,
According to the mode that increases progressively traversal, all objects of described three-dimensional scenic are traveled through one by one, and the triangular facet that described in each, object is corresponding specifically comprises:
According to the mode that increases progressively traversal, all objects of described three-dimensional scenic are traveled through one by one, and obtain the model data corresponding with object described in each;
Travel through described triangular facet corresponding to object described in each, and obtain the described material corresponding with described triangular facet.
Preferably,
Described triangular facet to described all objects is classified and is specifically comprised with material:
Retrieve the described record that whether has described material and answer in contrast in described classification container, if so, trigger advanced judgment model, if not, the described record that adds described material and answer in contrast.
Preferably,
Described advanced judgment model specifically comprises:
Judge in described record whether have the object information corresponding with described object, if so, in described record, add the triangular facet information corresponding with described material, if not, based on described material, create the described record of answering in contrast.
Preferably,
Described step S2 specifically comprises:
By described record, obtain corresponding model data;
According to the described model data pair all triangular facets corresponding with described material, draw, and apply described material.
Preferably,
Described object information is object vernier numbering;
Described triangular facet information is triangular facet vernier numbering.
Preferably,
Described model data comprises vertex data and the material quality data of triangular facet.
Preferably,
Described material is material number information.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages:
The embodiment of the present invention provides a kind of three-dimensional scenic rendering intent, and method comprises: S1: traversal classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic; S2: all triangular facets corresponding with material are drawn according to record; S3: the triangular facet to the material of all categories is played up one by one.In the embodiment of the present invention, by first extracting the record corresponding with material, and according to record, all triangular facets corresponding with material are drawn, finally with regard to all triangular facets of different materials, draw one by one, realize the number of times that reduces material application when playing up three-dimensional scenic, meanwhile, correspondingly reduced the interaction times of program and video card, reduce the varied number of state, thereby improved the rendering efficiency of three-dimensional scenic.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The schematic flow sheet of an embodiment of a kind of three-dimensional scenic rendering intent that Fig. 1 provides for the embodiment of the present invention;
The schematic flow sheet of another embodiment of a kind of three-dimensional scenic rendering intent that Fig. 2 provides for the embodiment of the present invention;
The schematic flow sheet of another embodiment of a kind of three-dimensional scenic rendering intent that Fig. 3 provides for the embodiment of the present invention;
The schematic flow sheet of another embodiment of a kind of three-dimensional scenic rendering intent that Fig. 4 provides for the embodiment of the present invention.
Embodiment
The embodiment of the present invention provides a kind of three-dimensional scenic rendering intent, realize the number of times that reduces material application when playing up three-dimensional scenic, meanwhile, correspondingly reduced the interaction times of program and video card, reduce the varied number of state, thereby improved the rendering efficiency of three-dimensional scenic.
For making goal of the invention of the present invention, feature, advantage can be more obvious and understandable, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, the embodiments described below are only the present invention's part embodiment, but not whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making all other embodiment that obtain under creative work prerequisite, belong to the scope of protection of the invention.
Refer to Fig. 1, an embodiment of a kind of three-dimensional scenic rendering intent that the embodiment of the present invention provides comprises:
S1: traversal classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic;
In the embodiment of the present invention, when needs are played up and show a three-dimensional scenic, first need to travel through classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic.
It should be noted that, aforesaid corresponding record can be all records that are associated of a certain material with three-dimensional scenic, and this record includes the object information of all objects that possess a certain material and all triangular facet information of the material of application of aforementioned in this object.
Be understandable that, aforesaid classification container includes all materials of this three-dimensional scenic, the relevant information of object and triangular facet or data content.
S2: all triangular facets corresponding with material are drawn according to record;
When extract the record corresponding with the material of three-dimensional scenic from classification container after, need to all triangular facets corresponding with material, draw according to record, it should be noted that, according to record, all triangular facets corresponding with material are drawn and will in subsequent embodiment, be described in detail, just repeat no more herein.
S3: repeating step S1 plays up one by one to the triangular facet of the material of all categories.
In the present embodiment, after all triangular facets corresponding with material being drawn according to record, need repeating step S1 to play up one by one the triangular facet of the remaining material of all categories, finally only rely on material to carry out the disposable of all materials and play up.
In the embodiment of the present invention, by first extracting the record corresponding with material, and according to record, all triangular facets corresponding with material are drawn, finally with regard to all triangular facets of different materials, draw one by one, realize the number of times that reduces material application when playing up three-dimensional scenic, meanwhile, correspondingly reduced the interaction times of program and video card, reduce the varied number of state, thereby improved the rendering efficiency of three-dimensional scenic.
That the process of three-dimensional scenic rendering intent is described in detail above, below the process of the establishment classification container to before traversal classification container is described in detail, refer to Fig. 2, another embodiment of a kind of three-dimensional scenic rendering intent that the embodiment of the present invention provides comprises:
201, create the classification container of the record for storing material and answering in contrast;
In the embodiment of the present invention, before needs are played up a three-dimensional scenic and are shown, need to create the classification container of the record for storing material and answering in contrast, it should be noted that, aforesaid record includes object information and triangular facet information, aforesaid object information can be object vernier numbering Oindex, and aforesaid triangular facet information can be triangular facet vernier code T index.
For example in classification container, be set as < material number information, < object information, in object, use this material triangular facet set vec > >, what in vec, record is the triangular facet information of triangular facet, for example gather vec:{0, 6, n}, wherein, 0, 6 represent that the vernier code T index of object intermediate cam face is 0, 6, be understandable that, < 3, < 5, { 100, 200} > > is expressed as the 100th in the 5th object, the 200th triangular facet used material 3.
202, according to the mode that increases progressively traversal, all objects of three-dimensional scenic are traveled through one by one, and travel through one by one the triangular facet that each object is corresponding;
After having created classification container, need to all objects of three-dimensional scenic be traveled through one by one according to the mode that increases progressively traversal, and travel through one by one the triangular facet that each object is corresponding, it should be noted that, aforesaid three-dimensional scenic has several objects, each object has several triangular facets, its corresponding several material classification.
Be understandable that, the aforesaid mode that increases progressively traversal will be described in detail in subsequent embodiment, no longer specifically repeat herein.
203, the triangular facet of all objects is classified with material;
When the mode according to increasing progressively traversal travels through all objects of three-dimensional scenic one by one, and after traveling through one by one the triangular facet that each object is corresponding, need to material, classify to the triangular facet of all objects, be understandable that, all triangular facets that aforesaid all objects are corresponding are associated with several material classifications, need to the material classification based on different be numbered classification to all objects and corresponding all triangular facets thereof.
204, traversal classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic;
In the embodiment of the present invention, when needs are played up and show a three-dimensional scenic, first need to travel through classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic.
It should be noted that, aforesaid corresponding record can be all records that are associated of a certain material with three-dimensional scenic, and this record includes the object information of all objects that possess a certain material and all triangular facet information of the material of application of aforementioned in this object.
Be understandable that, aforesaid classification container includes all materials of this three-dimensional scenic, the relevant information of object and triangular facet or data content.
205, according to record, all triangular facets corresponding with material are drawn;
When extract the record corresponding with the material of three-dimensional scenic from classification container after, need to all triangular facets corresponding with material, draw according to record, it should be noted that, according to record, all triangular facets corresponding with material are drawn and will in subsequent embodiment, be described in detail, just repeat no more herein.
206, the triangular facet of the material of 204 pairs of all categories of repeating step is played up one by one.
In the present embodiment, after all triangular facets corresponding with material being drawn according to record, need the triangular facet of the remaining material of 204 pairs of all categories of repeating step to play up one by one, finally only rely on material to carry out the disposable of all triangular facets and play up.
In the embodiment of the present invention, by first creating the classification container of the record for storing material and answering in contrast, based on material, the object in three-dimensional scenic and relevant triangular facet thereof are classified again, by extracting the record corresponding with material, and according to record, all triangular facets corresponding with material are drawn, finally with regard to all triangular facets of different materials, draw one by one, can think directly to extract the record corresponding with material and carry out batch to show, thereby a kind of material is only played up once, thereby reduce the number of times of material application, simultaneously, correspondingly reduced the interaction times of program and video card, reduced the varied number of state, correspondingly improved the performance of CPU and GPU.
Be that the process before traversal classification container is described in detail above, by the classification of the material of three-dimensional scenic is described in detail, refer to Fig. 3 below, another embodiment of a kind of three-dimensional scenic rendering intent that the embodiment of the present invention provides comprises:
301, create the classification container of the record for storing material and answering in contrast;
In the embodiment of the present invention, before needs are played up a three-dimensional scenic and are shown, need to create the classification container of the record for storing material and answering in contrast, it should be noted that, aforesaid record includes object information and triangular facet information, aforesaid object information can be object vernier numbering Oindex, and aforesaid triangular facet information can be triangular facet vernier code T index.
For example in classification container, be set as < material number information, < object information, in object, use this material triangular facet set vec > >, what in vec, record is the triangular facet information of triangular facet, vec:{0 for example, 6, n}, wherein, 0, 6 represent that the vernier code T index of object intermediate cam face is 0, 6, be understandable that, < 3, < 5, { 100, 200} > > is expressed as the 100th in the 5th object, the 200th triangular facet used material 3.
202, according to the mode that increases progressively traversal, all objects of three-dimensional scenic are traveled through one by one, and obtain the model data corresponding with each object;
After having created classification container, need to all objects of three-dimensional scenic be traveled through one by one according to the mode that increases progressively traversal, and obtain the model data corresponding with each object, it should be noted that, aforesaid three-dimensional scenic has several objects, each object has several triangular facets, its corresponding several material classification, it is 1 that object vernier numbering Oindex is for example set, after obtaining the model data of all correspondences that Oindex is 1 object, increase progressively again 1 object vernier numbering, as the model data of all correspondences of the Oindex object that is 2, increase progressively and obtain by that analogy.
Be understandable that, aforesaid model data comprises vertex data and the material quality data of triangular facet.
303, travel through the triangular facet that each object is corresponding, and obtain the material corresponding with triangular facet;
After getting the corresponding model data of object, need to travel through the triangular facet that this object is corresponding, and obtain the material corresponding with triangular facet, it is 1 that triangular facet vernier code T index is for example set, after obtaining the material information numbering of all correspondences that Tindex is 1 triangular facet, increase progressively 1 triangular facet vernier numbering, the material information numbering as all correspondences of the Tindex object that is 2, increases progressively and obtains by that analogy again.
Be understandable that, all triangular facets that aforesaid all objects are corresponding are associated with several material classifications, need to the material classification based on different be numbered classification to all objects and corresponding all triangular facets thereof.
304, the record that whether has material and answer in contrast in searching classification container, if so, performs step 305, performs step 308 if not;
When triangular facet corresponding to each object of traversal, and after obtaining the material corresponding with triangular facet, need the record that whether has material information numbering and answer in contrast in searching classification container, if, perform step 305, if not, perform step 308, it should be noted that, aforesaid record includes object vernier numbering and triangular facet vernier numbering, for example the < material information numbering < object vernier that is recorded as in step 301 is numbered Oindex, { triangular facet vernier code T index}> >, if exist and number consistent record with material information, perform step 305, if do not exist with material information and number consistent record, perform step 308.
305, in judgement record, whether have the object information corresponding with object, if so, perform step 306, if not, perform step 307;
After judgement existence is numbered consistent record with material information, need to judge again and in record, whether have the object information corresponding with object, for example be recorded as < material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index}> >, there is the object information consistent with object vernier numbering Oindex, perform step 306, if there is not the object information consistent with object vernier numbering Oindex, perform step 307.
306, in record, add the triangular facet information corresponding with material;
Have the object information corresponding with object in judgement record after, in record, add the triangular facet information corresponding with material, for example be recorded as < material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index}> >, add the triangular facet vernier code T index1 corresponding with material, be < material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index, triangular facet vernier code T index1}> >.
It should be noted that, when add the triangular facet information corresponding with material in record after, need the corresponding all triangular facets of 303 pairs of these objects of repeating step to carry out incremental ground traversal one by one, when the triangular facet vernier code T index to all triangular facets carries out after incremental ground travels through completing steps 306 one by one, need the object vernier numbering Oindex of all objects in 302 pairs of three-dimensional scenics of repeating step to carry out incremental ground and travel through one by one completing steps 306.
307, based on material, create the record of answering in contrast;
Do not have the object information corresponding with object in judgement record after, based on material, create the record of answering in contrast, for example be recorded as < material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index}> >, create the record < object vernier corresponding with material information numbering and number Oindex1, { triangular facet vernier code T index}>, be material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index}>, < object vernier numbering Oindex1, { triangular facet vernier code T index}> >.
It should be noted that, after creating the record of answering in contrast based on material, need the corresponding all triangular facets of 303 pairs of these objects of repeating step to carry out incremental ground traversal one by one, when the triangular facet vernier code T index to all triangular facets carries out after incremental ground travels through completing steps 307 one by one, need the object vernier numbering Oindex of all objects in 302 pairs of three-dimensional scenics of repeating step to carry out incremental ground and travel through one by one completing steps 307.
308, the record that adds material and answer in contrast;
After judgement does not exist and numbers consistent record with material information, the record that adds material and answer in contrast, for example, in record during not consistent with material information numbering record, this material information numbering and the preset corresponding < material information numbering < object vernier that is recorded as are numbered Oindex, { triangular facet vernier code T index}> >, is added to this record in classification container.
It should be noted that, when adding material and needing the corresponding all triangular facets of 303 pairs of these objects of repeating step to carry out incremental ground traversal one by one after the record of answering in contrast, when the triangular facet vernier code T index to all triangular facets carries out after incremental ground travels through completing steps 308 one by one, need the object vernier numbering Oindex of all objects in 302 pairs of three-dimensional scenics of repeating step to carry out incremental ground and travel through one by one completing steps 308.
309, traversal classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic;
In the embodiment of the present invention, now, when needs are played up and show a three-dimensional scenic, first need to travel through classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic.
It should be noted that, aforesaid corresponding record can be all records that are associated of a certain material with three-dimensional scenic, and this record includes the object information of all objects that possess a certain material and all triangular facet information of the material of application of aforementioned in this object.
Be understandable that, aforesaid classification container includes all materials of this three-dimensional scenic, the relevant information of object and triangular facet or data content.
310, according to record, all triangular facets corresponding with material are drawn;
When extract the record corresponding with the material of three-dimensional scenic from classification container after, need to all triangular facets corresponding with material, draw according to record, it should be noted that, according to record, all triangular facets corresponding with material are drawn and will in subsequent embodiment, be described in detail, just repeat no more herein.
311, the triangular facet of the material of 309 pairs of all categories of repeating step is played up one by one.
In the present embodiment, after all triangular facets corresponding with material being drawn according to record, need the triangular facet of the remaining material of 309 pairs of all categories of repeating step to play up one by one, finally only rely on material to carry out the disposable of all triangular facets and play up.
In the embodiment of the present invention, by first creating the classification container of the record for storing material and answering in contrast, based on material, the object in three-dimensional scenic is traveled through one by one again and relevant triangular facet is classified after traveling through one by one, by extracting the record corresponding with material, and according to record, all triangular facets corresponding with material are drawn, finally with regard to all triangular facets of different materials, draw one by one, can be directly to extract the record corresponding with material just to have realized and play up three-dimensional scenic, thereby a kind of material is only played up once, thereby reduce the number of times of material application, simultaneously, correspondingly reduced the interaction times of program and video card, reduced the varied number of state, correspondingly improved the performance of CPU and GPU.
That the classification of the material of three-dimensional scenic is described in detail above, to the process of all triangular facets corresponding with material being drawn according to record be described in detail below, refer to Fig. 4, another embodiment of a kind of three-dimensional scenic rendering intent that the embodiment of the present invention provides comprises:
401, create the classification container of the record for storing material and answering in contrast;
In the embodiment of the present invention, before needs are played up a three-dimensional scenic and are shown, need to create the classification container of the record for storing material and answering in contrast, it should be noted that, aforesaid record includes object information and triangular facet information, aforesaid object information can be object vernier numbering Oindex, and aforesaid triangular facet information can be triangular facet vernier code T index.
For example in classification container, be set as < material number information, < object information, in object, use this material triangular facet set vec > >, what in vec, record is the triangular facet information of triangular facet, vec:{0 for example, 6, n}, wherein, 0, 6 represent that the vernier code T index of object intermediate cam face is 0, 6, be understandable that, < 3, < 5, { 100, 200} > > is expressed as the 100th in the 5th object, the 200th triangular facet used material 3.
402, according to the mode that increases progressively traversal, all objects of three-dimensional scenic are traveled through one by one, and obtain the model data corresponding with each object;
After having created classification container, need to all objects of three-dimensional scenic be traveled through one by one according to the mode that increases progressively traversal, and obtain the model data corresponding with each object, it should be noted that, aforesaid three-dimensional scenic has several objects, each object has several triangular facets, its corresponding several material classification, it is 1 that object vernier numbering Oindex is for example set, after obtaining the model data of all correspondences that Oindex is 1 object, increase progressively again 1 object vernier numbering, as the model data of all correspondences of the Oindex object that is 2, increase progressively and obtain by that analogy.
Be understandable that, aforesaid model data comprises vertex data and the material quality data of triangular facet.
403, travel through the triangular facet that each object is corresponding, and obtain the material corresponding with triangular facet;
After getting the corresponding model data of object, need to travel through the triangular facet that this object is corresponding, and obtain the material corresponding with triangular facet, it is 1 that triangular facet vernier code T index is for example set, after obtaining the material information numbering of all correspondences that Tindex is 1 triangular facet, increase progressively 1 triangular facet vernier numbering, the material information numbering as all correspondences of the Tindex object that is 2, increases progressively and obtains by that analogy again.
Be understandable that, all triangular facets that aforesaid all objects are corresponding are associated with several material classifications, need to the material classification based on different be numbered classification to all objects and corresponding all triangular facets thereof.
404, the record that whether has material and answer in contrast in searching classification container, if so, performs step 405, performs step 408 if not;
When triangular facet corresponding to each object of traversal, and after obtaining the material corresponding with triangular facet, need the record that whether has material information numbering and answer in contrast in searching classification container, if, perform step 405, if not, perform step 408, it should be noted that, aforesaid record includes object vernier numbering and triangular facet vernier numbering, for example the < material information numbering < object vernier that is recorded as in step 301 is numbered Oindex, { triangular facet vernier code T index}> >, if exist and number consistent record with material information, perform step 405, if do not exist with material information and number consistent record, perform step 408.
405, in judgement record, whether have the object information corresponding with object, if so, perform step 406, if not, perform step 407;
After judgement existence is numbered consistent record with material information, need to judge again and in record, whether have the object information corresponding with object, for example be recorded as < material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index}> >, there is the object information consistent with object vernier numbering Oindex, perform step 406, if there is not the object information consistent with object vernier numbering Oindex, perform step 407.
406, in record, add the triangular facet information corresponding with material;
Have the object information corresponding with object in judgement record after, in record, add the triangular facet information corresponding with material, for example be recorded as < material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index}> >, add the triangular facet vernier code T index1 corresponding with material, be < material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index, triangular facet vernier code T index1}> >.
It should be noted that, when add the triangular facet information corresponding with material in record after, need the corresponding all triangular facets of 403 pairs of these objects of repeating step to carry out incremental ground traversal one by one, when the triangular facet vernier code T index to all triangular facets carries out after incremental ground travels through completing steps 406 one by one, need the object vernier numbering Oindex of all objects in 402 pairs of three-dimensional scenics of repeating step to carry out incremental ground and travel through one by one completing steps 406.
407, based on material, create the record of answering in contrast;
Do not have the object information corresponding with object in judgement record after, based on material, create the record of answering in contrast, for example be recorded as < material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index}> >, create the record < object vernier corresponding with material information numbering and number Oindex1, { triangular facet vernier code T index}>, be material information numbering < object vernier numbering Oindex, { triangular facet vernier code T index}>, < object vernier numbering Oindex1, { triangular facet vernier code T index}> >.
It should be noted that, after creating the record of answering in contrast based on material, need the corresponding all triangular facets of 403 pairs of these objects of repeating step to carry out incremental ground traversal one by one, when the triangular facet vernier code T index to all triangular facets carries out after incremental ground travels through completing steps 407 one by one, need the object vernier numbering Oindex of all objects in 402 pairs of three-dimensional scenics of repeating step to carry out incremental ground and travel through one by one completing steps 407.
408, the record that adds material and answer in contrast;
After judgement does not exist and numbers consistent record with material information, the record that adds material and answer in contrast, for example, in record during not consistent with material information numbering record, this material information numbering and the preset corresponding < material information numbering < object vernier that is recorded as are numbered Oindex, { triangular facet vernier code T index}> >, is added to this record in classification container.
It should be noted that, when adding material and needing the corresponding all triangular facets of 403 pairs of these objects of repeating step to carry out incremental ground traversal one by one after the record of answering in contrast, when the triangular facet vernier code T index to all triangular facets carries out after incremental ground travels through completing steps 408 one by one, need the object vernier numbering Oindex of all objects in 402 pairs of three-dimensional scenics of repeating step to carry out incremental ground and travel through one by one completing steps 408.
409, traversal classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic;
In the embodiment of the present invention, now, when needs are played up and show a three-dimensional scenic, first need to travel through classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic.
It should be noted that, aforesaid corresponding record can be all records that are associated of a certain material with three-dimensional scenic, and this record includes the object information of all objects that possess a certain material and all triangular facet information of the material of application of aforementioned in this object.
Be understandable that, aforesaid classification container includes all materials of this three-dimensional scenic, the relevant information of object and triangular facet or data content.
410, by record, obtain corresponding model data;
When extract the record corresponding with the material of three-dimensional scenic from classification container after, need to obtain corresponding model data by record, for example pass through the set of the object vernier numbering Oindex of object and the triangular facet vernier code T index of triangular facet of this record, resolve the model data corresponding with the triangular facet vernier code T index of aforesaid object vernier numbering Oindex and triangular facet, it should be noted that, aforesaid model data comprises vertex data and the material quality data of triangular facet.
411, according to the model data pair all triangular facets corresponding with material, draw, and apply material;
After obtaining corresponding model data by record, need to draw according to the vertex data of all triangular facets in the model data pair all triangular facets corresponding with material, and apply material, be understandable that, can be first all vertex datas to be applied to corresponding with it material quality data more corresponding all triangular facets to be drawn after the vertex data that gets all triangular facets.
412, the triangular facet of the material of 409 pairs of all categories of repeating step is played up one by one.
In the present embodiment, after all triangular facets corresponding with material being drawn according to record, need the triangular facet of the remaining material of 409 pairs of all categories of repeating step to play up one by one, finally only rely on material to carry out the disposable of all triangular facets and play up.
In the embodiment of the present invention, by first creating the classification container of the record for storing material and answering in contrast, based on material, the object in three-dimensional scenic is traveled through one by one again and relevant triangular facet is classified after traveling through one by one, by extracting the record corresponding with material, and draw according to model data pair all triangular facets corresponding with material, and apply material, finally with regard to all triangular facets of different materials, draw one by one, can be directly to extract the record corresponding with material just to have realized and play up three-dimensional scenic, thereby a kind of material is only played up once, thereby reduce the number of times of material application, simultaneously, correspondingly reduced the interaction times of program and video card, reduced the varied number of state, correspondingly improved the performance of CPU and GPU.
The above, above embodiment only, in order to the technical scheme of a kind of three-dimensional scenic rendering intent that the embodiment of the present invention provides to be described, is not intended to limit; Although the present invention is had been described in detail with reference to previous embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or part technical characterictic is wherein equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (10)

1. a three-dimensional scenic rendering intent, is characterized in that, comprising:
S1: traversal classification container, and therefrom extract the record corresponding with the material of three-dimensional scenic;
S2: all triangular facets corresponding with described material are drawn according to described record;
S3: repeating step S1 plays up one by one to the triangular facet of the material of all categories.
2. method according to claim 1, is characterized in that, before described step S1, also comprises:
The described classification container that creates the described record for storing described material and answering in contrast, described record includes object information and triangular facet information.
3. method according to claim 1, is characterized in that, before described step S1, also comprises:
According to increasing progressively the mode of traversal by all objects of described three-dimensional scenic, and the triangular facet that described in each, object is corresponding travels through one by one;
Described triangular facet to described all objects is classified with described material.
4. method according to claim 3, is characterized in that, according to increasing progressively the mode of traversal by all objects of described three-dimensional scenic, and the triangular facet that described in each, object is corresponding travels through specifically and comprises one by one:
According to the mode that increases progressively traversal, all objects of described three-dimensional scenic are traveled through one by one, and obtain the model data corresponding with object described in each;
Travel through described triangular facet corresponding to object described in each, and obtain the described material corresponding with described triangular facet.
5. method according to claim 3, is characterized in that, the described triangular facet of described all objects is classified and specifically comprised with material:
Retrieve the described record that whether has described material and answer in contrast in described classification container, if so, trigger advanced judgment model, if not, the described record that adds described material and answer in contrast.
6. method according to claim 5, is characterized in that, described advanced judgment model specifically comprises:
Judge in described record whether have the object information corresponding with described object, if so, in described record, add the triangular facet information corresponding with described material, if not, based on described material, create the described record of answering in contrast.
7. method according to claim 1, is characterized in that, described step S2 specifically comprises:
By described record, obtain corresponding model data;
According to the described model data pair all triangular facets corresponding with described material, draw, and apply described material.
8. method according to claim 2, is characterized in that,
Described object information is object vernier numbering;
Described triangular facet information is triangular facet vernier numbering.
9. according to the method described in claim 4 or 7, it is characterized in that, described model data comprises vertex data and the material quality data of triangular facet.
10. according to the method described in claim 1 or 3, it is characterized in that, described material is material number information.
CN201410398934.5A 2014-08-13 2014-08-13 Three-dimensional scene rendering method Pending CN104156999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410398934.5A CN104156999A (en) 2014-08-13 2014-08-13 Three-dimensional scene rendering method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410398934.5A CN104156999A (en) 2014-08-13 2014-08-13 Three-dimensional scene rendering method

Publications (1)

Publication Number Publication Date
CN104156999A true CN104156999A (en) 2014-11-19

Family

ID=51882487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410398934.5A Pending CN104156999A (en) 2014-08-13 2014-08-13 Three-dimensional scene rendering method

Country Status (1)

Country Link
CN (1) CN104156999A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106327572A (en) * 2016-08-23 2017-01-11 网易(杭州)网络有限公司 Model merging method in three-dimensional scene and model merging device thereof
WO2017133567A1 (en) * 2016-02-05 2017-08-10 阿里巴巴集团控股有限公司 Batch rendering method, device, and apparatus
CN114004925A (en) * 2021-09-16 2022-02-01 北京城市网邻信息技术有限公司 WebGL-based model rendering method, electronic device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王晶晶: "基于PKPM3D图形平台的城市立交桥虚拟现实系统研究", 《中国优秀硕士学位论文全文数据库 工程科技II辑》 *
王瑞雪: "基于DirectX 9.0多玩家FPS游戏引擎的研究与应用", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017133567A1 (en) * 2016-02-05 2017-08-10 阿里巴巴集团控股有限公司 Batch rendering method, device, and apparatus
CN107045437A (en) * 2016-02-05 2017-08-15 阿里巴巴集团控股有限公司 A kind of method for realizing batch render, device and equipment
CN106327572A (en) * 2016-08-23 2017-01-11 网易(杭州)网络有限公司 Model merging method in three-dimensional scene and model merging device thereof
CN114004925A (en) * 2021-09-16 2022-02-01 北京城市网邻信息技术有限公司 WebGL-based model rendering method, electronic device and storage medium

Similar Documents

Publication Publication Date Title
US9934602B2 (en) System, method and device for three-dimensional modeling
EP3882865A1 (en) Object loading method, device, storage medium, and electronic device
CN107358649B (en) Processing method and device of terrain file
CN102831631B (en) Rendering method and rendering device for large-scale three-dimensional animations
CN112915542B (en) Collision data processing method and device, computer equipment and storage medium
CN110309458B (en) BIM model display and rendering method based on WebGL
CN104199659A (en) Method and device for exporting model information capable of being identified by 3DMAX
Steinberger et al. On‐the‐fly generation and rendering of infinite cities on the GPU
CN105283900A (en) Scheme for compressing vertex shader output parameters
CN111063032B (en) Model rendering method, system and electronic device
US20140160121A1 (en) Method for forming an optimized polygon based shell mesh
CN103927781A (en) Vision correlation model progressive rendering method on three-dimensional scene
US10762682B2 (en) Skinning weights and underlying object suppression of three-dimensional images
KR101670958B1 (en) Data processing method and apparatus in heterogeneous multi-core environment
CN110502676A (en) Airdrome scene operation emulation mode and storage medium based on visualization tool modeling
US10824775B2 (en) Simulation method and device for determining collision between objects
CN104700446A (en) Method for updating particle top point data in particle system
EP3192054A1 (en) System, method and computer program product for automatic optimization of 3d textured models for network transfer and real-time rendering
CN104156999A (en) Three-dimensional scene rendering method
US11157551B2 (en) Method and device for image loading
KR102096196B1 (en) How to configure model objects, servers, and systems
CN106815880A (en) animation multiplexing method and system
CN103782324A (en) Accelerated texture lookups by using texture coordinate derivatives
JP5864474B2 (en) Image processing apparatus and image processing method for processing graphics by dividing space
Haciomeroglu et al. A GPU-assisted hybrid model for real-time crowd simulations

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20141119