CN117475072A - Rendering method, device, equipment, medium and product - Google Patents

Rendering method, device, equipment, medium and product Download PDF

Info

Publication number
CN117475072A
CN117475072A CN202311294410.7A CN202311294410A CN117475072A CN 117475072 A CN117475072 A CN 117475072A CN 202311294410 A CN202311294410 A CN 202311294410A CN 117475072 A CN117475072 A CN 117475072A
Authority
CN
China
Prior art keywords
rendered
light source
rendering
illumination
dimensional light
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
CN202311294410.7A
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.)
Navinfo Co Ltd
Original Assignee
Navinfo 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 Navinfo Co Ltd filed Critical Navinfo Co Ltd
Priority to CN202311294410.7A priority Critical patent/CN117475072A/en
Publication of CN117475072A publication Critical patent/CN117475072A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/56Particle system, point based geometry or rendering

Landscapes

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

Abstract

The embodiment of the specification discloses a rendering method, a rendering device, a rendering medium and a rendering product, wherein the scheme can comprise the following steps: acquiring illumination range parameters and illumination color parameters of a virtual light source to be rendered; creating a three-dimensional light column model of the virtual light source to be rendered based on the illumination range parameters; the three-dimensional light column model is used for representing the illumination range of the virtual light source to be rendered; determining rendering color information of the three-dimensional light column model based on the illumination color parameters; and rendering the three-dimensional light column model by using the rendering color information to obtain the illumination effect of the virtual light source to be rendered. According to the rendering method provided by the embodiment, based on the illumination range parameters of the virtual light source to be rendered, the three-dimensional light column model used for representing the illumination range of the virtual light source to be rendered can be created, the three-dimensional light column model is rendered, the illumination effect of the virtual light source to be rendered can be obtained, and compared with the simulation light transmitted through the colloid and scattered by particles suspended in the colloid, the rendering efficiency is higher.

Description

Rendering method, device, equipment, medium and product
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a rendering method, apparatus, device, medium, and product.
Background
A beam of light passes through the colloid, and a bright 'path' in the colloid can be observed from the direction of normal incidence due to the scattering effect of colloid particles on the light, and the phenomenon is called the Tyndall phenomenon. Such effects are often referred to as volume Light (v/v Light) in real-time rendering. The volume light can bring the user with a more realistic sensation, and has wide application in the fields of 3D games, high-precision maps, augmented reality and the like.
In practical application, when volume light is rendered, the light is usually simulated to pass through the colloid and scattered by particles suspended in the colloid, so that a bright 'path' appears, and the method has large calculated amount and lower rendering efficiency.
Disclosure of Invention
The embodiment of the specification provides a rendering method, a device, equipment, a medium and a product, so as to solve the problem of low rendering efficiency in the existing rendering method.
In order to solve the above technical problems, the embodiments of the present specification are implemented as follows:
the rendering method provided by the embodiment of the specification comprises the following steps:
acquiring light source parameters of a virtual light source to be rendered; the light source parameters comprise illumination range parameters and illumination color parameters;
creating a three-dimensional light column model of the virtual light source to be rendered based on the illumination range parameters; the three-dimensional light column model is used for representing the illumination range of the virtual light source to be rendered;
Determining rendering color information of the three-dimensional light pillar model based on the illumination color parameters;
and rendering the three-dimensional light column model by using the rendering color information to obtain the illumination effect of the virtual light source to be rendered.
The embodiment of the present specification provides a computer device, including:
the parameter acquisition module is used for acquiring the light source parameters of the virtual light source to be rendered; the light source parameters comprise illumination range parameters and illumination color parameters;
the model creation module is used for creating a three-dimensional light column model of the virtual light source to be rendered based on the illumination range parameters; the three-dimensional light column model is used for representing the illumination range of the virtual light source to be rendered;
the information determining module is used for determining rendering color information of the three-dimensional light column model based on the illumination color parameters;
and the rendering module is used for rendering the three-dimensional light column model by utilizing the rendering color information to obtain the illumination effect of the virtual light source to be rendered.
The embodiment of the specification provides a computer device, which comprises a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to realize the steps of the rendering method.
The embodiments of the present disclosure provide a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the rendering method described above.
A computer program product according to an embodiment of the present disclosure includes computer instructions, which when executed by a processor implement the steps of the rendering method described above.
At least one embodiment provided in this specification enables the following benefits:
according to the rendering method provided by the embodiment, based on the illumination range parameters of the virtual light source to be rendered, the three-dimensional light column model used for representing the illumination range of the virtual light source to be rendered can be created, the three-dimensional light column model is rendered, the illumination effect of the virtual light source to be rendered can be obtained, and compared with the simulation light transmitted through the colloid and scattered by particles suspended in the colloid, the rendering efficiency is higher.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 is a schematic flow chart of a rendering method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a three-dimensional light pillar model according to an embodiment of the present disclosure;
FIG. 3 is a schematic view of a volume of light provided in an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a positional relationship between a three-dimensional light pillar model and a reference point according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a noise texture according to an embodiment of the present disclosure;
FIG. 6 is a schematic view of a rendering effect according to an embodiment of the present disclosure;
fig. 7 is a schematic view of a firework and a rendering effect of firework particles according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of one or more embodiments of the present specification more clear, the technical solutions of one or more embodiments of the present specification will be clearly and completely described below in connection with specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without undue burden, are intended to be within the scope of one or more embodiments herein.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
In practical application, when volume light is rendered, the light is usually simulated to pass through the colloid and scattered by particles suspended in the colloid, so that a bright 'path' appears, and the method has large calculated amount and lower rendering efficiency.
In order to solve the drawbacks of the prior art, the present solution provides the following embodiments:
fig. 1 is a schematic flow chart of a rendering method according to an embodiment of the present disclosure, and from a program perspective, an execution subject of the flow may be a program or an application client that is installed on an application server or a cloud. As shown in fig. 1, the method may include the steps of:
step 102: acquiring light source parameters of a virtual light source to be rendered; the light source parameters include an illumination range parameter and an illumination color parameter.
According to the embodiment of the specification, the virtual light source to be rendered can be rendered, and then the illumination effect of the virtual light source to be rendered is obtained.
The virtual light source to be rendered may be a virtual light source to be rendered in a virtual scene. The virtual scenes may include 3D game scenes, high-precision map scenes, augmented reality scenes, and the like.
Further, the virtual light source to be rendered may include a light source that generates volume light, such as a searchlight, a stage spotlight, a street lamp, a desk lamp, and the like.
In the embodiment of the present specification, the illumination range parameter may be a parameter indicating an illumination range of the virtual light source to be rendered, and may include, for example, an intensity parameter of the light source, a luminance parameter of the light source, and the like.
The illumination color parameter may be a parameter representing an illumination color of the virtual light source to be rendered, for example, may include a color parameter of the light source, for example, the color parameter of the virtual light source to be rendered is a parameter representing red, the illumination color may be red, the color parameter of the virtual light source to be rendered is a parameter representing green, and the illumination color may be green.
Step 104: creating a three-dimensional light column model of the virtual light source to be rendered based on the illumination range parameters; the three-dimensional light column model is used for representing the illumination range of the virtual light source to be rendered.
The three-dimensional light pillar model may be a model representing a range of illumination of the virtual light source to be rendered. In practical applications, the specific shape of the three-dimensional light pillar model may be determined according to the light source attribute, and may be a pillar, a sphere, a pillar with a polygonal cross section, or the like. Assuming that the illumination range of the virtual light source to be rendered can be regarded as a circular truncated cone, the three-dimensional light pillar model can be of a circular truncated cone structure; the three-dimensional light pillar model may be a cone structure, provided that the illumination range of the virtual light source to be rendered may be regarded as a cone.
Fig. 2 is a schematic structural diagram of a three-dimensional light pillar model provided in the embodiment of the present disclosure, as shown in fig. 2, assuming that an illumination range of a virtual light source to be rendered can be regarded as a cone, and the virtual light source to be rendered emits light from bottom to top, the three-dimensional light pillar model corresponding to the virtual light source to be rendered may be an inverted cone structure with a wide top and a narrow bottom, that is, a bottom surface of the cone is located above, and a vertex of the cone is located below.
In the embodiment of the present disclosure, a three-dimensional light pillar model for representing an illumination range of a virtual light source to be rendered may be created, and then the three-dimensional light pillar model is rendered, so that an illumination effect of the virtual light source to be rendered may be obtained.
Step 106: and determining rendering color information of the three-dimensional light pillar model based on the illumination color parameters.
In the embodiment of the present disclosure, the rendering color information of the three-dimensional light pillar model may be determined based on the illumination color parameters of the virtual light source to be rendered.
For example, if the illumination color parameter of the virtual light source to be rendered is a parameter that the color of the light source represents red, the rendering color information of the three-dimensional light pillar model may be determined to be information representing red.
Step 108: and rendering the three-dimensional light column model by using the rendering color information to obtain the illumination effect of the virtual light source to be rendered.
Continuing to use the above example, assuming that the rendering color information of the three-dimensional light pillar model is information representing red, and rendering the three-dimensional light pillar model by using the information representing red, the three-dimensional light pillar model can be rendered into red, and then the virtual light source to be rendered, namely the illumination effect of the red light source, can be obtained.
It should be understood that the method according to one or more embodiments of the present disclosure may include the steps in which some of the steps are interchanged as needed, or some of the steps may be omitted or deleted.
The examples of the present specification also provide some specific embodiments of the method based on the method of fig. 1, which is described below.
In practice, the end regions of the volume light are generally evanescent, i.e. evanescent, transparent. Fig. 3 is a schematic view of a volume of light provided in an embodiment of the present disclosure, and as shown in fig. 3, a distal region of the volume of light may have a dissolve effect. Therefore, in order to generate a more realistic rendering effect, in the embodiment of the present disclosure, the end region of the three-dimensional light pillar model may also be rendered, so as to obtain a dissolve effect of the illumination end region of the virtual light source to be rendered. The illumination end region of the virtual light source to be rendered may be understood as an end region remote from the virtual light source to be rendered, which may be a part of the illumination range of the virtual light source to be rendered, such as the volume light end region shown in fig. 3. Since the three-dimensional light pillar model in the embodiments of the present specification may represent the illumination range of the virtual light source to be rendered, the end region of the three-dimensional light pillar model may be used to represent the illumination end region of the virtual light source to be rendered. Based on this, the rendering method provided in the embodiment of the present disclosure may further include:
Acquiring a first fading-out parameter of an illumination tail end area of the virtual light source to be rendered;
the determining, based on the illumination color parameter, rendering color information of the three-dimensional light pillar model may specifically include:
determining first rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the first dissolve-out parameter; the first rendering color information is used for rendering the tail end area of the three-dimensional light column model, and the tail end area of the three-dimensional light column model is used for representing the illumination tail end area of the virtual light source to be rendered.
The first dissolve parameter of the illumination end region of the virtual light source to be rendered may be a parameter describing a dissolve effect of the illumination end region of the virtual light source to be rendered, specifically may be a distance from the beginning of transparency to the complete transparency of the illumination end region, or a proportion of a portion from the beginning of transparency to the complete transparency to the total length of illumination.
In this embodiment of the present disclosure, for better rendering effect, when the illumination end region of the virtual light source to be rendered is rendered, the first rendering color information of the end region of the three-dimensional light pillar model may be determined based on the first dissolve parameter of the illumination end region of the virtual light source to be rendered and the illumination color parameter of the virtual light source to be rendered, so that the illumination effect of the illumination end region of the virtual light source to be rendered is obtained by rendering the end region of the three-dimensional light pillar model with the first rendering color information.
Wherein, the determining the first rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the first dissolve-out parameter may specifically include:
splitting the three-dimensional light beam model for UV treatment to obtain a texture map of the three-dimensional light beam model;
determining a first rendering parameter of the three-dimensional light pillar model based on the first dissolve parameter and the texture map;
first rendering color information of the three-dimensional light pillar model is determined based on the illumination color parameters and the first rendering parameters.
When the first rendering parameters of the three-dimensional light column model are determined, sampling can be performed on the vertical direction of the texture map of the three-dimensional light column model through a Maximum node, and every two adjacent sampling points are sequentially compared and assigned in a (0, 1) interval. And using the power function, namely taking the value of the sampling point in the (0, 1) interval as the base of the power function, taking the first dissolve-out parameter as the index of the power function, and outputting a dissolve-out range. And carrying out inverse mapping on the transparency corresponding to the fading-out range and the fading-out effect of the fading-out range by using an One Minus function, and further outputting a first rendering parameter for controlling the transparency of the three-dimensional light column model.
Further, the illumination color parameter and the first rendering parameter may be superimposed, thereby determining first rendering color information of the three-dimensional light pillar model. For example, the illumination color parameter is a parameter of representing red color by the color of the light source, and the first rendering parameter is a parameter of rendering 20cm of the end region of the three-dimensional light pillar model into a fading effect. The determined first rendering color information may include information that renders an end region of the three-dimensional light pillar model to red and 20cm of the end region of the three-dimensional light pillar model to a dissolve effect. The first rendering color information is utilized to render the tail end area of the three-dimensional light column model, so that the rendering effect that the illumination tail end area of the virtual light source to be rendered is red and has a fading effect within the range of 20cm of the illumination tail end area can be achieved.
In practice, the non-end regions of the volume light are also generally faded out, as shown in FIG. 3, which may be a fading effect. Therefore, in order to make the rendering result more realistic, in the embodiment of the present disclosure, the non-end region of the three-dimensional light pillar model may be further rendered, so as to obtain the fading effect of the illumination non-end region of the virtual light source to be rendered. The illumination non-end region of the virtual light source to be rendered may be a portion other than the illumination end region of the virtual light source to be rendered, such as the volume light non-end region shown in fig. 3. Similarly, since the three-dimensional light pillar model in the embodiment of the present disclosure may represent the illumination range of the virtual light source to be rendered, the non-end region of the three-dimensional light pillar model may represent the illumination non-end region of the virtual light source to be rendered. Based on this, the rendering method provided in the embodiment of the present disclosure may further include:
Acquiring a second fading-out parameter of the illumination non-terminal area of the virtual light source to be rendered;
the determining, based on the illumination color parameter, rendering color information of the three-dimensional light pillar model may specifically include:
determining second rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the second dissolve-out parameter; the second rendering color information is used for rendering the non-end area of the three-dimensional light pillar model, and the non-end area of the three-dimensional light pillar model is used for representing the illumination non-end area of the virtual light source to be rendered.
The second dissolve parameter of the illumination non-end area of the virtual light source to be rendered may be a parameter describing the dissolve effect of the illumination non-end area of the virtual light source to be rendered, specifically may be a distance from the beginning of transparency to the complete transparency of the illumination non-end area, or a proportion of a part from the beginning of dissolve to the complete dissolve to the current illumination width.
In the embodiment of the present disclosure, in order to obtain a more realistic rendering effect, when the non-end area of the illumination of the virtual light source to be rendered is rendered, the second rendering color information of the non-end area of the three-dimensional light pillar model may be determined based on the second fading parameter of the non-end area of the illumination of the virtual light source to be rendered and the illumination color parameter of the virtual light source to be rendered, and then the non-end area of the three-dimensional light pillar model is rendered by using the second rendering color information, so as to obtain the illumination effect of the non-end area of the illumination of the virtual light source to be rendered.
Wherein, the determining the second rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the second dissolve-out parameter may specifically include:
determining a second rendering parameter of the three-dimensional light pillar model based on the second dissolve-out parameter;
and determining second rendering color information of the three-dimensional light pillar model based on the illumination color parameters and the second rendering parameters.
The initial rendering parameter of the three-dimensional light beam model may be determined by using a fresnel formula based on the three-dimensional light beam model, where the initial rendering parameter may be a distribution value of light reflection intensity under an angle of an observation line of sight, and the distribution value of light reflection intensity may be in a value range of (0, 1). The adjusting of the initial rendering parameter by using the second dissolve parameter may be that the distribution value of the light reflection intensity in the (0, 1) value range is remapped (chinese name: remapped), that is, the distribution value of the light reflection intensity in the (0, 1) value range is remapped, so as to output the second rendering parameter of the three-dimensional light column model.
Further, the illumination color parameter and the second rendering parameter may be superimposed, thereby determining second rendering color information of the three-dimensional light pillar model. For example, the illumination color parameter is a parameter that the color of the light source represents red, and the second rendering parameter is a parameter that renders 40cm of the non-end region of the three-dimensional light pillar model into a dissolve effect. The determined second rendering color information may include information that renders a non-end region of the three-dimensional light pillar model into red color and that renders 40cm of the non-end region of the three-dimensional light pillar model into a dissolve effect. And rendering the non-end region of the three-dimensional light column model by utilizing the second rendering color information, so that the rendering effect that the illumination non-end region of the virtual light source to be rendered is red and has a fading effect within the range of 40cm of the illumination non-end region can be achieved.
In the embodiment of the present disclosure, the illumination color of the virtual light source to be rendered may change with time. In order to achieve an illumination effect that an illumination color of a virtual light source to be rendered changes with time, in a rendering method provided in an embodiment of the present disclosure:
the rendering color information of the three-dimensional light column model may include color information values of three color channels of red, green and blue, wherein the color information value of each color channel changes according to a triangular wave function curve, and the triangular wave function curve is used for representing information that illumination color of the virtual light source to be rendered changes along with time.
The Triangle Wave function curve can be obtained by a Triangle Wave (Chinese name: triangle Wave) function based on a Unity platform. Specifically, the illumination time of the virtual light source to be rendered can be driven as a positive integer which is increased at a constant speed, the illumination time is divided into three identical inputs, one input is increased by one third, one input is increased by two thirds and is input into the triangular wave function, for example, the 3 rd second, the 4 th second and the 5 th second in the illumination time can be used as inputs and are input into the triangular wave function. The triangular wave function outputs 3 initial triangular wave function curves with the value range (-1, 1), filters the 3 initial triangular wave curves respectively, and converts the three initial triangular wave curves into 3 triangular wave function curves with the value range (0, 1). The three triangular wave function curves with the value ranges of (0, 1) are respectively valued, so that the color information values of the three color channels of red, green and blue driven by time can be obtained. The color information values of the three color channels of red, green and blue driven by time are utilized to render the colors of the three-dimensional light column model, so that the illumination effect that the illumination color of the virtual light source to be rendered changes along with time can be achieved.
In practice, there are multiple light source scenes, such as multiple stage lights, which can be controlled together, such as turned together, etc. In the virtual scene, if each virtual light source to be rendered is controlled respectively, the virtual light source is complicated, and the control efficiency is low. Therefore, in the embodiment of the present disclosure, the virtual light source to be rendered includes a plurality of virtual light sources to be rendered, and the creating a three-dimensional light pillar model of the virtual light source to be rendered based on the illumination range parameter may specifically include:
creating a three-dimensional light column model of any virtual light source to be rendered based on illumination range parameters of the any virtual light source to be rendered aiming at any virtual light source to be rendered in the plurality of virtual light sources to be rendered;
the rendering method may further include:
creating a datum point for driving the three-dimensional light column model of any virtual light source to be rendered to move;
determining any target point on the axis of the three-dimensional light column model of any virtual light source to be rendered based on the reference point; the straight line passing through the datum point and any target point is perpendicular to the axis of the three-dimensional light column model of any virtual light source to be rendered, so that the datum point moves to drive the three-dimensional light column model of any virtual light source to be rendered to move.
In this embodiment of the present disclosure, if a plurality of virtual light sources to be rendered need to be rendered, a three-dimensional light pillar model may be respectively constructed for each virtual light source to be rendered, so as to achieve a rendering effect for each virtual light source to be rendered through each three-dimensional light pillar model.
Further, the reference point may be any point in the virtual scene where the plurality of three-dimensional light pillar models are located, such as a point inside the space formed by each three-dimensional light pillar model, or a point outside the space formed by each three-dimensional light pillar model.
In practical application, it is assumed that the virtual light source to be rendered includes a plurality of virtual light sources to be rendered, where the plurality of virtual light sources to be rendered correspond to a plurality of three-dimensional light pillar models, at this time, a reference point may be set, and a plurality of three-dimensional light pillar models are controlled at the same time; a plurality of datum points can be set, and a plurality of three-dimensional light column models can be controlled respectively; or setting a plurality of datum points to respectively control at least two three-dimensional light column models in the plurality of three-dimensional light column models. In practical application, the setting can be according to practical requirements, and the setting is not particularly limited here.
Fig. 4 is a schematic diagram of a positional relationship between a three-dimensional light beam model and a reference point according to an embodiment of the present disclosure, where, as shown in fig. 4, the reference point in fig. 4 is located inside a space formed by each three-dimensional light beam model. When the datum point moves upwards, each three-dimensional light column model can move in a direction away from the datum point, the plurality of three-dimensional light column models can be in a scattered state, and end areas of the three-dimensional light column models can be away from each other; when the reference point moves downwards, each three-dimensional light beam model can move towards the direction approaching the reference point, a plurality of three-dimensional light beam models can be in a closed state, and the tail end areas of the three-dimensional light beam models can be mutually approaching.
In the embodiment of the present disclosure, since the straight line passing through the reference point and any target point on the axis of any three-dimensional light pillar model is perpendicular to the axis of any three-dimensional light pillar model, the reference point moves, so that any three-dimensional light pillar model can be driven to move, that is, the control reference point can control a plurality of three-dimensional light pillar models, thereby improving the control efficiency of a plurality of three-dimensional light pillar models and the control efficiency of a plurality of virtual light sources to be rendered.
In the embodiment of the present disclosure, the virtual light to be rendered may also be rendered to have an effect of high-frequency light emission, that is, the illumination of the virtual light source to be rendered may show intermittent effects. The rendering method may further include:
and adding noise textures on the three-dimensional light column model of the virtual light source to be rendered.
Fig. 5 is a schematic diagram of a noise texture provided in the embodiment of the present disclosure, as shown in fig. 5, by adding the noise texture to the three-dimensional light pillar model of the virtual light source to be rendered, the three-dimensional light pillar model may exhibit intermittent rendering effects. It is noted that the color below the noise texture in fig. 5 is lighter than the color above, because the noise texture is added to the end region of the three-dimensional light pillar model, which has a dissolve effect, and thus the dissolve effect is exhibited below the noise texture.
Fig. 6 is a schematic view of a rendering effect provided by the embodiment of the present disclosure, where, as shown in fig. 6, a three-dimensional light pillar model may show intermittent rendering effects.
Further, the noise texture in the embodiment of the present specification may include a noise texture that is driven to move by the rendering timing. The positions of the noise textures at different rendering moments in one rendering period on the three-dimensional light column model of the virtual light source to be rendered are different. In this way, the noise texture can be driven to move by the rendering time, so as to achieve the rendering effect which changes along with the change of the rendering time.
In the embodiment of the present specification, the virtual light source to be rendered may include not only a light source generating a volume light but also spark particles such as spark particles generated by explosion, spark particles generated by collision between objects, spark particles generated by friction between objects, and the like. This is because spark particles are generally accompanied by a tail, which can be regarded as a volume light, and the rendering effect of the spark particles can be obtained by creating a three-dimensional light pillar model of the volume light and rendering the three-dimensional light pillar model.
Further, the virtual light source to be rendered in the embodiment of the present disclosure may further include fireworks. That is, the embodiment of the specification can also render fireworks to achieve the rendering effect of setting off the fireworks.
Further, the virtual light source to be rendered in the embodiment of the present disclosure may further include firework particles. Fireworks particles are also generally accompanied by a tail, which can also be regarded as a volume light. Similarly, a three-dimensional light column model of the volume light is created, and the three-dimensional light column model is rendered, so that the rendering effect of the firework particles can be obtained.
Fig. 7 is a schematic view of a firework and a rendering effect of firework particles according to an embodiment of the present disclosure, where, as shown in fig. 7, the three-dimensional light pillar model in fig. 7 may be a rendering effect of firework set off obtained by rendering, and the firework particles and the firework tail may be rendering effects of firework particle set off.
Based on the same thought, the embodiment of the specification also provides a device corresponding to the method. Fig. 8 is a schematic structural diagram of a computer device corresponding to fig. 1 according to an embodiment of the present disclosure. As shown in fig. 8, the apparatus may include:
a parameter obtaining module 802, configured to obtain a light source parameter of a virtual light source to be rendered; the light source parameters comprise illumination range parameters and illumination color parameters;
a model creation module 804, configured to create a three-dimensional light pillar model of the virtual light source to be rendered based on the illumination range parameter; the three-dimensional light column model is used for representing the illumination range of the virtual light source to be rendered;
An information determining module 806, configured to determine rendering color information of the three-dimensional light pillar model based on the illumination color parameter;
and the rendering module 808 is configured to render the three-dimensional light pillar model by using the rendering color information, so as to obtain the illumination effect of the virtual light source to be rendered.
The present description example also provides some specific embodiments of the device based on the device of fig. 8, which is described below.
Optionally, the apparatus may further include:
acquiring a first fading-out parameter of an illumination tail end area of the virtual light source to be rendered;
the information determining module 806 may specifically include:
determining first rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the first dissolve-out parameter; the first rendering color information is used for rendering the tail end area of the three-dimensional light column model, and the tail end area of the three-dimensional light column model is used for representing the illumination tail end area of the virtual light source to be rendered.
Optionally, the determining the first rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the first dissolve parameter may specifically include:
Splitting the three-dimensional light beam model for UV treatment to obtain a texture map of the three-dimensional light beam model;
determining a first rendering parameter of the three-dimensional light pillar model based on the first dissolve parameter and the texture map;
first rendering color information of the three-dimensional light pillar model is determined based on the illumination color parameters and the first rendering parameters.
Optionally, the apparatus may further include:
acquiring a second fading-out parameter of the illumination non-terminal area of the virtual light source to be rendered;
the information determining module 806 may specifically include:
determining second rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the second dissolve-out parameter; the second rendering color information is used for rendering the non-end area of the three-dimensional light pillar model, and the non-end area of the three-dimensional light pillar model is used for representing the illumination non-end area of the virtual light source to be rendered.
Optionally, the determining the second rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the second dissolve parameter may specifically include:
determining a second rendering parameter of the three-dimensional light pillar model based on the second dissolve-out parameter;
And determining second rendering color information of the three-dimensional light pillar model based on the illumination color parameters and the second rendering parameters.
Optionally, the rendering color information of the three-dimensional light pillar model includes color information values of three color channels of red, green and blue, and the color information value of each color channel changes according to a triangular wave function curve, where the triangular wave function curve is used to represent information that the illumination color of the virtual light source to be rendered changes with time.
Optionally, the virtual light source to be rendered includes a plurality of virtual light sources to be rendered, and the model creation module 804 may specifically include:
creating a three-dimensional light column model of any virtual light source to be rendered based on illumination range parameters of the any virtual light source to be rendered aiming at any virtual light source to be rendered in the plurality of virtual light sources to be rendered;
the apparatus may further include:
creating a datum point for driving the three-dimensional light column model of any virtual light source to be rendered to move;
determining any target point on the axis of the three-dimensional light column model of any virtual light source to be rendered based on the reference point; the straight line passing through the datum point and any target point is perpendicular to the axis of the three-dimensional light column model of any virtual light source to be rendered, so that the datum point moves to drive the three-dimensional light column model of any virtual light source to be rendered to move.
Optionally, the apparatus may further include:
and adding noise textures on the three-dimensional light column model of the virtual light source to be rendered.
Optionally, the noise texture comprises a noise texture driven to move by a rendering time; the positions of the noise textures at different rendering moments in one rendering period on the three-dimensional light pillar model of the virtual light source to be rendered are different.
Optionally, the virtual light source to be rendered includes at least one of a light source generating a volume light, a spark particle, a firework, and a firework particle.
Based on the same thought, the embodiment of the specification also provides equipment corresponding to the method.
Fig. 9 is a schematic structural diagram of a computer device corresponding to fig. 1 according to an embodiment of the present disclosure. As shown in fig. 9, the apparatus 900 may include: comprising a memory 910, a processor 920 and a computer program 930 stored on the memory 910, the processor 920 executing the computer program 930 to implement the steps of the rendering method described above.
Based on the same idea, the embodiments of the present disclosure further provide a computer readable storage medium corresponding to the above method, where computer instructions are stored, where the computer instructions implement the steps of the above rendering method when executed by a processor.
Based on the same idea, the embodiments of the present disclosure further provide a computer program product corresponding to the above method, where the computer program product includes computer instructions, and when the computer instructions are executed by a processor, implement the steps of the rendering method.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the computer device shown in fig. 9, the description is relatively simple, as it is substantially similar to the method embodiment, with reference to the partial description of the method embodiment being relevant.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., a field programmable gate array (Field Programmable gate array, FPGA)) is an integrated circuit whose logic function is determined by the user programming the device. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that 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.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (14)

1. A rendering method, comprising:
acquiring light source parameters of a virtual light source to be rendered; the light source parameters comprise illumination range parameters and illumination color parameters;
creating a three-dimensional light column model of the virtual light source to be rendered based on the illumination range parameters; the three-dimensional light column model is used for representing the illumination range of the virtual light source to be rendered;
determining rendering color information of the three-dimensional light pillar model based on the illumination color parameters;
and rendering the three-dimensional light column model by using the rendering color information to obtain the illumination effect of the virtual light source to be rendered.
2. The method as recited in claim 1, further comprising:
acquiring a first fading-out parameter of an illumination tail end area of the virtual light source to be rendered;
the determining the rendering color information of the three-dimensional light pillar model based on the illumination color parameters specifically comprises:
Determining first rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the first dissolve-out parameter; the first rendering color information is used for rendering the tail end area of the three-dimensional light column model, and the tail end area of the three-dimensional light column model is used for representing the illumination tail end area of the virtual light source to be rendered.
3. The method according to claim 2, wherein said determining the first rendering color information of the three-dimensional light pillar model based on the illumination color parameters and the first dissolve parameters, in particular comprises:
splitting the three-dimensional light beam model for UV treatment to obtain a texture map of the three-dimensional light beam model;
determining a first rendering parameter of the three-dimensional light pillar model based on the first dissolve parameter and the texture map;
first rendering color information of the three-dimensional light pillar model is determined based on the illumination color parameters and the first rendering parameters.
4. The method as recited in claim 1, further comprising:
acquiring a second fading-out parameter of the illumination non-terminal area of the virtual light source to be rendered;
the determining the rendering color information of the three-dimensional light pillar model based on the illumination color parameters specifically comprises:
Determining second rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the second dissolve-out parameter; the second rendering color information is used for rendering the non-end area of the three-dimensional light pillar model, and the non-end area of the three-dimensional light pillar model is used for representing the illumination non-end area of the virtual light source to be rendered.
5. The method according to claim 4, wherein the determining the second rendering color information of the three-dimensional light pillar model based on the illumination color parameter and the second dissolve parameter specifically comprises:
determining a second rendering parameter of the three-dimensional light pillar model based on the second dissolve-out parameter;
and determining second rendering color information of the three-dimensional light pillar model based on the illumination color parameters and the second rendering parameters.
6. The method of claim 1, wherein the rendering color information of the three-dimensional light pillar model includes color information values of three color channels of red, green and blue, the color information value of each color channel varying according to a triangular wave function curve representing information of illumination color of the virtual light source to be rendered over time.
7. The method according to claim 1, wherein the virtual light source to be rendered comprises a plurality of virtual light sources to be rendered, and wherein the creating the three-dimensional light pillar model of the virtual light source to be rendered based on the illumination range parameter specifically comprises:
creating a three-dimensional light column model of any virtual light source to be rendered based on illumination range parameters of the any virtual light source to be rendered aiming at any virtual light source to be rendered in the plurality of virtual light sources to be rendered;
the method further comprises the steps of:
creating a datum point for driving the three-dimensional light column model of any virtual light source to be rendered to move;
determining any target point on the axis of the three-dimensional light column model of any virtual light source to be rendered based on the reference point; the straight line passing through the datum point and any target point is perpendicular to the axis of the three-dimensional light column model of any virtual light source to be rendered, so that the datum point moves to drive the three-dimensional light column model of any virtual light source to be rendered to move.
8. The method as recited in claim 1, further comprising:
and adding noise textures on the three-dimensional light column model of the virtual light source to be rendered.
9. The method of claim 8, wherein the noise texture comprises a noise texture that is driven to move by a rendering time; the positions of the noise textures at different rendering moments in one rendering period on the three-dimensional light pillar model of the virtual light source to be rendered are different.
10. The method of claim 1, wherein the virtual light source to be rendered comprises at least one of a light source that generates a volume light, a spark particle, a firework, and a firework particle.
11. A computer apparatus, comprising:
the parameter acquisition module is used for acquiring the light source parameters of the virtual light source to be rendered; the light source parameters comprise illumination range parameters and illumination color parameters;
the model creation module is used for creating a three-dimensional light column model of the virtual light source to be rendered based on the illumination range parameters; the three-dimensional light column model is used for representing the illumination range of the virtual light source to be rendered;
the information determining module is used for determining rendering color information of the three-dimensional light column model based on the illumination color parameters;
and the rendering module is used for rendering the three-dimensional light column model by utilizing the rendering color information to obtain the illumination effect of the virtual light source to be rendered.
12. A computer device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the steps of the method of any one of claims 1 to 10.
13. A computer readable storage medium having stored thereon computer instructions, which when executed by a processor, implement the steps of the method of any of claims 1 to 10.
14. A computer program product comprising computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 10.
CN202311294410.7A 2023-10-08 2023-10-08 Rendering method, device, equipment, medium and product Pending CN117475072A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311294410.7A CN117475072A (en) 2023-10-08 2023-10-08 Rendering method, device, equipment, medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311294410.7A CN117475072A (en) 2023-10-08 2023-10-08 Rendering method, device, equipment, medium and product

Publications (1)

Publication Number Publication Date
CN117475072A true CN117475072A (en) 2024-01-30

Family

ID=89632173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311294410.7A Pending CN117475072A (en) 2023-10-08 2023-10-08 Rendering method, device, equipment, medium and product

Country Status (1)

Country Link
CN (1) CN117475072A (en)

Similar Documents

Publication Publication Date Title
CN108921927B (en) Particle-based firework special effect realization method, device and equipment
US9070206B2 (en) Providing a visible light source in an interactive three-dimensional compositing application
CN102396003B (en) For adding the method for shade to the object in computer graphical
Barzel Lighting controls for computer cinematography
CN111476877B (en) Shadow rendering method and device, electronic equipment and storage medium
CN111540035B (en) Particle rendering method, device and equipment
CN104008563A (en) Method for achieving global illumination drawing of animation three-dimensional scene with virtual point light sources
WO2024074015A1 (en) Soft shadow generation method and apparatus, device and storage medium
CN104103092A (en) Real-time dynamic shadowing realization method based on projector lamp
CN112233220B (en) OpenSceneGraph-based volumetric light generation method, device, equipment and storage medium
KR102250254B1 (en) Method and apparatus for processing image
US9483873B2 (en) Easy selection threshold
CN112233214A (en) Snow scene rendering method, device, equipment and storage medium for large scene
CN116485987B (en) Real environment simulation method and device based on shadow rendering
CN117475072A (en) Rendering method, device, equipment, medium and product
Dirksen Learn Three. js: Program 3D animations and visualizations for the web with JavaScript and WebGL
CN117581268A (en) Rendering visual representations of luminaires by reusing light values
CN114266855A (en) Light effect simulation method and device of dot matrix screen and electronic equipment
Crone Radiance users manual
CN112684720A (en) Simulation test method and device
KR102306774B1 (en) Method and apparatus for processing image
CN117409130A (en) Method, device, equipment, medium and product for displaying map data
JP3700928B2 (en) Image representation method and program used therefor
CN117671104A (en) Rendering method, rendering device, electronic equipment and computer readable storage medium
Berssenbru¨ gge et al. Simulation of New Automobile Lighting Systems for a Nightdrive Application

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