CN115861522B - Image rendering method and device - Google Patents

Image rendering method and device Download PDF

Info

Publication number
CN115861522B
CN115861522B CN202310190621.XA CN202310190621A CN115861522B CN 115861522 B CN115861522 B CN 115861522B CN 202310190621 A CN202310190621 A CN 202310190621A CN 115861522 B CN115861522 B CN 115861522B
Authority
CN
China
Prior art keywords
rendering
initial
target
parameters
parameter
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
CN202310190621.XA
Other languages
Chinese (zh)
Other versions
CN115861522A (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.)
Hangzhou Fragment Network Technology Co ltd
Original Assignee
Hangzhou Fragment Network 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 Hangzhou Fragment Network Technology Co ltd filed Critical Hangzhou Fragment Network Technology Co ltd
Priority to CN202310190621.XA priority Critical patent/CN115861522B/en
Publication of CN115861522A publication Critical patent/CN115861522A/en
Application granted granted Critical
Publication of CN115861522B publication Critical patent/CN115861522B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application discloses an image rendering method and device, firstly acquiring an object to be rendered and initial rendering parameters of the object to be rendered which are preconfigured to a webpage end, reserving advantages of convenience in configuration of the webpage end parameters, real-time observability of basic rendering effects and the like by means of the initial rendering parameters preconfigured to the webpage end, and determining target rendering parameters corresponding to the initial rendering parameters by means of a pre-established mapping model, wherein the mapping model is used for representing the corresponding relation between the rendering parameters configured to the webpage end and the rendering parameters configured to a renderer under the condition that the same rendering target is achieved, rendering the object to be rendered by means of the renderer based on the target rendering parameters, and achieving rendering tasks of the object to be rendered by means of the target rendering parameters and the renderer, so that the same rendering purpose as the webpage end can be achieved, and more vivid rendering effects than the webpage end can be obtained.

Description

Image rendering method and device
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image rendering method and apparatus.
Background
Currently, a rendering task of a model to be rendered can be realized by using a webpage end, for example, 3D rendering can be performed on a pre-designed packaging model on a webpage by using a thread technology, and a webpage end rendering mode can provide great convenience for designers.
However, the rendering effect of the rendering map obtained from the web page end is not ideal and can only be used as a demonstration of the rendering effect due to the performance of the web page end.
Disclosure of Invention
In view of the above problems, the present application is provided to provide an image rendering method and apparatus, so as to implement a rendering task of an object to be rendered, and improve fidelity of a rendering effect.
The specific scheme is as follows:
in a first aspect, there is provided an image rendering method, including:
acquiring an object to be rendered and initial rendering parameters of the object to be rendered, which are pre-configured to a webpage end;
determining target rendering parameters corresponding to the initial rendering parameters by using a pre-established mapping model, wherein the mapping model is used for representing the corresponding relation between the rendering parameters configured to the webpage end and the rendering parameters configured to the renderer under the condition that the same rendering target is reached;
And based on the target rendering parameters, rendering the object to be rendered by using the renderer to obtain a rendering graph.
In a second aspect, there is provided an image rendering apparatus including:
the parameter acquisition unit is used for acquiring an object to be rendered and initial rendering parameters of the object to be rendered, which are pre-configured to a webpage end;
a parameter mapping unit, configured to determine a target rendering parameter corresponding to the initial rendering parameter by using a pre-established mapping model, where the mapping model is used to characterize a correspondence between a rendering parameter configured to the web page end and a rendering parameter configured to a renderer when the same rendering target is reached;
and the image rendering unit is used for rendering the object to be rendered by using the renderer based on the target rendering parameter to obtain a rendering chart.
By means of the technical scheme, firstly, the object to be rendered and the initial rendering parameters of the object to be rendered which are pre-configured to the webpage end are obtained, and the advantages of convenience in configuration of the parameters of the webpage end, real-time and considerable basic rendering effect and the like can be reserved by applying the scheme of the application because the initial rendering parameters are pre-configured to the object to be rendered at the webpage end; then, determining target rendering parameters corresponding to the initial rendering parameters by utilizing a pre-established mapping model, wherein the mapping model is used for representing the corresponding relation between the rendering parameters configured to the webpage end and the rendering parameters configured to the renderer under the condition that the same rendering target is reached; and finally, based on the target rendering parameters, the object to be rendered is rendered by using the renderer to obtain a rendering graph, and the target rendering parameters and the renderer are used for rendering tasks, so that the same rendering purpose as that of the webpage end can be achieved, a more vivid rendering effect than that of the webpage end can be obtained, secondary rendering parameter configuration and trial rendering on the renderer are not needed, and the design time is shortened.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
fig. 1 is a schematic flow chart of an image rendering method according to an embodiment of the present application;
FIG. 2 illustrates a schematic diagram of a process for building a mapping model;
FIG. 3 illustrates a rendering diagram derived from a web page end;
FIG. 4 illustrates a rendering graph obtained by a renderer;
fig. 5 is a schematic structural diagram of an image rendering device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an image rendering apparatus according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The image rendering scheme can realize the rendering task of the object to be rendered and improve the fidelity of the rendering effect.
The scheme can be realized based on the terminal with the data processing capability, and the terminal can be a computer, a server, a cloud end and the like.
Fig. 1 is a flowchart of an image rendering method according to an embodiment of the present application, and in conjunction with fig. 1, the image rendering method may include the following steps:
step S101, obtaining an object to be rendered and initial rendering parameters of the object to be rendered, which are pre-configured to a webpage end.
The web page end may refer to a renderer page implemented by depending on a browser, and may be implemented by a 3D technology such as 3D engine thread. And at the webpage end, the initial rendering parameters can be configured according to the rendering target, and the object to be rendered can be rendered by utilizing the configured webpage end, so that a webpage end rendering diagram of the object to be rendered is obtained.
Step S102, determining target rendering parameters corresponding to the initial rendering parameters by utilizing a pre-established mapping model.
The mapping model may be used to characterize a correspondence between rendering parameters configured to the web page end and rendering parameters configured to a renderer when the same rendering target is reached, and the mapping model may include mapping models of a plurality of different types of rendering parameters. It should be noted that, the rendering target may refer to a desired rendering effect, and the renderer is different from the web page end, and refers to rendering software or a renderer plug-in configured in the graphics image processing software.
And step S103, based on the target rendering parameters, rendering the object to be rendered by using the renderer to obtain a rendering chart.
Specifically, the target rendering parameters may be configured to the renderer, and then the object to be rendered is rendered by using the configured renderer.
According to the image rendering method, firstly, the object to be rendered and the initial rendering parameters of the object to be rendered which are pre-configured to the webpage end are obtained, and the advantages of convenience in configuration of the parameters of the webpage end, real-time and considerable basic rendering effect and the like can be reserved by applying the scheme of the application because the initial rendering parameters are pre-configured to the object to be rendered at the webpage end; then, determining target rendering parameters corresponding to the initial rendering parameters by utilizing a pre-established mapping model, wherein the mapping model is used for representing the corresponding relation between the rendering parameters configured to the webpage end and the rendering parameters configured to the renderer under the condition that the same rendering target is reached; and finally, based on the target rendering parameters, the object to be rendered is rendered by using the renderer to obtain a rendering graph, and the target rendering parameters and the renderer are used for rendering tasks, so that the same rendering purpose as that of the webpage end can be achieved, a more vivid rendering effect than that of the webpage end can be obtained, secondary rendering parameter configuration and trial rendering on the renderer are not needed, and the design time can be shortened.
The process of establishing the mapping model is described below. Fig. 2 illustrates a schematic diagram of the mapping model building process. As shown in connection with fig. 2, the mapping model building process may include the following steps:
and step S01, configuring a first rendering parameter to the webpage end, and rendering the historical object by using the configured webpage end to obtain a first rendering effect corresponding to the first rendering parameter.
It should be noted that, the history object is different from the object to be rendered, and steps S01-S04 correspond to all the historic processes.
And step S02, adjusting a second rendering parameter configured to the renderer, and rendering the historical object by using the configured renderer until a second rendering effect matched with the first rendering effect is obtained.
It should be noted that, the first rendering effect and the second rendering effect are both represented by the finally output rendering graph, and the matching of the first rendering effect and the second rendering effect may mean that the two rendering effects have the same rendering target or are called as the desired rendering effect, and in addition, the first rendering effect, the second rendering effect and the desired rendering effect may not be completely the same, but have higher similarity.
Step S03, determining a second rendering parameter corresponding to the second rendering effect as a mapping target of the first rendering parameter.
The steps S01-S03 are repeatedly executed on the first rendering parameters with different values, so that a plurality of groups of first rendering parameters with different values and corresponding mapping targets can be obtained.
Step S04, the mapping model is built according to a plurality of groups of first rendering parameters with different values and corresponding mapping targets.
In addition, in the process of establishing the mapping model, actual experience can be considered to simplify the modeling process, and by way of example, given that the effect B can be achieved by configuring the parameter a at the web page end and the effect B can be achieved by configuring the parameter C at the renderer, two objects establishing the mapping relationship can be determined as the parameter a and the parameter C, and the parameters of the renderer corresponding to the effect B do not need to be determined by adjusting the parameter type.
In some embodiments provided herein, the renderer may comprise a renderer in a three-dimensional graphics image software renderer, such as a cycles renderer, and the initial rendering parameters may include initial compatibility parameters and initial incompatibility parameters.
It should be noted that, the compatible parameter refers to a parameter that the renderer can identify from the web page end, rather than a parameter with the same value, the renderer and the web page end process the same compatible parameter, so as to achieve the same rendering objective, and specifically, the identified object of the renderer may be the model to be rendered of the object to be rendered derived from the web page end. Correspondingly, the incompatible parameters refer to parameters which cannot be identified by the renderer from the webpage end, and each incompatible parameter needs to be configured to the renderer independently through parameter assignment and the like.
On the basis of the above, the determining, in step S102, the target rendering parameter corresponding to the initial rendering parameter by using the pre-established mapping model may include the following steps:
step one, determining the initial compatibility parameter as a target compatibility parameter.
And step two, determining target incompatible parameters corresponding to the initial incompatible parameters by utilizing a pre-established mapping model.
It should be noted that, the target rendering parameter is formed by the target compatible parameter and the target incompatible parameter.
In a possible implementation manner, the step S103, based on the target rendering parameter, of rendering the object to be rendered by using the renderer may include the following steps a to D:
and step A, generating a 3D model to be rendered by utilizing the webpage end according to the object to be rendered and the initial rendering parameters.
It should be noted that the 3D model to be rendered may include the initial rendering parameters. In addition, the object to be rendered may be represented in the form of an object parameter, and, for example, assuming that the object to be rendered is a packaging model designed on a web page in advance, the packaging model may be represented by a model parameter of the packaging model, and then a rendering task for rendering on the web page end is generated by using the model parameter and the initial rendering parameter. For example, for a renderer that is native to the three-dimensional graphics image software renderer, the 3D model to be rendered may be a glb format file.
And B, importing the 3D model to be rendered to the renderer.
It should be noted that, after receiving the 3D model to be rendered, the renderer reads the 3D model to be rendered, specifically, reads the model parameters and the initial rendering parameters of the 3D model to be rendered, but because the rendering parameters are not completely compatible with the renderer at the web page end, the renderer can only identify the initial compatible parameters in the initial rendering parameters, and according to the first step, the initial compatible parameters are the target compatible parameters, so that the renderer can read the target compatible parameters and configure the target compatible parameters to the renderer, thereby realizing batch configuration of the target compatible parameters.
And C, configuring the target incompatibility parameters to the renderer.
It should be noted that, since the renderer cannot acquire the target incompatible parameters by identifying the 3D model, the target incompatible parameters may be configured separately.
And D, rendering the 3D model to be rendered by using the configured renderer.
Optionally, considering the limitation of computer computing power on webpage end rendering, for the step one, a server may be used to generate the 3D model to be rendered, specifically, a rendering task may be generated by the object to be rendered and the initial rendering parameter, and then the rendering task is output to the server, so that the server uses the webpage end or browser running on the server to generate the 3D model to be rendered of the object to be rendered, and the generated 3D model to be rendered is exported to an offline file that can be identified by a renderer, and stored locally. It should be noted that, the 3D model generated by the above process is consistent with the 3D model generated directly by using the web page running on the designer's computer, but the above process can break through the limitation of computer computing power by means of computing power of the server, and can increase the speed of generating the 3D model.
In some embodiments provided herein, the initial compatibility parameters may include initial texture parameters for characterizing a physical-based texture.
The physical-based material refers to a material in a physical-based rendering (Physically Based Rendering, PBR) standard, and specifically, a three-dimensional graphics image software renderer and a renderer therein, such as a cycles renderer, can identify the material of the PBR standard, i.e. can be compatible with rendering parameters for representing the material of the PBR standard, but cannot be compatible with rendering parameters such as light, ambient light, glass effects, and the like.
In some embodiments provided herein, the initial incompatible parameters may include initial coordinates of a pixel point in the object to be rendered in a web page end coordinate system, an initial image size of the object to be rendered, and an initial effect parameter of a web page end corresponding to the rendering effect.
Correspondingly, the mapping model may include a mapping relation of coordinates of pixel points in the object to be rendered in a web page end coordinate system and a renderer coordinate system, a mapping relation of image sizes configured to the web page end and the renderer, and a mapping relation of effect parameters corresponding to rendering effects configured to the web page end and the renderer.
Based on the above, the determining, by using a pre-established mapping model, the target incompatible parameter corresponding to the initial incompatible parameter may include steps E to G:
and E, mapping initial coordinates of the pixel points in the object to be rendered in a webpage end coordinate system according to the mapping relation of the coordinates to obtain target coordinates of the pixel points in the object to be rendered in a renderer coordinate system.
The initial coordinates of the pixel points in the webpage end coordinate system are (x, y, z), the coordinates of the pixel points in the three-dimensional graphics image software blender are (x, -z, y), and it is required to be explained that the coordinates of the pixel points in the coordinate systems of the renderers configured by the three-dimensional graphics image software blender are consistent with the coordinates of the pixel points in the three-dimensional graphics image software blender. Therefore, in order to achieve the same rendering target at any renderer configured by the webpage end and the three-dimensional graphic image software renderer, mapping transformation can be performed on the initial coordinates according to the mapping relation of the coordinates in the pre-established mapping model.
It should be noted that, the target coordinates of the camera may be determined according to a mapping relationship of the coordinates established in advance, and then the camera coordinates of the renderer may be set through the command line, so as to implement parameter mapping of the camera parameters in the web page end and the renderer.
And F, determining the initial image size of the object to be rendered as a target image size according to the mapping relation of the image sizes.
In one possible implementation, the image size of the renderer may be configured to the target image size by executing a code command.
And G, mapping the initial effect parameters of the webpage end corresponding to the rendering effect according to the mapping relation of the effect parameters to obtain the target effect parameters of the renderer corresponding to the rendering effect.
Wherein, from the target coordinates, the target image size, and the target effect parameter, a target incompatibility parameter may be constituted.
The following illustrates rendering effects that may be achieved by the scheme of the present application.
In some embodiments provided herein, the initial effect parameter of the web page end corresponding to the rendering effect may include at least one of an initial light effect parameter, an initial glass effect parameter, an initial varnish effect parameter, an initial ambient light effect parameter, an initial concave-convex effect parameter, and an initial gold-stamping and silver-stamping effect parameter of the web page end.
Correspondingly, the mapping relation of the effect parameters can comprise the mapping relation of the light effect parameters, the mapping relation of the glass effect parameters, the mapping relation of the varnish effect parameters, the mapping relation of the ambient light effect parameters, the mapping relation of the concave-convex effect parameters and the mapping relation of the gold and silver stamping effect parameters.
Next, each effect parameter will be described one by one.
A first part, a light effect parameter.
It should be noted that, the calculation modes of the webpage end and the renderer for the light are different, if the light effect parameter of the webpage end is directly configured to the renderer, a rendering chart with a great difference between the light intensity and the brightness of the rendering chart of the webpage end may be rendered, so that mapping transformation needs to be performed on the light effect parameter to achieve the same rendering target.
Specifically, in the step G, the process of obtaining the target light effect parameter may include:
and mapping the initial light effect parameters by using the mapping relation of the light effect parameters to obtain target light effect parameters.
Specifically, the mapping relationship of the light effect parameters may be a linear mapping relationship. The light effect parameters may include light intensity, light color, a degree of change of light intensity with distance, a degree of shadow blurring affected by light, and the like, and each light effect parameter may be adjusted one by one to establish a corresponding mapping relationship. Taking light intensity as an example, the process of establishing the mapping relation of light intensity may include: under the condition that the initial light intensity pre-configured to the webpage end is 1, adjusting the light intensity value configured to the renderer until the rendering image of the renderer consistent with the brightness effect of the rendering image of the webpage end is obtained, determining the light intensity value at the moment as a mapping target corresponding to the initial light intensity with the value of 1, and obtaining a plurality of groups of initial light intensities with different values and corresponding mapping targets according to the method, so that the mapping relation of the light intensities can be established.
And a second part, glass effect parameters.
It should be noted that, the web page end and the renderer may implement a glass effect by configuring different parameters, which may be referred to as a glass attribute, and, for example, in the three-dimensional graphics image software renderer, light transmittance (transmission) is used to implement the glass effect. The process of obtaining the target glass effect parameters and the process of establishing the mapping relationship of the glass effect parameters can be described with reference to the above.
Third part, varnish effect parameters.
The varnish effect is called varnish intensity (clearcoat), which is characterized by the rendering effect of a thin layer of semitransparent material on the surface of an object, and the webpage end and the renderer can realize the varnish effect by configuring different parameters. The process of obtaining the target varnish effect parameters and the process of establishing the mapping relationship of the varnish effect parameters can be described with reference to the above.
And a fourth part, ambient light effect parameters.
In particular, the ambient light effect parameters may be divided into an ambient light map and an ambient light intensity, that is, the initial ambient light effect parameters may comprise an initial ambient map and an initial ambient light intensity.
On the basis of the above, if the initial effect parameter of the web page end corresponding to the rendering effect includes the initial ambient light effect parameter, the process of obtaining the target ambient light effect parameter in the step G may include a step H and a step I:
and step H, determining the initial environment map as a target environment map according to the mapping relation of the environment light effect parameters.
And step I, mapping the initial ambient light intensity by using the mapping relation of the ambient light effect parameters to obtain target ambient light intensity.
And forming a target environment light effect parameter by the target environment map and the target environment light intensity. The process of establishing the mapping relation of the ambient light intensity in the mapping relation of the ambient light effect parameters can be expressed by referring to the above.
Fifth part, concave-convex effect parameters.
The concave-convex effect parameter refers to an effect parameter corresponding to a local concave-convex effect. Next, a mapping process of the concave-convex effect parameter is described by taking a cycles renderer in the three-dimensional graphics image software renderer as an example, where the initial concave-convex effect parameter may include an initial normal map and a parameter for characterizing a normal influence degree.
On the basis of the above, in the step G, the process of obtaining the target concave-convex effect parameter may include a step J and a step K:
and J, determining the initial normal map as a target normal map according to the mapping relation of the concave-convex effect parameters.
And step K, processing the initial concave-convex effect parameters by using the mapping relation of the concave-convex effect parameters to generate a target replacement map.
And forming a target concave-convex effect parameter by the target normal map and the target replacement map.
It should be noted that, the web page end visually realizes the local concave-convex effect through the normal map and the parameter for representing the normal influence degree, and does not change the object to be rendered, the renderer in the three-dimensional graphics image software blender needs to use the normal map and the displacement map in order to realize more lifelike concave-convex effect, the displacement map is generated according to the initial concave-convex effect parameter, the displacement map can represent concave-convex peaks of the object to be rendered, the three-dimensional graphics image software blender can judge concave-convex by identifying the color depth, in particular, the displacement map can use a gray bottom to deepen the color at the position needing to be protruded, and weaken the color at the position needing to be recessed. By means of the replacement mapping and the normal mapping, the object to be rendered can truly have concave and convex, and a rendering map with more vivid concave and convex effects is obtained.
And a sixth part, gilding and silver-ironing effect parameters.
The gold stamping and silver stamping effect parameters are the effect parameters corresponding to the local gold stamping and silver stamping effect. Next, a mapping process of the gilding and silver-ironing effect parameters, which may include an initial roughness map and an initial metallization map, is described by taking a cycles renderer in a three-dimensional graphics image software renderer as an example.
On the basis of the above, in the step G, the process of obtaining the target gilt and silver effect parameter may include:
and determining the initial roughness map as a target metallization map according to the mapping relation of the gold and silver stamping effect parameters, and determining the initial metallization map as the target roughness map.
And forming target gold and silver stamping effect parameters by the target metaliness map and the target roughness map. It should be noted that, the renderers in the webpage end and the three-dimensional graphic image software blender realize the local gold stamping and silver stamping effect through the metallization degree mapping and the roughness mapping, but the three-dimensional graphic image software blender and the webpage end have different color identification, and the study finds that the parameter-exchanged metallization degree mapping and the roughness mapping are configured to the renderers in the three-dimensional graphic image software blender, so that the same rendering target corresponding to the gold stamping and silver stamping effect as the webpage end can be achieved.
It should be noted that, for the above-mentioned operation of determining a certain initial parameter as a corresponding target parameter, the implementation basis is the mapping model, and the mapping model of such a parameter may be represented by a form in which a dependent variable is equal to an independent variable.
Exemplary, based on initial rendering parameters, the object to be rendered is rendered by using a webpage end, the obtained rendering graph is shown in fig. 3, and by applying the scheme of the application, the object to be rendered is rendered by using a cycles renderer in a three-dimensional graphic image software browser according to the target rendering parameters corresponding to the initial rendering parameters, and the obtained rendering graph is shown in fig. 4. Comparing fig. 3 and fig. 4, it can be seen that by means of the present application, a more realistic rendering effect can be achieved, for example, as shown by the spherical balls in fig. 3 and fig. 4, a more realistic glass effect is achieved by the present application, as shown by the shadow cast by the long rod on the wall surface and the reflection cast by other objects on the cuboid platform in fig. 3 and fig. 4, and a more realistic shadow effect is achieved by the present application. It should be noted that, in an actual scene, an object to be rendered is usually an RGB image, and the image feature richness of the RGB image is greater than that of a gray image, and by applying the scheme of the present application to process the RGB image, the obtained rendering image can display more abundant image features than the gray image, and display more lifelike rendering effects.
The image rendering device provided in the embodiments of the present application will be described below, and the image rendering device described below and the image rendering method described above may be referred to correspondingly to each other.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an image rendering device according to an embodiment of the present application.
As shown in fig. 5, the apparatus may include:
the parameter obtaining unit 11 is configured to obtain an object to be rendered and an initial rendering parameter of the object to be rendered that is preconfigured to a web page end.
And a parameter mapping unit 12, configured to determine a target rendering parameter corresponding to the initial rendering parameter by using a pre-established mapping model, where the mapping model is used to characterize a correspondence between a rendering parameter configured to the web page end and a rendering parameter configured to a renderer when the same rendering target is reached.
And the image rendering unit 13 is used for rendering the object to be rendered by using the renderer based on the target rendering parameter to obtain a rendering chart.
In some embodiments provided herein, the initial rendering parameters may include initial compatibility parameters and initial incompatibility parameters.
On the basis of the above, the process of determining the target rendering parameter corresponding to the initial rendering parameter by the parameter mapping unit 12 using a pre-established mapping model may include:
Determining the initial compatibility parameter as a target compatibility parameter;
and determining target incompatible parameters corresponding to the initial incompatible parameters by utilizing a pre-established mapping model, and forming target rendering parameters by the target compatible parameters and the target incompatible parameters.
In some embodiments provided herein, the process of rendering the object to be rendered by the image rendering unit 13 using the renderer based on the target rendering parameter may include:
generating a 3D model to be rendered by utilizing the webpage end according to the object to be rendered and the initial rendering parameter, wherein the 3D model to be rendered comprises the initial rendering parameter;
importing the 3D model to be rendered into the renderer, so that the renderer can read the 3D model to be rendered and target compatible parameters in the 3D model to be rendered, and configuring the target compatible parameters to the renderer;
configuring the target incompatibility parameter to the renderer;
and rendering the 3D model to be rendered by using the configured renderer.
In some embodiments provided herein, the renderer may comprise a renderer in a three-dimensional graphics image software renderer, and the initial compatibility parameters may comprise initial texture parameters for characterizing a physical-based texture.
In some embodiments provided herein, the initial incompatible parameters may include initial coordinates of a pixel point in the object to be rendered in a web page end coordinate system, an initial image size of the object to be rendered, and an initial effect parameter of a web page end corresponding to the rendering effect.
On the basis of the above, the process of determining the target incompatible parameter corresponding to the initial incompatible parameter by the parameter mapping unit 12 using the pre-established mapping model may include:
mapping initial coordinates of the pixel points in the object to be rendered in a webpage end coordinate system by utilizing a pre-established mapping model to obtain target coordinates of the pixel points in the object to be rendered in a renderer coordinate system;
determining the initial image size of the object to be rendered as a target image size;
mapping the initial effect parameters of the webpage end corresponding to the rendering effect by using the mapping model to obtain target effect parameters of the renderer corresponding to the rendering effect;
and forming target incompatible parameters by the target coordinates, the target image size and the target effect parameters.
In some embodiments provided herein, the initial effect parameter of the web page end corresponding to the rendering effect may include at least one of an initial light effect parameter, an initial glass effect parameter, an initial varnish effect parameter, an initial ambient light effect parameter, an initial concave-convex effect parameter, and an initial gold-stamping and silver-stamping effect parameter of the web page end.
Optionally, the initial ambient light effect parameter may include an initial ambient map and an initial ambient light intensity.
On the basis of the above, if the initial effect parameter of the web page end corresponding to the rendering effect includes the initial ambient light effect parameter, the process of mapping the initial effect parameter of the web page end corresponding to the rendering effect by the parameter mapping unit 12 using the mapping model to obtain the target effect parameter of the renderer corresponding to the rendering effect may include:
determining the initial environmental map as a target environmental map;
and mapping the initial ambient light intensity by using the mapping model to obtain target ambient light intensity, wherein the target ambient light effect parameter is formed by the target ambient map and the target ambient light intensity.
Optionally, the initial concave-convex effect parameter may include an initial normal map and a parameter for characterizing a degree of normal influence.
On the basis of the above, if the initial effect parameter of the web page end corresponding to the rendering effect includes an initial concave-convex effect parameter of the web page end corresponding to the local concave-convex effect, the process of mapping the initial effect parameter of the web page end corresponding to the rendering effect by the parameter mapping unit 12 using the mapping model to obtain the target effect parameter of the renderer corresponding to the rendering effect may include:
Determining the initial normal map as a target normal map;
and processing the initial concave-convex effect parameters by using the mapping model to generate a target replacement map, wherein the target normal map and the target replacement map form target concave-convex effect parameters of a renderer corresponding to the local concave-convex effect.
Optionally, the initial gilding and silvering effect parameters may include an initial roughness map and an initial metallicity map.
On the basis of the above, if the initial effect parameter of the web page end corresponding to the rendering effect includes an initial gold and silver effect parameter of the web page end corresponding to the local gold and silver effect, the process of mapping, by the parameter mapping unit 12, the initial effect parameter of the web page end corresponding to the rendering effect to obtain the target effect parameter of the renderer corresponding to the rendering effect by using the mapping model may include:
determining the initial roughness map as a target metallization map and determining the initial metallization map as a target roughness map based on a mapping relation of gold stamping and silver stamping effect parameters corresponding to local gold stamping and silver stamping effects, which are represented by the mapping model;
And forming target gold and silver stamping effect parameters of a renderer corresponding to the local gold and silver stamping effect by the target metalness map and the target roughness map.
In some embodiments provided herein, the process of establishing the mapping model may include:
for a historical object, configuring a first rendering parameter to the webpage end, and rendering the historical object by using the configured webpage end to obtain a first rendering effect corresponding to the first rendering parameter;
adjusting a second rendering parameter configured for the renderer, and rendering the historical object by using the configured renderer until a second rendering effect matched with the first rendering effect is obtained;
determining a second rendering parameter corresponding to the second rendering effect as a mapping target of the first rendering parameter;
and establishing the mapping model according to a plurality of groups of first rendering parameters with different values and corresponding mapping targets.
The image rendering device provided by the embodiment of the application can be applied to image rendering equipment, such as a terminal: cell phones, computers, etc. Alternatively, fig. 6 shows a block diagram of a hardware structure of the image rendering apparatus, and referring to fig. 6, the hardware structure of the image rendering apparatus may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
In the embodiment of the application, the number of the processor 1, the communication interface 2, the memory 3 and the communication bus 4 is at least one, and the processor 1, the communication interface 2 and the memory 3 complete communication with each other through the communication bus 4;
processor 1 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention, etc.;
the memory 3 may comprise a high-speed RAM memory, and may further comprise a non-volatile memory (non-volatile memory) or the like, such as at least one magnetic disk memory;
wherein the memory stores a program, the processor is operable to invoke the program stored in the memory, the program operable to:
acquiring an object to be rendered and initial rendering parameters of the object to be rendered, which are pre-configured to a webpage end;
determining target rendering parameters corresponding to the initial rendering parameters by using a pre-established mapping model, wherein the mapping model is used for representing the corresponding relation between the rendering parameters configured to the webpage end and the rendering parameters configured to the renderer under the condition that the same rendering target is reached;
And based on the target rendering parameters, rendering the object to be rendered by using the renderer to obtain a rendering graph.
Alternatively, the refinement function and the extension function of the program may be described with reference to the above.
The embodiment of the application also provides a storage medium, which may store a program adapted to be executed by a processor, the program being configured to:
acquiring an object to be rendered and initial rendering parameters of the object to be rendered, which are pre-configured to a webpage end;
determining target rendering parameters corresponding to the initial rendering parameters by using a pre-established mapping model, wherein the mapping model is used for representing the corresponding relation between the rendering parameters configured to the webpage end and the rendering parameters configured to the renderer under the condition that the same rendering target is reached;
and based on the target rendering parameters, rendering the object to be rendered by using the renderer to obtain a rendering graph.
Alternatively, the refinement function and the extension function of the program may be described with reference to the above.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the present specification, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and may be combined according to needs, and the same similar parts may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. An image rendering method, comprising:
acquiring an object to be rendered and initial rendering parameters of the object to be rendered, which are pre-configured to a webpage end;
determining target rendering parameters corresponding to the initial rendering parameters by using a pre-established mapping model, wherein the mapping model is used for representing the corresponding relation between the rendering parameters configured to the webpage end and the rendering parameters configured to the renderer under the condition that the same rendering target is reached;
Based on the target rendering parameters, rendering the object to be rendered by using the renderer to obtain a rendering chart;
the renderer comprises a renderer in a three-dimensional graphic image software renderer, and the initial rendering parameters comprise initial compatibility parameters and initial incompatibility parameters; the initial compatibility parameters comprise initial material parameters for representing physical-based materials, and the initial incompatibility parameters comprise initial coordinates of pixel points in an object to be rendered in a webpage end coordinate system, initial image sizes of the object to be rendered and initial effect parameters of a webpage end corresponding to a rendering effect;
the determining, by using a pre-established mapping model, a target rendering parameter corresponding to the initial rendering parameter includes:
determining the initial compatibility parameter as a target compatibility parameter;
determining a target incompatible parameter corresponding to the initial incompatible parameter by utilizing a pre-established mapping model, and forming a target rendering parameter by the target compatible parameter and the target incompatible parameter;
the rendering the object to be rendered by the renderer based on the target rendering parameter comprises:
generating a 3D model to be rendered by utilizing the webpage end according to the object to be rendered and the initial rendering parameter, wherein the 3D model to be rendered comprises the initial rendering parameter;
Importing the 3D model to be rendered into the renderer, so that the renderer can read the 3D model to be rendered and target compatible parameters in the 3D model to be rendered, and configuring the target compatible parameters to the renderer;
configuring the target incompatibility parameter to the renderer;
and rendering the 3D model to be rendered by using the configured renderer.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the determining, by using a pre-established mapping model, a target incompatibility parameter corresponding to the initial incompatibility parameter includes:
mapping initial coordinates of the pixel points in the object to be rendered in a webpage end coordinate system by utilizing a pre-established mapping model to obtain target coordinates of the pixel points in the object to be rendered in a renderer coordinate system;
determining the initial image size of the object to be rendered as a target image size;
mapping the initial effect parameters of the webpage end corresponding to the rendering effect by using the mapping model to obtain target effect parameters of the renderer corresponding to the rendering effect;
and forming target incompatible parameters by the target coordinates, the target image size and the target effect parameters.
3. The method of claim 2, wherein the initial effect parameter of the web page end corresponding to the rendering effect includes at least one of an initial lighting effect parameter, an initial glass effect parameter, an initial varnish effect parameter, an initial ambient light effect parameter, an initial concave-convex effect parameter, and an initial bronzing and silvering effect parameter of the web page end.
4. A method according to claim 3, wherein the initial ambient light effect parameters comprise an initial ambient map and an initial ambient light intensity;
under the condition that the initial effect parameters of the webpage end corresponding to the rendering effect comprise the initial ambient light effect parameters, mapping the initial effect parameters of the webpage end corresponding to the rendering effect by using the mapping model to obtain target effect parameters of a renderer corresponding to the rendering effect, wherein the method comprises the following steps:
determining the initial environmental map as a target environmental map;
and mapping the initial ambient light intensity by using the mapping model to obtain target ambient light intensity, wherein the target ambient light effect parameter is formed by the target ambient map and the target ambient light intensity.
5. A method according to claim 3, wherein the initial relief effect parameters include an initial normal map and parameters for characterizing the extent of normal influence;
Under the condition that the initial effect parameters of the webpage end corresponding to the rendering effect comprise initial concave-convex effect parameters of the webpage end corresponding to the local concave-convex effect, mapping the initial effect parameters of the webpage end corresponding to the rendering effect by using the mapping model to obtain target effect parameters of a renderer corresponding to the rendering effect, wherein the method comprises the following steps:
determining the initial normal map as a target normal map;
and processing the initial concave-convex effect parameters by using the mapping model to generate a target replacement map, wherein the target normal map and the target replacement map form target concave-convex effect parameters of a renderer corresponding to the local concave-convex effect.
6. A method according to claim 3, wherein the initial gilding silver effect parameters include an initial roughness map and an initial metallicity map;
under the condition that the initial effect parameters of the webpage end corresponding to the rendering effect comprise initial gold stamping and silver stamping effect parameters of the webpage end corresponding to the local gold stamping and silver stamping effect, mapping the initial effect parameters of the webpage end corresponding to the rendering effect by using the mapping model to obtain target effect parameters of a renderer corresponding to the rendering effect, wherein the method comprises the following steps:
Determining the initial roughness map as a target metallization map and determining the initial metallization map as a target roughness map based on a mapping relation of gold stamping and silver stamping effect parameters corresponding to local gold stamping and silver stamping effects, which are represented by the mapping model;
and forming target gold and silver stamping effect parameters of a renderer corresponding to the local gold and silver stamping effect by the target metalness map and the target roughness map.
7. The method according to any one of claims 1-6, wherein the mapping model building process comprises:
for a historical object, configuring a first rendering parameter to the webpage end, and rendering the historical object by using the configured webpage end to obtain a first rendering effect corresponding to the first rendering parameter;
adjusting a second rendering parameter configured for the renderer, and rendering the historical object by using the configured renderer until a second rendering effect matched with the first rendering effect is obtained;
determining a second rendering parameter corresponding to the second rendering effect as a mapping target of the first rendering parameter;
and establishing the mapping model according to a plurality of groups of first rendering parameters with different values and corresponding mapping targets.
8. An image rendering apparatus, comprising:
the parameter acquisition unit is used for acquiring an object to be rendered and initial rendering parameters of the object to be rendered, which are pre-configured to a webpage end;
a parameter mapping unit, configured to determine a target rendering parameter corresponding to the initial rendering parameter by using a pre-established mapping model, where the mapping model is used to characterize a correspondence between a rendering parameter configured to the web page end and a rendering parameter configured to a renderer when the same rendering target is reached;
the image rendering unit is used for rendering the object to be rendered by using the renderer based on the target rendering parameter to obtain a rendering chart;
the renderer comprises a renderer in a three-dimensional graphic image software renderer, and the initial rendering parameters comprise initial compatibility parameters and initial incompatibility parameters; the initial compatibility parameters comprise initial material parameters for representing physical-based materials, and the initial incompatibility parameters comprise initial coordinates of pixel points in an object to be rendered in a webpage end coordinate system, initial image sizes of the object to be rendered and initial effect parameters of a webpage end corresponding to a rendering effect;
The parameter mapping unit determines a target rendering parameter corresponding to the initial rendering parameter by using a pre-established mapping model, and the parameter mapping unit comprises:
determining the initial compatibility parameter as a target compatibility parameter;
determining a target incompatible parameter corresponding to the initial incompatible parameter by utilizing a pre-established mapping model, and forming a target rendering parameter by the target compatible parameter and the target incompatible parameter;
the image rendering unit renders the object to be rendered by using the renderer based on the target rendering parameter, and the image rendering unit comprises:
generating a 3D model to be rendered by utilizing the webpage end according to the object to be rendered and the initial rendering parameter, wherein the 3D model to be rendered comprises the initial rendering parameter;
importing the 3D model to be rendered into the renderer, so that the renderer can read the 3D model to be rendered and target compatible parameters in the 3D model to be rendered, and configuring the target compatible parameters to the renderer;
configuring the target incompatibility parameter to the renderer;
and rendering the 3D model to be rendered by using the configured renderer.
CN202310190621.XA 2023-03-02 2023-03-02 Image rendering method and device Active CN115861522B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310190621.XA CN115861522B (en) 2023-03-02 2023-03-02 Image rendering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310190621.XA CN115861522B (en) 2023-03-02 2023-03-02 Image rendering method and device

Publications (2)

Publication Number Publication Date
CN115861522A CN115861522A (en) 2023-03-28
CN115861522B true CN115861522B (en) 2023-05-30

Family

ID=85659737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310190621.XA Active CN115861522B (en) 2023-03-02 2023-03-02 Image rendering method and device

Country Status (1)

Country Link
CN (1) CN115861522B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116091684B (en) * 2023-04-06 2023-07-07 杭州片段网络科技有限公司 WebGL-based image rendering method, device, equipment and storage medium
CN116421970B (en) * 2023-06-12 2023-12-05 腾讯科技(深圳)有限公司 Method, device, computer equipment and storage medium for externally-installed rendering of virtual object
CN117274511B (en) * 2023-11-22 2024-03-12 大家智合(北京)网络科技股份有限公司 Box-type 3D preview system and method in packaging field

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112652044A (en) * 2021-01-05 2021-04-13 网易(杭州)网络有限公司 Particle special effect rendering method, device and equipment and storage medium
CN113805966A (en) * 2021-09-15 2021-12-17 上海得帆信息技术有限公司 Multi-terminal device dynamic view rendering implementation method and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8239749B2 (en) * 2004-06-25 2012-08-07 Apple Inc. Procedurally expressing graphic objects for web pages
US8368705B2 (en) * 2008-07-16 2013-02-05 Google Inc. Web-based graphics rendering system
US10467820B2 (en) * 2018-01-24 2019-11-05 Google Llc Image style transfer for three-dimensional models
CN109395384A (en) * 2018-09-12 2019-03-01 Oppo广东移动通信有限公司 Game rendering method and Related product
CN110363839B (en) * 2019-06-19 2023-08-11 深圳市彬讯科技有限公司 Model rendering method, device, computer equipment and storage medium
CN113327316A (en) * 2021-06-30 2021-08-31 联想(北京)有限公司 Image processing method, device, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112652044A (en) * 2021-01-05 2021-04-13 网易(杭州)网络有限公司 Particle special effect rendering method, device and equipment and storage medium
CN113805966A (en) * 2021-09-15 2021-12-17 上海得帆信息技术有限公司 Multi-terminal device dynamic view rendering implementation method and system

Also Published As

Publication number Publication date
CN115861522A (en) 2023-03-28

Similar Documents

Publication Publication Date Title
CN115861522B (en) Image rendering method and device
CN109427088B (en) Rendering method for simulating illumination and terminal
CN110533707B (en) Illumination estimation
KR100914846B1 (en) Method and system for texturing of 3d model in 2d environment
CN108230435B (en) Graphics processing using cube map textures
CN114820905A (en) Virtual image generation method and device, electronic equipment and readable storage medium
CN115345980A (en) Generation method and device of personalized texture map
WO2017123163A1 (en) Improvements in or relating to the generation of three dimensional geometries of an object
CN111986303A (en) Fluid rendering method and device, storage medium and terminal equipment
CN102117491A (en) Texture data drawing method and device in three-dimensional modeling
CN112115954B (en) Feature extraction method and device, machine readable medium and equipment
CN115965735B (en) Texture map generation method and device
US10754498B2 (en) Hybrid image rendering system
CN111563963A (en) Tornado weather simulation method, intelligent terminal and storage medium
KR20210075379A (en) Apparatus and method for crreating volumetric video
EP3667623A1 (en) A system for optimizing a 3d mesh
CN114307158A (en) Three-dimensional virtual scene data generation method and device, storage medium and terminal
CN114119848A (en) Model rendering method and device, computer equipment and storage medium
CN113722832A (en) Real-time rendering and modeling method and system for spacecraft and storage medium
Kerautret et al. Intuitive shape modeling by shading design
CN112560126A (en) Data processing method, system and storage medium for 3D printing
CN115803782A (en) Augmented reality effect of perception geometry with real-time depth map
CN109389683B (en) flash background wall generation method and device
WO2023179091A1 (en) Three-dimensional model rendering method and apparatus, and device, storage medium and program product
US20230154102A1 (en) Representing 3d shapes with probabilistic directed distance fields

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
GR01 Patent grant
GR01 Patent grant