[go: up one dir, main page]

CN108846791B - Rendering method and device of physical model and electronic equipment - Google Patents

Rendering method and device of physical model and electronic equipment Download PDF

Info

Publication number
CN108846791B
CN108846791B CN201810681099.4A CN201810681099A CN108846791B CN 108846791 B CN108846791 B CN 108846791B CN 201810681099 A CN201810681099 A CN 201810681099A CN 108846791 B CN108846791 B CN 108846791B
Authority
CN
China
Prior art keywords
rendering
image frame
physical model
determining
gpu
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.)
Active
Application number
CN201810681099.4A
Other languages
Chinese (zh)
Other versions
CN108846791A (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.)
Zhuhai Baoqu Technology Co Ltd
Original Assignee
Zhuhai Baoqu Technology Co 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 Zhuhai Baoqu Technology Co Ltd filed Critical Zhuhai Baoqu Technology Co Ltd
Priority to CN201810681099.4A priority Critical patent/CN108846791B/en
Publication of CN108846791A publication Critical patent/CN108846791A/en
Application granted granted Critical
Publication of CN108846791B publication Critical patent/CN108846791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention provides a rendering method and device of a physical model and electronic equipment, wherein the method comprises the following steps: acquiring attribute information of at least one image frame to be rendered in the physical model; the attribute information includes: the number of fragments in the image frame and the fragment shader complexity; calculating the rendering time of the image frame according to the attribute information of the image frame; determining a rendering frame rate according to the rendering time of at least one image frame; rendering at least one image frame according to the rendering frame rate to obtain a rendered physical model, so that the rendering frame rate can be adaptively adjusted according to the rendering time of the image frame, the GPU can have enough time to render each image frame, the load of the GPU is reduced, the problems of rendering errors, frame skipping and the like are avoided, the rendering efficiency is improved, and the visual experience of a user on the rendered physical model is improved.

Description

Rendering method and device of physical model and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a rendering method and device of a physical model and electronic equipment.
Background
At present, in the process of rendering a physical model, a fixed rendering frame rate is adopted to render each image frame in the physical model, and a rendered physical model is obtained; and the rendering is to call a first interface of the GPU one by one for each object in the image frame to perform the rendering. Wherein the fixed rendering frame rate is, for example, 60 fps/s. When the number of the objects in the image frame is too large, the load of the GPU is increased, which causes rendering errors of a part of the objects in the image frame by the GPU, or frame skipping due to non-rendering of the part of the image frame, thereby reducing rendering efficiency and causing poor visual experience of a user on a rendered physical model.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first object of the present invention is to provide a rendering method for a physical model, which is used to solve the problem of poor rendering efficiency in the prior art.
The second purpose of the invention is to provide a rendering device of the physical model.
A third object of the present invention is to provide an electronic device for physical model rendering.
A fourth object of the invention is to propose a non-transitory computer-readable storage medium.
A fifth object of the invention is to propose a computer program product.
In order to achieve the above object, an embodiment of the first aspect of the present invention provides a method for rendering a physical model, including:
acquiring attribute information of at least one image frame to be rendered in the physical model; the attribute information includes: a number of fragments in the image frame and a fragment shader complexity;
calculating rendering time of the image frame according to the attribute information of the image frame;
determining a rendering frame rate according to the rendering time of the at least one image frame;
and rendering the at least one image frame according to the rendering frame rate to obtain a rendered physical model.
Further, the calculating the rendering time of the image frame according to the attribute information of the image frame includes:
acquiring the load condition of a GPU of a graphic processor;
and calculating the rendering time required by the GPU to render the image frames according to the load condition of the GPU and the attribute information of the image frames.
Further, the rendering the at least one image frame according to the rendering frame rate to obtain a rendered physical model includes:
for each image frame, acquiring at least one object in display content of the image frame;
combining the at least one object to obtain a large class object;
and calling a first interface of a GPU (graphics processing Unit) to render the large-class object to obtain a rendered image frame.
Further, the combining the at least one object to obtain a large class object includes:
acquiring the type of a graphic display;
determining at least one visible object in the image frame according to the type of the graphic display;
and combining the at least one visible object to obtain a large-class object.
Further, the determining a rendering frame rate according to the rendering time of the at least one image frame includes:
selecting one rendering time from the rendering times of the at least one image frame, and determining a rendering frame rate according to the selected rendering time; or,
determining an average value of rendering times of the at least one image frame, and determining a rendering frame rate according to the average value.
According to the rendering method of the physical model, the attribute information of at least one image frame to be rendered in the physical model is obtained; the attribute information includes: number of fragments in an image frame and fragment shader complexity; calculating the rendering time of the image frame according to the attribute information of the image frame; determining a rendering frame rate according to the rendering time of at least one image frame; rendering at least one image frame according to the rendering frame rate to obtain a rendered physical model, so that the rendering frame rate can be adaptively adjusted according to the rendering time of the image frame, the GPU can have enough time to render each image frame, the load of the GPU is reduced, the problems of rendering errors, frame skipping and the like are avoided, the rendering efficiency is improved, and the visual experience of a user on the rendered physical model is improved.
To achieve the above object, a second aspect of the present invention provides an apparatus for rendering a physical model, including:
the system comprises an acquisition module, a rendering module and a rendering module, wherein the acquisition module is used for acquiring attribute information of at least one image frame to be rendered in a physical model; the attribute information includes: a number of fragments in the image frame and a fragment shader complexity;
the computing module is used for computing the rendering time of the image frame according to the attribute information of the image frame;
a determining module, configured to determine a rendering frame rate according to a rendering time of the at least one image frame;
and the rendering module is used for rendering the at least one image frame according to the rendering frame rate to obtain a rendered physical model.
Further, the computing module is specifically configured to,
acquiring the load condition of a GPU of a graphic processor;
and calculating the rendering time required by the GPU to render the image frames according to the load condition of the GPU and the attribute information of the image frames.
Further, the rendering module is specifically configured to,
for each image frame, acquiring at least one object in display content of the image frame;
combining the at least one object to obtain a large class object;
and calling a first interface of a GPU (graphics processing Unit) to render the large-class object to obtain a rendered image frame.
Further, the rendering module is specifically configured to,
acquiring the type of a graphic display;
determining at least one visible object in the image frame according to the type of the graphic display;
and combining the at least one visible object to obtain a large-class object.
Further, the determining module is specifically configured to,
selecting one rendering time from the rendering times of the at least one image frame, and determining a rendering frame rate according to the selected rendering time; or,
determining an average value of the rendering time of the at least one image frame, and determining a rendering frame rate according to the average value.
The rendering device of the physical model of the embodiment of the invention obtains the attribute information of at least one image frame to be rendered in the physical model; the attribute information includes: the number of fragments in the image frame and the fragment shader complexity; calculating the rendering time of the image frame according to the attribute information of the image frame; determining a rendering frame rate according to the rendering time of at least one image frame; rendering at least one image frame according to the rendering frame rate to obtain a rendered physical model, so that the rendering frame rate can be adaptively adjusted according to the rendering time of the image frame, the GPU can have enough time to render each image frame, the load of the GPU is reduced, the problems of rendering errors, frame skipping and the like are avoided, the rendering efficiency is improved, and the visual experience of a user on the rendered physical model is improved.
To achieve the above object, an embodiment of a third aspect of the present invention provides an electronic device for physical model rendering, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for rendering a physical model as described above when executing the program.
To achieve the above object, a fourth aspect of the present invention provides a non-transitory computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor, implement the method as described above.
To achieve the above object, a fifth embodiment of the present invention provides a computer program product, which when executed by an instruction processor in the computer program product, implements the method as described above.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a rendering method of a physical model according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a rendering apparatus for a physical model according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device for physical model rendering according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a method and an apparatus for rendering a physical model according to an embodiment of the present invention with reference to the drawings.
Fig. 1 is a schematic flowchart of a rendering method of a physical model according to an embodiment of the present invention. As shown in fig. 1, the rendering method of the physical model includes the following steps:
s101, acquiring attribute information of at least one image frame to be rendered in a physical model; the attribute information includes: the number of fragments in the image frame and the fragment shader complexity.
The execution main body of the rendering method of the physical model provided by the invention is a rendering device of the physical model, and the rendering device of the physical model can be hardware equipment such as terminal equipment and a server provided with a Graphics Processing Unit (GPU), or a controller CPU of the hardware equipment, or software installed on the hardware equipment. In this embodiment, the physical model is an algorithm, and uses variables such as mass, speed, friction, and air resistance to simulate an approximately real physical system, so as to give a real physical effect to the rigid object, such as gravity, rotation, and collision, and make the behavior of the object more real. The physical model algorithm is mainly applied to the field of front-end development, such as a physical engine of game development. Among them, physical engines are, for example, game engines such as cos2dx, aigret, laybox, and three.
Wherein, the physical model algorithm can realize the following characteristics: (1) basic physical properties of an object include mass, position, degree of spin, velocity, and degree of attenuation. (2) The material of the object comprises density, friction and a recovery system. (3) The physical world, including global gravity, refresh rate, sub-steps (number per refresh), boundaries, is an aggregation of objects, constraints, and composite objects. (4) The position and speed of the physical rigid body can be a static rigid body or a dynamic rigid body, and the realization of the static rigid body is to endow infinite quality. (5) And collision, including collision detection. (6) Queries, including point queries, ray queries, and rectangle queries.
In this embodiment, when the physical model algorithm simulates an object, a plurality of continuous image frames are generated; the plurality of image frames are rendered to obtain a simulated physical system which can be observed by a user. Wherein, the fragment is a pixel point with attributes such as position, normal vector and the like. The number of fragments and the complexity of the fragment shader may be obtained from the graphics processor GPU, i.e. the graphics processor GPU analyzes the image frame. In addition, the attribute information of the image frame may further include: number of vertices. The number of the vertexes is the total number of the vertexes of each granularity in the image frame.
And S102, calculating the rendering time of the image frame according to the attribute information of the image frame.
In this embodiment, the process of the rendering device of the physical model executing step 102 may specifically be to obtain a load condition of the GPU; and calculating the rendering time required by the GPU to render the image frames according to the load condition of the GPU and the attribute information of the image frames. The rendering time calculation formula may be as shown in formula (1).
ET is rendering coefficient × SC × PIX; (1)
wherein ET represents rendering time; SC represents the fragment shader complexity; PIX denotes the number of slices. The rendering coefficient is determined according to the load condition, rendering speed and the like of the GPU.
S103, determining a rendering frame rate according to the rendering time of at least one image frame.
In this embodiment, the rendering frame rate is the number of image frames rendered in a unit time. The rendering device of the physical model may determine the rendering frame rate by selecting one of the rendering times of the at least one image frame, and determining the rendering frame rate according to the selected rendering time; or determining an average value of the rendering time of the at least one image frame, and determining the rendering frame rate according to the average value.
In this embodiment, the rendering device of the physical model may determine the rendering frame rate every preset time period, for example, every 1 second. In the process of determining the rendering frame rate, firstly determining the number of image frames which can be rendered by the GPU within 1 second or 2 seconds; and then acquiring the number of image frames to be rendered, and determining the rendering frame rate.
And S104, rendering at least one image frame according to the rendering frame rate to obtain a rendered physical model.
In this embodiment, in an implementation scenario, for each object in the display content of each image frame, the rendering device of the physical model may call the first interface of the GPU to render the object, thereby implementing the drawing and rendering operation on the entire image frame. In another implementation scenario, in order to increase the rendering speed and reduce the load of the GPU, for each image frame, the rendering device of the physical model may obtain at least one object in the display content of the image frame; combining at least one object to obtain a large class object; and calling a first interface of a GPU (graphics processing Unit) to render the large objects to obtain rendered image frames, so that the plurality of objects of the image frames are drawn and rendered through one-time calling of the first interface, and the rendering speed is improved. The first interface may be an OpenGL interface, for example.
Further, on the basis of the above embodiment, in order to further increase the rendering speed, the content to be rendered may be adjusted according to the type of the graphic display, and correspondingly, in the above step, the process of combining at least one object to obtain a large class of objects may specifically be to obtain the type of the graphic display; determining at least one visible object in the image frame according to the type of the graphic display; and combining at least one visible object to obtain a large-class object.
In this embodiment, the type of the graphic display is used to identify the size of the display or the type of hardware device on which the display is located, for example, on a mobile phone, a computer, or a PAD. When the display is located on the mobile phone, the display is small in size, and it may be difficult to display all objects in the image frame, so that it is necessary to determine the objects that can be currently displayed on the display according to the type of the graphic display; and then the objects which can be displayed are combined to obtain the large-class object. Therefore, the number of objects needing to be rendered is reduced, the rendering speed is increased, the load condition of the GPU is reduced, the probability of rendering errors, frame skipping and other problems is reduced, and the visual experience of a user on the rendered physical model is improved.
Further, in the above embodiment, when the rendering device of the physical model calls the first interface, the formats of the identifiers of the objects or the large-scale objects may be unified first, and then the identifiers with the unified formats are used as parameters to call the first interface, so that the GPU can quickly acquire the data of the objects or the large-scale objects according to the identifiers with the unified formats, and then perform drawing or rendering, and the like, thereby further improving the rendering speed. In addition, the format unifying method can also be used for other interfaces, such as a query interface and the like. The query interface may be getElementsByTagName, for example.
In addition, in this embodiment, the data of the object may be represented by using an analog view matrix. Wherein, the simulation view matrix can represent the relative position relation between each object in the image frame; the simulation view matrix changes only when the relative position of each object changes, so that the same local simulation view matrix may exist in a plurality of image frames, and the same local simulation view matrix can be rendered only once, so that the rendering speed can be further increased.
According to the rendering method of the physical model, the attribute information of at least one image frame to be rendered in the physical model is obtained; the attribute information includes: the number of fragments in the image frame and the fragment shader complexity; calculating the rendering time of the image frame according to the attribute information of the image frame; determining a rendering frame rate according to the rendering time of at least one image frame; the method comprises the steps of rendering at least one image frame according to a rendering frame rate to obtain a rendered physical model, so that the rendering frame rate can be adaptively adjusted according to the rendering time of the image frame, a Graphics Processing Unit (GPU) can have enough time to render each image frame, the load of the GPU is reduced, the problems of rendering errors, frame skipping and the like are avoided, the rendering efficiency is improved, and the visual experience of a user on the rendered physical model is improved.
Fig. 2 is a schematic structural diagram of a rendering apparatus for a physical model according to an embodiment of the present invention. As shown in fig. 2, includes: an acquisition module 21, a calculation module 22, a determination module 23 and a rendering module 24.
The obtaining module 21 is configured to obtain attribute information of at least one image frame to be rendered in the physical model; the attribute information includes: a number of fragments in the image frame and a fragment shader complexity;
a calculating module 22, configured to calculate a rendering time of the image frame according to the attribute information of the image frame;
a determining module 23, configured to determine a rendering frame rate according to a rendering time of the at least one image frame;
and the rendering module 24 is configured to render the at least one image frame according to the rendering frame rate to obtain a rendered physical model.
The rendering device of the physical model provided by the present invention may specifically be a hardware device such as a terminal device and a server on which a Graphics Processing Unit (GPU) is installed, or a controller CPU of the hardware device, or software installed on the hardware device. In this embodiment, the physical model is an algorithm, and uses variables such as mass, speed, friction, and air resistance to simulate an approximately real physical system, so as to give a real physical effect to the rigid object, such as gravity, rotation, and collision, and make the behavior of the object more real. The physical model algorithm is mainly applied to the field of front-end development, such as a physical engine of game development. Among them, physical engines are, for example, game engines such as cos2dx, aigret, laybox, and three.
In this embodiment, when the physical model algorithm simulates an object, a plurality of continuous image frames are generated; the plurality of image frames are rendered to obtain a simulated physical system which can be observed by a user. Wherein, the fragment is a pixel point with attributes such as position, normal vector and the like. The number of fragments and the complexity of the fragment shader may be obtained from the graphics processor GPU, i.e. the graphics processor GPU analyzes the image frame. In addition, the attribute information of the image frame may further include: number of vertices. The number of the vertexes is the total number of the vertexes of each granularity in the image frame.
Further, the calculation module 22 may be specifically configured to obtain a load condition of the GPU; and calculating the rendering time required by the GPU to render the image frames according to the load condition of the GPU and the attribute information of the image frames.
In this embodiment, the rendering frame rate is the number of image frames rendered in a unit time. The rendering device of the physical model may determine the rendering frame rate by selecting one of the rendering times of the at least one image frame, and determining the rendering frame rate according to the selected rendering time; or, determining an average value of the rendering time of at least one image frame, and determining the rendering frame rate according to the average value.
In this embodiment, the rendering device of the physical model may determine the rendering frame rate every preset time period, for example, every 1 second. In the process of determining the rendering frame rate, firstly determining the number of image frames which can be rendered by the GPU within 1 second or 2 seconds; and then acquiring the number of image frames to be rendered, and determining the rendering frame rate.
In this embodiment, in an implementation scenario, for each object in the display content of each image frame, the rendering device of the physical model may call the first interface of the GPU to render the object, thereby implementing the drawing and rendering operations on the entire image frame. In another implementation scenario, in order to increase the rendering speed and reduce the GPU load, the rendering module 24 is specifically configured to, for each image frame, obtain at least one object in the display content of the image frame; combining the at least one object to obtain a large class object; and calling a first interface of a GPU (graphics processing Unit) to render the large-class object to obtain a rendered image frame.
Further, on the basis of the above embodiment, in order to further improve the rendering speed, the content to be rendered may be adjusted according to the type of the graphic display, and correspondingly, the rendering module 24 may be specifically configured to obtain the type of the graphic display; determining at least one visible object in the image frame according to the type of the graphic display; and combining the at least one visible object to obtain a large-class object.
In this embodiment, the type of the graphical display is used to identify the size of the display or the type of hardware device on which the display is located, such as a mobile phone, a computer, or a PAD. When the display is located on the mobile phone, the display is small in size, and it may be difficult to display all objects in the image frame, so that it is necessary to determine the objects that can be currently displayed on the display according to the type of the graphic display; and then the objects which can be displayed are combined to obtain a large class of objects. Therefore, the number of objects needing to be rendered is reduced, the rendering speed is increased, the load condition of the GPU is reduced, the probability of rendering errors, frame skipping and other problems is reduced, and the visual experience of a user on the rendered physical model is improved.
Further, in the above embodiment, when the rendering device of the physical model calls the first interface, the formats of the identifiers of the objects or the large-scale objects may be unified first, and then the identifiers with the unified formats are used as parameters to call the first interface, so that the GPU can quickly acquire the data of the objects or the large-scale objects according to the identifiers with the unified formats, and then perform drawing or rendering, and the like, thereby further improving the rendering speed. In addition, the format unifying method can also be used for other interfaces, such as a query interface and the like. The query interface may be getElementsByTagName, for example.
In addition, in this embodiment, the data of the object may be represented by using an analog view matrix. Wherein, the simulation view matrix can represent the relative position relation between each object in the image frame; the simulation view matrix changes only when the relative position of each object changes, so that the same local simulation view matrix may exist in a plurality of image frames, and the same local simulation view matrix can be rendered only once, so that the rendering speed can be further improved.
According to the rendering method of the physical model, the attribute information of at least one image frame to be rendered in the physical model is obtained; the attribute information includes: number of fragments in an image frame and fragment shader complexity; calculating the rendering time of the image frame according to the attribute information of the image frame; determining a rendering frame rate according to the rendering time of at least one image frame; rendering at least one image frame according to the rendering frame rate to obtain a rendered physical model, so that the rendering frame rate can be adaptively adjusted according to the rendering time of the image frame, the GPU can have enough time to render each image frame, the load of the GPU is reduced, the problems of rendering errors, frame skipping and the like are avoided, the rendering efficiency is improved, and the visual experience of a user on the rendered physical model is improved.
Fig. 3 is a schematic structural diagram of an electronic device for physical model rendering according to an embodiment of the present invention. The electronic device for physical model rendering comprises:
memory 1001, processor 1002, and computer programs stored on memory 1001 and executable on processor 1002.
The processor 1002, when executing the program, implements the rendering method of the physical model provided in the above-described embodiment.
Further, the electronic device for physical model rendering further comprises:
a communication interface 1003 for communicating between the memory 1001 and the processor 1002.
A memory 1001 for storing computer programs that may be run on the processor 1002.
Memory 1001 may include high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
The processor 1002 is configured to implement the rendering method of the physical model according to the foregoing embodiment when executing the program.
If the memory 1001, the processor 1002, and the communication interface 1003 are implemented independently, the communication interface 1003, the memory 1001, and the processor 1002 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
Optionally, in a specific implementation, if the memory 1001, the processor 1002, and the communication interface 1003 are integrated on one chip, the memory 1001, the processor 1002, and the communication interface 1003 may complete communication with each other through an internal interface.
The processor 1002 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
The present embodiment also provides a computer-readable storage medium on which a computer program is stored, wherein the program, when executed by a processor, implements the rendering method of the physical model as described above.
The present embodiment also provides a computer program product, which when executed by an instruction processor in the computer program product, performs the rendering method of the physical model as described above.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried out in the method of implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (11)

1. A method for rendering a physical model, comprising:
acquiring attribute information of at least one image frame to be rendered in the physical model; the attribute information includes: a number of fragments in the image frame and a fragment shader complexity;
calculating rendering time of the image frame according to the attribute information of the image frame;
determining a rendering frame rate according to the rendering time of the at least one image frame;
rendering the at least one image frame according to the rendering frame rate to obtain a rendered physical model; rendering the at least one image frame according to the rendering frame rate to obtain a rendered physical model, including:
for each image frame, acquiring at least one object in display content of the image frame;
combining the at least one object to obtain a large class object;
calling a first interface of a GPU (graphics processing Unit), rendering the large class of objects to obtain rendered image frames, wherein data of the objects are represented by a simulation view matrix, the simulation view matrix can represent the relative position relation among the objects in the image frames, and when the relative position of each object changes, acquiring the same local simulation view matrix in the plurality of image frames, and rendering aiming at the same local simulation view matrix.
2. The method of claim 1, wherein the calculating a rendering time of the image frame according to the attribute information of the image frame comprises:
acquiring the load condition of a GPU (graphics processing Unit);
and calculating the rendering time required by the GPU to render the image frames according to the load condition of the GPU and the attribute information of the image frames.
3. The method of claim 1, wherein said combining the at least one object to obtain a large class of objects comprises:
acquiring the type of a graphic display;
determining at least one visible object in the image frame according to the type of the graphic display;
and combining the at least one visible object to obtain a large-class object.
4. The method of claim 1, wherein determining a rendering frame rate according to a rendering time of the at least one image frame comprises:
selecting one rendering time from the rendering times of the at least one image frame, and determining a rendering frame rate according to the selected rendering time; or,
determining an average value of the rendering time of the at least one image frame, and determining a rendering frame rate according to the average value.
5. An apparatus for rendering a physical model, comprising:
the system comprises an acquisition module, a rendering module and a rendering module, wherein the acquisition module is used for acquiring attribute information of at least one image frame to be rendered in a physical model; the attribute information includes: a number of fragments in the image frame and a fragment shader complexity;
the computing module is used for computing the rendering time of the image frame according to the attribute information of the image frame;
a determining module, configured to determine a rendering frame rate according to a rendering time of the at least one image frame;
the rendering module is used for rendering the at least one image frame according to the rendering frame rate to obtain a rendered physical model; the rendering module is in particular adapted to,
for each image frame, acquiring at least one object in display content of the image frame;
combining the at least one object to obtain a large class object;
calling a first interface of a GPU (graphics processing Unit) to render the large-class object to obtain a rendered image frame; the data of the objects are represented by using a simulation view matrix, wherein the simulation view matrix can represent the relative position relation among the objects in the image frames, when the relative position of each object changes, the same local simulation view matrix existing in the plurality of image frames is obtained, and the same local simulation view matrix is rendered.
6. The apparatus according to claim 5, characterized in that the calculation module is specifically configured to,
acquiring the load condition of a GPU (graphics processing Unit);
and calculating the rendering time required by the GPU to render the image frames according to the load condition of the GPU and the attribute information of the image frames.
7. The apparatus of claim 5, wherein the rendering module is specifically configured to,
acquiring the type of a graphic display;
determining at least one visible object in the image frame according to the type of the graphic display;
and combining the at least one visible object to obtain a large-class object.
8. The apparatus of claim 5, wherein the means for determining is configured to,
selecting one rendering time from the rendering times of the at least one image frame, and determining a rendering frame rate according to the selected rendering time; or,
determining an average value of rendering times of the at least one image frame, and determining a rendering frame rate according to the average value.
9. An electronic device for physical model rendering, comprising:
memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of rendering a physics model according to any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of rendering a physical model according to any one of claims 1 to 4.
11. A computer program product implementing a method of rendering a physics model according to any one of claims 1 to 4 when executed by an instruction processor in the computer program product.
CN201810681099.4A 2018-06-27 2018-06-27 Rendering method and device of physical model and electronic equipment Active CN108846791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810681099.4A CN108846791B (en) 2018-06-27 2018-06-27 Rendering method and device of physical model and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810681099.4A CN108846791B (en) 2018-06-27 2018-06-27 Rendering method and device of physical model and electronic equipment

Publications (2)

Publication Number Publication Date
CN108846791A CN108846791A (en) 2018-11-20
CN108846791B true CN108846791B (en) 2022-09-20

Family

ID=64199876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810681099.4A Active CN108846791B (en) 2018-06-27 2018-06-27 Rendering method and device of physical model and electronic equipment

Country Status (1)

Country Link
CN (1) CN108846791B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110544291B (en) * 2019-09-11 2023-05-09 珠海金山数字网络科技有限公司 Image rendering method and device
CN112750182B (en) * 2019-10-29 2025-03-11 腾讯科技(深圳)有限公司 A method, device and computer-readable storage medium for realizing motion effects
CN110796722B (en) * 2019-11-01 2023-04-25 广东三维家信息科技有限公司 Three-dimensional rendering presentation method and device
CN111460660A (en) * 2020-03-31 2020-07-28 安阳师范学院 Electronic device with built-in simulated physical mechanics experimental scene and control method thereof
CN113744115A (en) * 2020-05-28 2021-12-03 上海惠芽信息技术有限公司 Image frame rendering method, display apparatus, and computer-readable storage medium
CN112235604B (en) * 2020-10-20 2021-12-10 广州博冠信息科技有限公司 Rendering method and device, computer readable storage medium and electronic device
CN112419469B (en) * 2020-11-20 2025-02-25 北京道亨时代科技有限公司 Model rendering method and device
CN114219884B (en) * 2021-12-22 2025-02-28 脸萌有限公司 Particle special effects rendering method, device, equipment and storage medium
CN115145778B (en) * 2022-09-02 2022-11-25 西安芯瞳半导体技术有限公司 Method and device for analyzing rendering result of display card and storage medium
CN118245230B (en) * 2024-05-27 2024-09-20 北京趋动智能科技有限公司 Image rendering task scheduling method and device based on load balancing

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2174839A1 (en) * 1993-11-05 1995-05-11 Richard D. Webb Graphic state processing
CN105409213A (en) * 2013-06-24 2016-03-16 微软技术许可有限责任公司 Interleaved tiled rendering of stereoscopic scenes

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103366391B (en) * 2013-06-26 2016-07-06 广州市动景计算机科技有限公司 The picture rendering intent of dynamic image and picture rendering device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2174839A1 (en) * 1993-11-05 1995-05-11 Richard D. Webb Graphic state processing
CN105409213A (en) * 2013-06-24 2016-03-16 微软技术许可有限责任公司 Interleaved tiled rendering of stereoscopic scenes

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Blender 3D渲染机制研究;刘文韬;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20170215(第02期);I138-3657 *
Rendering of large and complex urban environments for real time heritage reconstructions;J. Willmott.etc;《Proceedings of the 2001 conference on Virtual reality, archeology, and cultural heritage》;20011128;111–120 *
RP软件中VRML模型的可视化研究;李占利等;《计算机工程与设计》;20070316(第05期);1185-1188 *

Also Published As

Publication number Publication date
CN108846791A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
CN108846791B (en) Rendering method and device of physical model and electronic equipment
US9881391B2 (en) Procedurally defined texture maps
CN109035383B (en) Volume cloud drawing method and device and computer readable storage medium
KR20190031496A (en) Dynamic Poversion Adjustment
CN104571887B (en) Static picture based dynamic interaction method and device
CN112652046B (en) Game picture generation method, device, equipment and storage medium
CN110413245A (en) Image synthesis method, image synthesis device, electronic equipment and storage medium
CN112596843A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN110647597B (en) Rendering method and device of electronic map
CN105144243A (en) Data visualization
WO2018120992A1 (en) Window rendering method and terminal
US11069020B2 (en) Graphics processing using multiple primitives
CN114219884B (en) Particle special effects rendering method, device, equipment and storage medium
CN114565708A (en) A method, apparatus, device and readable storage medium for selecting an antialiasing algorithm
CN110334027A (en) Game screen testing method and device
CN104574473B (en) Method and device for generating dynamic effect on basis of static image
CN113934500A (en) Rendering method, device, storage medium and electronic device
US20230377265A1 (en) Systems for Efficiently Rendering Vector Objects
KR20160143936A (en) Method for increasing 3D rendering performance and system thereof
CN115131481B (en) GPU rendering efficiency determination method, model building method, device, medium and equipment
CN115457181A (en) Particle special effect rendering method and device, computer equipment and storage medium
CN111243069B (en) Scene switching method and system of Unity3D engine
CN110930499B (en) 3D data processing method and device
JP2000148126A (en) Image display device and method
CN112767518A (en) Virtual animation special effect making method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20191122

Address after: 519030 Room 105-53811, No. 6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province

Applicant after: Zhuhai Leopard Technology Co.,Ltd.

Address before: 519070, No. 10, main building, No. six, science Road, Harbour Road, Tang Wan Town, Guangdong, Zhuhai, 601F

Applicant before: Zhuhai Juntian Electronic Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant