CN115761082A - Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium - Google Patents

Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium Download PDF

Info

Publication number
CN115761082A
CN115761082A CN202211297305.4A CN202211297305A CN115761082A CN 115761082 A CN115761082 A CN 115761082A CN 202211297305 A CN202211297305 A CN 202211297305A CN 115761082 A CN115761082 A CN 115761082A
Authority
CN
China
Prior art keywords
rendering
target
model
geometric model
dimensional
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
CN202211297305.4A
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.)
Shengming Technology Guangzhou Co ltd
Original Assignee
Shengming Technology Guangzhou 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 Shengming Technology Guangzhou Co ltd filed Critical Shengming Technology Guangzhou Co ltd
Priority to CN202211297305.4A priority Critical patent/CN115761082A/en
Publication of CN115761082A publication Critical patent/CN115761082A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application provides a method and a device for rendering three-dimensional graphics, an electronic device and a storage medium, wherein the method comprises the following steps: configuring scene information by using a first function method in a target three-dimensional packaging library, wherein the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript; acquiring the created initial geometric model and acquiring rendering associated information; and inputting the initial geometric model into scene information, and rendering the target geometric model by combining rendering association information. Through the method and the device, the problems of high development cost, low efficiency and long period in the related technology are solved.

Description

Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for rendering three-dimensional graphics, an electronic device, and a storage medium.
Background
Currently, webGL (Web Graphics Library) is a 3D drawing standard, which allows JavaScript and OpenGL ES 2.0 to be combined together, and by adding a JavaScript binding of OpenGL ES 2.0, webGL can provide hardware 3D accelerated rendering for HTML5Canvas, so that Web developers can display 3D scenes and models more smoothly in a browser by means of a system Graphics card, and can also create complex navigation and data visualization. Obviously, the WebGL technical standard avoids the trouble of developing a web page-specific rendering plug-in, can be used for creating website pages with complex 3D structures, and can even be used for designing 3D web games and the like.
The existing WebGL exposed interface is a bottom layer, and related development can be carried out only by familiarizing with a computer graphics related knowledge system, so that the use difficulty is very high, and the development period is long; the conventional WebGL-based three-dimensional engine has very low packaging degree and cannot meet the requirement of front-end developers on developing three-dimensional functions.
Therefore, the disadvantages of the prior art include high development cost, low efficiency, long cycle time, and the like.
Disclosure of Invention
The application provides a three-dimensional graph rendering method and device, an electronic device and a storage medium, which are used for at least solving the problems of high development cost, low efficiency and long period in the related art.
According to an aspect of the embodiments of the present application, there is provided a method for rendering three-dimensional graphics, the method comprising:
configuring scene information by using a first function method in a target three-dimensional packaging library, wherein the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript;
acquiring the created initial geometric model and acquiring rendering associated information;
and inputting the initial geometric model into the scene information, and rendering a target geometric model by combining the rendering association information.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for three-dimensional graphics rendering, the apparatus including:
the system comprises a configuration module, a first function method and a second function method, wherein the configuration module is used for configuring scene information by utilizing a first function method in a target three-dimensional packaging library, and the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript;
the acquisition module is used for acquiring the created initial geometric body model and acquiring rendering correlation information;
and the rendering module is used for inputting the initial geometric model into the scene information and rendering a target geometric model by combining the rendering association information.
Optionally, the obtaining module includes:
the calling unit is used for calling a plurality of component parameter functions in the target drawing standard;
and the generating unit is used for generating the initial geometric body model according to the component parameter function.
Optionally, the obtaining module includes:
the first creating unit is used for creating material elements by using a second function method in the target three-dimensional packaging library;
a second creating unit, configured to create a shader using a third function method in the target three-dimensional package library;
a third creating unit, configured to create a renderer by using a fourth function method in the target three-dimensional packaging library;
a first setting unit configured to use the shader, the material element, and the renderer as the rendering association information.
Optionally, the obtaining module further includes:
a fourth creating unit, configured to create a loader by using a fifth function method in the target three-dimensional packaging library;
a reading unit for reading the initial geometric model constructed by modeling software;
and the first loading unit is used for loading the initial geometric body model by utilizing the loader.
Optionally, the obtaining module further includes:
a second loading unit, configured to load the model file in the initial geometric model by using the loader;
the conversion unit is used for converting the model file into a JSON file through a JSON conversion function;
the analysis unit is used for analyzing the JSON file to obtain rendering standby parameters contained in the JSON file;
a fifth creating unit, configured to create a renderer by using a fourth function method in the target three-dimensional packaging library;
and the second setting unit is used for taking the rendering standby parameters and the renderer as the rendering related information.
Optionally, the apparatus further comprises:
and the creating module is used for creating a camera element and a light source element according to the scene information before the initial geometric body model is input into the scene information and a target geometric body model is rendered by combining the rendering correlation information.
Optionally, the rendering module comprises:
the adjusting unit is used for adding the initial geometric model into the scene information, and adjusting the angle and illumination of the initial geometric model by using the camera element and the light source element to obtain an intermediate geometric model;
and the rendering unit is used for rendering the intermediate geometric body model by using a renderer to obtain the target geometric body model.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used for storing the computer program; a processor for performing the method steps in any of the above embodiments by running the computer program stored on the memory.
According to a further aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the method steps of any of the above embodiments when the computer program is executed.
In the embodiment of the application, scene information is configured by utilizing a first function method in a target three-dimensional packaging library, wherein the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript; acquiring the created initial geometric model and acquiring rendering associated information; and inputting the initial geometric model into scene information, and rendering the target geometric model by combining rendering association information. According to the embodiment of the application, the JavaScript is used for packaging the target drawing standard once to obtain the target three-dimensional packaging library, so that the target three-dimensional packaging library is used for rendering the three-dimensional model by using the WebGL, learning of relevant knowledge such as C language is not needed, 3D development can be performed by using the JavaScript only, and a front-end developer with the JavaScript basis can rapidly enter the webpage, rapidly and quickly display three-dimensional model data on the webpage, so that the development difficulty is reduced, the rendering of the three-dimensional model can be realized by using fewer codes, the research and development period is saved, the working efficiency is improved, and the problems of high development cost, low efficiency and long period in the related technology are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic flow chart diagram illustrating an alternative method for three-dimensional graphics rendering according to an embodiment of the present application;
FIG. 2 is an alternative WebGL rendering flow diagram according to embodiments of the present application;
FIG. 3 is a full flow diagram of an alternative method of three-dimensional graphics rendering according to an embodiment of the present application;
FIG. 4 is a block diagram of an alternative apparatus for three-dimensional graphics rendering according to an embodiment of the present application;
fig. 5 is a block diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Currently, when 3D model rendering is performed, a technology of WebGL (Web Graphics Library) is often used, wherein the WebGL is a 3D drawing standard, an exposed interface of the existing WebGL is relatively bottom-layer, related development can be performed only by being familiar with a computer Graphics related knowledge system, the use difficulty is very high, and the development period is relatively long; the conventional WebGL-based three-dimensional engine has very low packaging degree and cannot meet the requirement of front-end developers on developing three-dimensional functions. Because the learning cost of WebGL is high and it is difficult to enter the door, in order to solve the problem, an embodiment of the present application provides a method for rendering a three-dimensional graph, as shown in fig. 1, the method may be applied to a back-end server side, and the method includes:
step S101, scene information is configured by utilizing a first function method in a target three-dimensional packaging library, wherein the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript;
step S102, acquiring the created initial geometric model and acquiring rendering associated information;
step S103, inputting the initial geometric model into scene information, and rendering the initial geometric model into a target geometric model by combining rendering association information.
Optionally, aiming at the problems of high learning cost and difficulty in entry of WebGL, javaScript is used for packaging the WebGL once in the embodiment of the application, so that a front-end developer with a JavaScript basis can quickly enter the web page, quickly get on the web page and quickly display three-dimensional model data on the web page. Here, the library name of the package is 3dengin.js, which is called a target three-dimensional package library.
Then using a first function method in the target three-dimensional packaging library: scene () method creates Scene information.
Acquiring the created initial geometric model and rendering-related associated information, then adding the initial geometric model into scene information, and rendering the initial geometric model by combining the rendering associated information to further obtain a rendered target geometric model.
In the embodiment of the application, scene information is configured by utilizing a first function method in a target three-dimensional packaging library, wherein the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript; acquiring the created initial geometric model and rendering associated information; and inputting the initial geometric model into scene information, and rendering the target geometric model by combining rendering association information. According to the embodiment of the application, the JavaScript is used for packaging the target drawing standard once to obtain the target three-dimensional packaging library, so that the target three-dimensional packaging library is used for rendering the three-dimensional model by using the WebGL, learning of relevant knowledge such as C language is not needed, 3D development can be performed by using the JavaScript only, and a front-end developer with the JavaScript basis can rapidly enter the webpage, rapidly and quickly display three-dimensional model data on the webpage, so that the development difficulty is reduced, the rendering of the three-dimensional model can be realized by using fewer codes, the research and development period is saved, the working efficiency is improved, and the problems of high development cost, low efficiency and long period in the related technology are solved.
Based on the content of the foregoing embodiments, as an alternative embodiment, the obtaining the created initial geometric model includes:
calling a plurality of component parameter functions in the target drawing standard;
and generating an initial geometric body model according to the component parameter function.
Optionally, a digit method in the target three-dimensional packaging library is used to call a gl.points () method, a gl.lines () method and a gl.triangle () method in the target drawing standard (i.e. WebGL), which respectively correspond to component parameter functions for generating points, lines and surfaces, and the initial geometric model can be generated by the points, lines and surfaces. As shown in fig. 2, fig. 2 includes 4 sub-graphs, and the vertex coordinates, that is, the vertex coordinates displayed by the sub-graph (1), are first obtained, the primitive assembly of the sub-graph (2) is obtained through primitive assembly (that is, a triangle is drawn one by one), the sub-graph (3) is obtained through rasterization (that is, a fragment is generated, that is, a pixel point by one), and the final geometric model sub-graph (4) is obtained through rendering.
Based on the content of the foregoing embodiments, as an optional embodiment, the obtaining rendering association information includes:
creating material elements by using a second function method in the target three-dimensional packaging library;
creating a shader by using a third function method in the target three-dimensional packaging library;
creating a renderer by using a fourth function method in the target three-dimensional packaging library;
and taking the shader, the material element and the renderer as rendering related information.
Optionally, using a second functional method within the target three-dimensional packaging library: material () creates Material elements Material (including custom, built-in, etc.); using a third function method in the target three-dimensional packaging library: generate shader Shaders (including vertex shader, determine shape, fragment shader, determine texture); and covering the initial geometric body model with the obtained material elements by using a shader, and then adding the initial geometric body model into the scene information.
Using a fourth function method in the target three-dimensional packaging library: webglrender () method creates a Renderer, and renders the geometric model added to the scene information using the Renderer. This part is described in detail in the following embodiments and will not be described again.
In the embodiment of the application, research and development personnel can create an initial geometric model by calling a library or a method function, and then create material elements, shaders, renderers and the like in a targeted manner, so that after rendering associated information is formed, three-dimensional model data can be rapidly presented on a page by directly rendering the initial geometric model.
Based on the content of the foregoing embodiments, as an optional embodiment, the obtaining the created initial geometric model further includes:
creating a loader by using a fifth function method in the target three-dimensional packaging library;
reading an initial geometric body model which is constructed by modeling software;
and loading the initial geometric body model by using a loader.
Optionally, in this embodiment of the application, when the initial geometric model is created, the established geometric model may also be read and loaded on the page to be rendered, where the specific manner is: using a fifth function method in the target three-dimensional packaging library: loader (), reads the initial geometric model built by modeling software, and then loads the initial geometric model by using the Loader and puts the initial geometric model on a rendering page.
Based on the content of the foregoing embodiments, as an optional embodiment, the obtaining rendering associated information further includes:
loading a model file in the initial geometric body model by using a loader;
converting the model file into a JSON file through a JSON conversion function;
analyzing the JSON file to obtain rendering standby parameters contained in the JSON file;
creating a renderer by using a fourth function method in the target three-dimensional packaging library;
and taking the rendering standby parameters and the renderer as rendering associated information.
Optionally, loading model files such as OBJ, STL, FBX, GLTF, GLB, etc. by using a created loader, converting the loaded model files into JSON files readable by a dengin.tojson () method, and analyzing rendering standby parameters contained in the model files by using the 3dengin.js, wherein the rendering standby parameters include geometric vertex information, material information, texture UV, animation, etc.;
then adding the model data to the scene information, using a fourth function in 3dengin. Webglrender () method creates a Renderer, writes code using JavaScript, so that the initial geometry model is rendered in conjunction with the Renderer.
In the embodiment of the application, research personnel can load the model modeled by reading modeling software to a rendering page, analyze rendering standby parameters contained in a current model file, add the rendering standby parameters into a scene of rendering an initial geometric model, and render by using JavaScript and a renderer, so that the development difficulty is reduced, and the required 3D effect can be realized by only needing fewer codes.
Based on the content of the foregoing embodiments, as an optional embodiment, before inputting the initial geometric model into the scene information and rendering the target geometric model in combination with the rendering association information, the method further includes:
and creating a camera element and a light source element according to the scene information.
Optionally, after the scene information is created, an image capturing element, such as a camera, and a light source element, such as a light, may be created according to the scene information. It can be appreciated that, light can light up the scene in 3D formation of image except, it still plays the effect such as rendering works atmosphere, simulation different moments, reinforcing visual decoration sense, reinforcing third dimension, increase sense of space, and the camera can play the effect of fixed picture angle, can also set up special effect, control rendering effect.
Based on the content of the foregoing embodiments, as an optional embodiment, inputting the initial geometric model into scene information, and rendering the target geometric model in combination with rendering association information, includes:
adding the initial geometric model into scene information, and adjusting the angle and illumination of the initial geometric model by using a camera element and a light source element to obtain an intermediate geometric model;
and rendering the intermediate geometric model by using a renderer to obtain a target geometric model.
Optionally, in the above embodiment, after generating a camera element and a light source element in the scene information, adding the generated initial geometric model to the scene information, then adjusting an angle of the initial geometric model by using the camera element, for example, a camera, adjusting illumination of the initial geometric model by using the light source element, for example, lighting, to obtain an intermediate geometric model, and then rendering the intermediate geometric model by using the obtained renderer, to obtain the target geometric model.
In the embodiment of the application, the camera elements and the light source elements which are created in a scene are added to adjust the initial geometric model in multiple aspects, so that the rendered target geometric model is more fit with the actual requirement.
Based on the content of the foregoing embodiments, as an optional embodiment, as shown in fig. 3, fig. 3 is a complete flow diagram of an optional three-dimensional graphics rendering method according to the embodiment of the present application, and the specific flow is as follows:
branching one: creating a scene; configuring scenes (including cameras, lights); creating a model; creating materials (including custom materials and built-in materials); generating shaders (including vertex shaders, fragment shaders); adding the generated model data to the scene; creating a renderer; and rendering the model.
And branch two: creating a scene; configuring scenes (including cameras, lights); creating a loader; loading a model file; converting the JavaScript-readable JSON format file into a JSON format file, and reading the model file; analyzing the model file to obtain a plurality of model rendering information (such as geometric information, material information, texture maps and animation effects); adding the generated model data to the scene; creating a renderer; and rendering the model.
Js-oriented thinking design based on 3dengin, the modules are rigorous and flexible in structure, decoupling performance among the modules is high, mutual dependence cannot be generated, functions can be simply increased or codes can be simply modified, and the problem that a three-dimensional model is difficult to render by using WebGL without an OpenGL graphic basis is well solved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, an optical disk) and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods of the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for three-dimensional graphics rendering for implementing the above method for three-dimensional graphics rendering. Fig. 4 is a block diagram of an alternative apparatus for three-dimensional graphics rendering according to an embodiment of the present application, and as shown in fig. 4, the apparatus may include:
the configuration module 401 is configured to configure scene information by using a first function method in a target three-dimensional encapsulation library, where the target three-dimensional encapsulation library is obtained by encapsulating a target drawing standard by using JavaScript;
an obtaining module 402, configured to obtain the created initial geometric model and obtain rendering association information;
and a rendering module 403, configured to input the initial geometric model into the scene information, and render the target geometric model by combining the rendering association information.
It should be noted that the configuration module 401 in this embodiment may be configured to execute the step S101, the obtaining module 402 in this embodiment may be configured to execute the step S102, and the rendering module 403 in this embodiment may be configured to execute the step S103
Through the module, the target drawing standard is packaged once by using JavaScript to obtain a target three-dimensional packaging library, so that a three-dimensional model is rendered by using WebGL by using the target three-dimensional packaging library, learning of relevant knowledge such as C language is not needed, 3D development can be performed only by using JavaScript, and a front-end developer with the JavaScript basis can quickly enter the webpage to quickly and immediately display three-dimensional model data on the webpage, so that the development difficulty is reduced, the rendering of the three-dimensional model can be realized only by fewer codes, the research and development period is saved, the working efficiency is improved, and the problems of high development cost, low efficiency and long period in the related technology are solved.
As an alternative embodiment, the obtaining module includes:
the calling unit is used for calling a plurality of component parameter functions in the target drawing standard;
and the generating unit is used for generating an initial geometric body model according to the component parameter function.
As an alternative embodiment, the obtaining module includes:
the first creating unit is used for creating material elements by using a second function method in the target three-dimensional packaging library;
the second creating unit is used for creating the shader by using a third function method in the target three-dimensional packaging library;
a third creating unit, configured to create a renderer by using a fourth function method in the target three-dimensional packaging library;
the first setting unit is used for taking the shader, the material element and the renderer as rendering related information.
As an optional embodiment, the obtaining module further includes:
a fourth creating unit, configured to create a loader by using a fifth function method in the target three-dimensional packaging library;
the reading unit is used for reading the initial geometric body model which is constructed by the modeling software;
and the first loading unit is used for loading the initial geometric body model by using the loader.
As an optional embodiment, the obtaining module further includes:
the second loading unit is used for loading the model file in the initial geometric body model by using the loader;
the conversion unit is used for converting the model file into a JSON file through a JSON conversion function;
the analysis unit is used for analyzing the JSON file to obtain rendering standby parameters contained in the JSON file;
a fifth creating unit, configured to create a renderer by using a fourth function method in the target three-dimensional packaging library;
and the second setting unit is used for taking the rendering standby parameters and the renderer as rendering related information.
As an alternative embodiment, the apparatus further comprises:
and the creating module is used for creating the camera element and the light source element according to the scene information before the initial geometric body model is input into the scene information and the target geometric body model is rendered by combining the rendering correlation information.
As an alternative embodiment, the rendering module comprises:
the adjusting unit is used for adding the initial geometric body model into the scene information, and adjusting the angle and illumination of the initial geometric body model by using the camera element and the light source element to obtain an intermediate geometric body model;
and the rendering unit is used for rendering the intermediate geometric body model by using the renderer to obtain the target geometric body model.
According to another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the method for three-dimensional graphics rendering, where the electronic device may be a server, a terminal, or a combination thereof.
Fig. 5 is a block diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504, where the processor 501, the communication interface 502, and the memory 503 are communicated with each other through the communication bus 504, where,
a memory 503 for storing a computer program;
the processor 501, when executing the computer program stored in the memory 503, implements the following steps:
configuring scene information by using a first function method in a target three-dimensional packaging library, wherein the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript;
acquiring the created initial geometric model and acquiring rendering associated information;
and inputting the initial geometric model into scene information, and rendering the target geometric model by combining rendering association information.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication 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. 5, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The memory may include RAM, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
As an example, as shown in fig. 5, the memory 503 may include, but is not limited to, a configuration module 401, an obtaining module 402, and a rendering module 403 in the three-dimensional graphics rendering apparatus. In addition, the three-dimensional graphics rendering apparatus may further include, but is not limited to, other module units in the three-dimensional graphics rendering apparatus, which are not described in detail in this example.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In addition, the electronic device further includes: and the display is used for displaying the result of the three-dimensional graphic rendering.
Optionally, for a specific example in this embodiment, reference may be made to the example described in the foregoing embodiment, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the device implementing the method for rendering three-dimensional graphics may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 5 is a diagram illustrating a structure of the electronic device. For example, the terminal device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
According to still another aspect of an embodiment of the present application, there is also provided a storage medium. Alternatively, in the present embodiment, the storage medium may be a program code for executing a method of three-dimensional graphics rendering.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
configuring scene information by using a first function method in a target three-dimensional packaging library, wherein the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript;
acquiring the created initial geometric model and rendering associated information;
and inputting the initial geometric model into scene information, and rendering the target geometric model by combining rendering association information.
Optionally, the specific example in this embodiment may refer to the example described in the above embodiment, which is not described again in this embodiment.
Optionally, in this embodiment, the storage medium may include but is not limited to: various media capable of storing program codes, such as a U disk, a ROM, a RAM, a removable hard disk, a magnetic disk, or an optical disk.
According to yet another aspect of an embodiment of the present application, there is also provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium; the processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method steps of three-dimensional graphics rendering in any of the embodiments described above.
The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in the form of a software product, stored in a storage medium, including several instructions for causing one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the method for three-dimensional graphics rendering according to the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, and may also be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method of three-dimensional graphics rendering, the method comprising:
configuring scene information by using a first function method in a target three-dimensional packaging library, wherein the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript;
acquiring the created initial geometric model and acquiring rendering associated information;
and inputting the initial geometric model into the scene information, and rendering a target geometric model by combining the rendering association information.
2. The method of claim 1, wherein the obtaining the created initial geometry model comprises:
calling a plurality of component parameter functions in the target drawing standard;
and generating the initial geometric body model according to the component parameter function.
3. The method of claim 2, wherein the obtaining rendering association information comprises:
creating material elements by using a second function method in the target three-dimensional packaging library;
creating a shader by using a third function method in the target three-dimensional packaging library;
creating a renderer by using a fourth function method in the target three-dimensional packaging library;
and taking the shader, the material element and the renderer as the rendering associated information.
4. The method of claim 1, wherein the obtaining the created initial geometry model further comprises:
creating a loader by using a fifth function method in the target three-dimensional packaging library;
reading the initial geometric body model constructed by modeling software;
and loading the initial geometric body model by using the loader.
5. The method of claim 4, wherein the obtaining rendering association information further comprises:
loading a model file within the initial geometry model with the loader;
converting the model file into a JSON file through a JSON conversion function;
analyzing the JSON file to obtain rendering standby parameters contained in the JSON file;
creating a renderer by using a fourth function method in the target three-dimensional packaging library;
and using the rendering standby parameters and the renderer as the rendering associated information.
6. The method according to claim 1, wherein before the inputting the initial geometric model into the scene information and rendering a target geometric model in combination with the rendering correlation information, the method further comprises:
and creating a camera element and a light source element according to the scene information.
7. The method of claim 6, wherein the inputting the initial geometric model into the scene information and rendering a target geometric model in combination with the rendering association information comprises:
adding the initial geometric model into the scene information, and adjusting the angle and illumination of the initial geometric model by using the camera element and the light source element to obtain an intermediate geometric model;
and rendering the intermediate geometric model by using a renderer to obtain the target geometric model.
8. An apparatus for three-dimensional graphics rendering, the apparatus comprising:
the system comprises a configuration module, a first function method and a second function method, wherein the configuration module is used for configuring scene information by utilizing a first function method in a target three-dimensional packaging library, and the target three-dimensional packaging library is obtained by packaging a target drawing standard by using JavaScript;
the acquisition module is used for acquiring the created initial geometric body model and acquiring rendering correlation information;
and the rendering module is used for inputting the initial geometric model into the scene information and rendering the target geometric model by combining the rendering correlation information.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein said processor, said communication interface and said memory communicate with each other via said communication bus,
the memory for storing a computer program;
the processor for performing the method steps of any one of claims 1 to 7 by running the computer program stored on the memory.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program realizes the method steps of any one of claims 1 to 7 when executed by a processor.
CN202211297305.4A 2022-10-21 2022-10-21 Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium Pending CN115761082A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211297305.4A CN115761082A (en) 2022-10-21 2022-10-21 Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211297305.4A CN115761082A (en) 2022-10-21 2022-10-21 Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN115761082A true CN115761082A (en) 2023-03-07

Family

ID=85352695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211297305.4A Pending CN115761082A (en) 2022-10-21 2022-10-21 Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN115761082A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116912382A (en) * 2023-09-14 2023-10-20 成都帆点创想科技有限公司 Rendering method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787986A (en) * 2016-02-29 2016-07-20 浪潮(苏州)金融技术服务有限公司 Three-dimensional graph rendering method and device
CN109448089A (en) * 2018-10-22 2019-03-08 美宅科技(北京)有限公司 A kind of rendering method and device
CN110910505A (en) * 2019-11-29 2020-03-24 西安建筑科技大学 Accelerated rendering method of scene model
CN113282741A (en) * 2021-03-24 2021-08-20 北京明略软件系统有限公司 Knowledge graph visualization method, device, equipment and computer readable medium
CN114387402A (en) * 2022-01-18 2022-04-22 北京有竹居网络技术有限公司 Virtual reality scene display method and device, electronic equipment and readable storage medium
CN114820968A (en) * 2022-04-28 2022-07-29 美智纵横科技有限责任公司 Three-dimensional visualization method and device, robot, electronic device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787986A (en) * 2016-02-29 2016-07-20 浪潮(苏州)金融技术服务有限公司 Three-dimensional graph rendering method and device
CN109448089A (en) * 2018-10-22 2019-03-08 美宅科技(北京)有限公司 A kind of rendering method and device
CN110910505A (en) * 2019-11-29 2020-03-24 西安建筑科技大学 Accelerated rendering method of scene model
CN113282741A (en) * 2021-03-24 2021-08-20 北京明略软件系统有限公司 Knowledge graph visualization method, device, equipment and computer readable medium
CN114387402A (en) * 2022-01-18 2022-04-22 北京有竹居网络技术有限公司 Virtual reality scene display method and device, electronic equipment and readable storage medium
CN114820968A (en) * 2022-04-28 2022-07-29 美智纵横科技有限责任公司 Three-dimensional visualization method and device, robot, electronic device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
-YANHUI-: "《WebGL笔记_绘制流程以及三维坐标变化(一)》", pages 1 - 3, Retrieved from the Internet <URL:《https://blog.csdn.net/xyh930929/article/details/73106153/》> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116912382A (en) * 2023-09-14 2023-10-20 成都帆点创想科技有限公司 Rendering method and device, electronic equipment and storage medium
CN116912382B (en) * 2023-09-14 2023-12-29 成都帆点创想科技有限公司 Rendering method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
WO2022116759A1 (en) Image rendering method and apparatus, and computer device and storage medium
CN108010112B (en) Animation processing method, device and storage medium
CN107393013B (en) Virtual roaming file generation and display method, device, medium, equipment and system
US20200104970A1 (en) Customizable Render Pipelines using Render Graphs
Anyuru Professional WebGL programming: developing 3D graphics for the Web
US20130063460A1 (en) Visual shader designer
Cozzi et al. OpenGL insights
US11900088B2 (en) Method for generating a binding between a C/C++ library and an interpreted language, and carrying out the method to transform a three- dimensional (3D) model
US11615575B2 (en) Methods and systems for constructing a shader
WO2023197762A1 (en) Image rendering method and apparatus, electronic device, computer-readable storage medium, and computer program product
CN115761082A (en) Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium
Wolff OpenGL 4 Shading Language Cookbook: Build high-quality, real-time 3D graphics with OpenGL 4.6, GLSL 4.6 and C++ 17
CN112423111A (en) Graphic engine and graphic processing method suitable for player
CN113181657B (en) Cross-platform rendering method and device
CN115617337A (en) Target frame based display model method and device, electronic equipment and storage medium
CN111179390A (en) Method and device for efficiently previewing CG assets
CN116503529A (en) Rendering, 3D picture control method, electronic device, and computer-readable storage medium
CN110930499B (en) 3D data processing method and device
CN113989442B (en) Building information model construction method and related device
CN112233159B (en) Texture processing method and device
Stenning Direct3D Rendering Cookbook
Stasik et al. Extensible implementation of reliable pixel art interpolation
CN108876896A (en) Parameterize faceform&#39;s generation method, device, system and storage medium
Снігур et al. Creating a virtual gallery for the presentation of artworks
Kenwright Web Programming Using the WebGPU API

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