CN116883580B - Silk stocking object rendering method and device - Google Patents

Silk stocking object rendering method and device Download PDF

Info

Publication number
CN116883580B
CN116883580B CN202310830098.2A CN202310830098A CN116883580B CN 116883580 B CN116883580 B CN 116883580B CN 202310830098 A CN202310830098 A CN 202310830098A CN 116883580 B CN116883580 B CN 116883580B
Authority
CN
China
Prior art keywords
silk stocking
rendering
value
parameters
color
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
CN202310830098.2A
Other languages
Chinese (zh)
Other versions
CN116883580A (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.)
Shanghai Sanbao Information Technology Co ltd
Original Assignee
Shanghai Sanbao Information 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 Shanghai Sanbao Information Technology Co ltd filed Critical Shanghai Sanbao Information Technology Co ltd
Priority to CN202310830098.2A priority Critical patent/CN116883580B/en
Publication of CN116883580A publication Critical patent/CN116883580A/en
Application granted granted Critical
Publication of CN116883580B publication Critical patent/CN116883580B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/80Shading

Landscapes

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

Abstract

A silk stocking object rendering method and device, it includes: setting a ramp map with a silk stocking object material adaptive gradual change effect by using a normal line smoothing tool, and performing numerical curve fitting according to the ramp map; setting initial parameter information including colors in silk stocking materials according to the ramp mapping to simulate silk stocking attribute information including different colors; configuring rendering parameters of silk stocking object materials in a shader file, wherein the rendering parameters comprise silk stocking color parameters which are matched with each other according to different normal lines and different sight directions at different positions of the silk stocking object; and based on the rendering parameters configured in the shader file, combining cartoon rendering with real physical-based rendering, and rendering the silk stocking objects in the three-dimensional model. The object is rendered to present a physical realistic effect, and a cartoon effect can be realized to improve the visual display effect of the rendered image.

Description

Silk stocking object rendering method and device
Technical Field
The embodiment of the invention relates to the field of computer application, in particular to a silk stocking object rendering method and device.
Background
Along with the promotion of the aesthetic level of the whole game of a player, the requirements of the player on the artistic expression and the rendering effect of the game are also higher and higher, wherein, as the materials of the cloth and the clothes worn by the game character are higher and higher in the whole game expression effect, the requirements of the player on the rendering effect of the cloth and the clothes worn by the game character are also gradually increased. With the popularity of the rendering technologies such as PBR, the rendering effect of the game is gradually improved, but due to the fact that the real cloth structure is very complex, even if the current popular PBR technology is adopted, the rendering result is not ideal, the rendered cloth is unreal in visual effect and looks more like metal or plastic.
The Beijing free travel world network technology limited company discloses a rendering method (application number 202010214140.4) which comprises the following steps: after receiving the three-dimensional model of the object to be rendered, determining the cloth type of the object to be rendered; and calling the general rendering parameters and the detail rendering parameters corresponding to the cloth type of the object to be rendered, and rendering the three-dimensional model of the object to be rendered based on the general rendering parameters and the detail rendering parameters. Therefore, in the scheme, the rendering objects are divided according to the types of the cloth, different types correspond to different rendering parameters, and the detail difference of the cloth is considered in the rendering parameters of the cloth of different types, so that the problem that the rendering result is not ideal due to lack of detail in the rendering of the cloth is avoided, the rendering effect of the cloth is improved, and the rendering result is more similar to the visual effect of the real cloth. If the cloth type of the object to be rendered is silk stockings, the rendering parameters corresponding to the cloth type of the object to be rendered are called: the permeability parameters corresponding to the silk stocking types are adjusted, so that the cloth and the skin inside the cloth are rendered as the same material based on the permeability during rendering; invoking a dot product result and a weight parameter of a sight line direction and a normal line direction; and (5) calling roughness mapping parameters corresponding to the silk stocking types.
At present, the existing silk stockings on the market have the effect of being either excessively realistic or excessively cartoon and can not achieve the highlight feeling of real silk stockings, and the cartoon rendering can be rarely combined with the real rendering based on physics, and the special effect of silk stockings materials is added, so that the art requirement of stylized rendering is completed.
Disclosure of Invention
The invention aims to provide a silk stocking object rendering method and device, which are used for solving the technical problems that the existing silk stocking rendering effect in the technology is too realistic or too cartoon can not reach the highlight feeling of the real silk stocking, and the rendering effect is poor.
The first aspect of the present invention provides a silk stocking object rendering method, including:
setting a ramp map with a silk stocking object material adaptive gradual change effect by using a normal line smoothing tool, and performing numerical curve fitting according to the ramp map;
Setting initial parameter information including colors in silk stocking materials according to the ramp mapping to simulate silk stocking attribute information including different colors;
configuring rendering parameters of silk stocking object materials in a shader file, wherein the rendering parameters comprise silk stocking color parameters which are matched with each other according to different normal lines and different sight directions at different positions of the silk stocking object;
And based on the rendering parameters configured in the shader file, combining cartoon rendering with real physical-based rendering, and rendering the silk stocking objects in the three-dimensional model.
Preferably, the color parameters of the silk stockings at different positions of the silk stocking object according to the normal line and the sight line direction to configure the adaptation further include:
Setting corresponding parameter information according to different normal and sight directions to obtain color transition information of the silk stocking object: the part of the silk stocking object perpendicular to the sight line direction is in a skin color, the part of the silk stocking object with the largest angle to the sight line direction is in a darkest color set by color initial parameters, and the gradual process from the skin color to the darkest color is carried out according to the difference between the silk stocking object and the sight line direction angle.
Preferably, setting initial parameter information including color in silk stocking material according to the ramp map further includes:
The initial parameter information of the setting comprises StockingCenterColor parameters and
StockingFallOffColor parameters, setting the StockingCenterColor parameters to be a ramp map for gradual change of skin color and white, and setting StockingFallOffColor parameters to be a ramp map for gradual change of darkest black and white.
Preferably, rendering the silk stocking object in the three-dimensional model further comprises:
Calculating interpolation according to the normal line and the sight line direction;
Mixing StockingCenterColor parameters and StockingFallOffColor parameters on diffuse reflection according to the interpolation to obtain silk stocking color.
Compared with the prior art, the color transition information of the silk stocking object is obtained by setting corresponding parameter information according to different normal and sight directions: the silk stocking object is provided with a part perpendicular to the sight line direction, the part is of skin color, the part with the largest angle of the sight line direction in the silk stocking object is of the darkest color set by the color initial parameter, and the gradual process from the skin color to the darkest color is carried out according to the difference of the angles of the sight line direction in the silk stocking object, so that the rendering effect of the silk stocking object is improved.
In addition, the NPR part is directly embedded into the illumination calculation of the PBR, the light system is used after normalization (linear change of original data, mapping of the data between [0,1 ]) is carried out on diffuse reflection, specular reflection and the like, and because the NPR is embedded into the PBR formula, the precondition of energy conservation is ensured, and therefore, the scene and the roles can be unified into the light system. The method realizes rendering of the cartoon style of the silk stocking object, and optimizes and processes the fusion of the illumination effect of the cartoon style and the environment.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the following description will briefly explain the drawings that are required to be used in the description of the embodiments:
FIG. 1 is a flow chart of a method of rendering a silk stocking object;
FIG. 2 is an exemplary diagram of a silk stocking object map for smooth adjustment;
FIG. 3 is a set-up diagram of original parameters of a silk stocking object;
Fig. 4A and 4B are views of rendering effects of silk stocking objects.
Detailed Description
PBR rendering (physical-based rendering, physicallyBasedRendering), which refers to a collection of rendering techniques that are based, to varying degrees, on basic theories that are more consistent with the physical principles of the real world. The PBR rendering mode derives or simplifies or simulates a series of rendering equations through various mathematical methods and relies on computer hardware and graphics APIs to render a picture that approximates the real world. In the PBR mode, a virtual light source can be generally arranged to simulate a real illumination environment, so that a virtual model under the virtual light source can also show a fine illumination effect to improve the expressive force of a picture obtained by rendering.
Non-real rendering (Non-photorealisticRendering, NPR rendering) is a rendering mode opposite to PBR rendering, mainly simulating the effects of artistic classes, also called stylized rendering. In the NPR rendering mode, the rendering code is usually custom and does not participate in the PBR rendering logic of the engine bottom layer, so that the virtual model in the NPR rendering mode is not affected by the virtual light source, and the NPR rendering has the advantages of being closer to the cartoon feel, easier to make stylized pictures and more attractive. In order to make the silk stocking object of the virtual model in the NPR rendering mode also exhibit the illumination effect, a separate lighting system is generally required for the character, but the PBR rendering mode has illumination conservation, and the general NPR rendering mode is difficult to satisfy, so that the two are used and then have a cracking feeling when appearing in the same picture. How to combine the two together without collision is a relatively big difficulty.
The network game is deeply favored by users because of higher reality, better appreciation and operability of the game scene. The game scene styles of different types of games are different, and rich game scenes are displayed for the user through different stylized rendering, so that the game experience of the user can be effectively improved. Such as a realistic style rendering and a cartoon style rendering, etc., regardless of the rendering style, the rendering of the light and shadow is an important factor affecting the visual effect. The light shadow of the writing style can be calculated according to the surface information of the model and the physical characteristics of illumination, and the light shadow with rich details and fine transition can be obtained generally. The cartoon style has the opposite requirements on the shadow, on one hand, the cartoon style requires that details are not too much, so that the clean feeling of the picture can be destroyed, and on the other hand, the bright-dark transition is hard, and the shadow and the highlight have clear and neat outlines. According to the research, the cartoon rendering adopts a physical rendering-based hand-painted texture and stylized post-processing mode matched with the cartoon style, a Lut image interpolation rendering mode after shadow is fused into illumination, or a double-texture interpolation rendering mode after shadow is fused into illumination to realize the cartoon style rendering. However, although the rendering of the cartoon style of the silk stocking object can be realized, the rendering needs to be further optimized to well support the cartoon effect and optimally process the fusion of the illumination effect of the cartoon style and the environment.
The silk stocking object rendering method provided by the embodiment of the application comprises the following steps:
and S110, setting a ramp map of the silk stocking object material adaptive gradual change effect by using a normal line smoothing tool, and performing numerical curve fitting according to the ramp map.
The silk stocking object information of the model may include silk stocking object surface normal information, which is vertex-based base information. In some possible embodiments, the silk stocking object information may also include coordinate information, color information, vertex (Vertexs) information, primitive (PRIMITIVES) information, fragment (Fragments) information, texture (Texture) information, depth information, and the like of the silk stocking object, without limitation herein.
In this example, when the silk stocking object model is manufactured, the ramp map of the effect of adapting and gradual change of the silk stocking object material quality manufactured by the art at the production end using a normal line smoothing tool (an insert tool written in 3dmax and maya manufacturing software) can be received, as shown in fig. 2.
The vertex normals (for the normal information of each vertex in the modeling data) are adjusted, the adjusted vertex normals are saved in the vertex colors, the ramp maps can be distinguished according to different materials and different thresholds, and the ramp in rendering generally refers to a color gradient effect, and can be used for creating smooth transition effects, such as gradient background, illumination simulation and the like. Referring to fig. 2, a normal line smoothing tool is used to smoothly set up a silk stocking object with an adaptive gradient effect, and modified normal line information of each vertex is stored. The gradual change can generate strong perspective sense and space sense, and the color shade, brightness and the like can be used for smoothly setting each sub-component independently. For cartoon virtual objects, the normal information of each vertex does not store relevant information in the prior art.
Numerical curve fitting processing is carried out on the light source parameters, the fitted curve is controlled through a specific ramp map, and the ramp map can be distinguished according to different materials through rendering program fragments.
And S120, setting initial parameter information including colors in silk stocking materials according to the ramp map so as to simulate silk stocking attribute information comprising different colors.
The initial parameter information for setting the color in the silk stocking material according to the ramp map further comprises: the initial parameter information set includes StockingCenterColor parameters and StockingFallOffColor parameters, the StockingCenterColor parameters are set to be the ramp map for the skin color and white color to fade, and the StockingFallOffColor parameters are set to be the ramp map for the darkest black and white color to fade.
As shown in fig. 3, stockingCenterColor parameters are original parameters of color of the middle position of the silk stockings, which are skin color (flesh or pink) and ramp map of white gradation.
The StockingFallOffColor parameters are the original parameters of the two extreme edges of the silk stockings, which are the darkest black and white ramp maps.
As can be seen from the above, the parameters StockingCenterColor and StockingFallOffColor in the present proposal are dynamic parameters, and the values of the parameters also differ according to the positions of the silk stocking objects, and the original parameters are dynamically changed according to the input ramp map.
And S130, configuring rendering parameters of silk stocking object materials in a shader file, wherein the rendering parameters comprise silk stocking color parameters which are matched according to different normal lines and different sight line directions at different positions of the silk stocking object.
The silk stocking color parameters which are configured to be matched according to the normal line and the sight line direction at different positions of the silk stocking object further comprise:
Setting corresponding parameter information according to different normal and sight directions to obtain color transition information of the silk stocking object: the part of the silk stocking object perpendicular to the sight line direction is in a skin color, the part of the silk stocking object with the largest angle to the sight line direction is in a darkest color set by color initial parameters, and the gradual process from the skin color to the darkest color is carried out according to the difference between the silk stocking object and the sight line direction angle.
The pixel shader control code is as follows:
half3stockingColor=0.0;
#ifdefined(_USE_STOCKING)
stockingColor=lerp(_StockingFalloffColor,
_StockingCenterColor,pow((ShadingModelContext.NoV),
_StockingFalloffPower));
ShadingModelContext.DiffuseColor*=stockingColor;
#endif
Wherein:
The ShaddingModelContext. DiffuseCOlor is the diffuse reflection color of the pixel
StockingColor is calculated silk stocking color, and finally, interpolation is calculated according to normal and line of sight, stockingCenterColor and StockingFallOffColor of art setting are mixed on diffuse reflection according to interpolation, and finally silk stocking color is obtained.
And S140, based on the rendering parameters configured in the shader file, combining cartoon rendering with real physical-based rendering, and rendering the silk stocking objects in the three-dimensional model.
Rendering the silk stocking object in the three-dimensional model further comprises:
Calculating interpolation according to the normal line and the sight line direction; the example calculation interpolation is calculated using the pow function. The Pow (normal line, line of sight direction) calculates the corresponding interpolation, and the normal line can be general normal line information or pre-stored normal line information of a map, and the line of sight direction is an angle range perpendicular to the line of sight and between the extreme edge of the silk stocking object and the line of sight.
Mixing StockingCenterColor parameters and StockingFallOffColor parameters on diffuse reflection according to the interpolation to obtain silk stocking color.
And carrying out corresponding object rendering calculation according to the StockingCenterColor parameters and StockingFallOffColor parameters corresponding to the pixel, namely the parameter information mentioned in the step S120, and taking the mixed parameter information and interpolation of the pixel as diffuse reflection color setting of the pixel.
Fig. 4A-4B are schematic views showing rendering effects of silk stockings according to the present invention.
The cartoon rendering is combined with the real physical-based rendering, the NPR part can be directly embedded into the illumination calculation of the PBR, the diffuse reflection, the specular reflection and the like are respectively normalized (linear change of the original data is mapped between [0,1 ]) and then the ramp is used, and because the NPR is embedded into the PBR formula, the precondition of energy conservation is ensured, so that the scene and the role can unify the lighting system.
Physical-based illumination PBR is a reduction to reality, while NPR is a non-realistic rendering. We can stitch the relevant features to show the effect. The PBR is used for being artistic, and can enable art students to use visual parameters and standardized workflow to quickly realize realistic rendering of a large amount of materials, transfer the characteristics of the NPR into the PPR, and keep the usability. The ambient light and the texture of the PBR brought by the PBR are relatively easy to preserve. The NPR mixed with PBR has a part of cartoon effect and also has the texture of PBR. After the NPR characteristic is modified, the whole PBR calculation flow is not changed, and the direct light and the indirect light are subjected to specular reflection and diffuse reflection superposition.
Different fitting formulas are used for carrying out transition processing on the threshold value, fitting curve information is stored on a ramp map, different material effects are expressed by the curve, the ramp map is mainly used for carrying out numerical curve fitting on four parts of diffuse reflection dark part areas, high light GGX coefficients, ambient light reflection and diffuse reflection dark part areas of an additional light source, and the fitting curve information of the four parts is stored on one ramp.
For a ramp on a two-dimensional plane, both u and v values can be used to represent its position. Typically, u and v have values in the range of [0,1], where (0, 0) represents the lower left corner of the ramp and (1, 1) represents the upper right corner of the ramp. In rendering, the values of u and v may be used to obtain color values for corresponding locations on the ramp. First, the actual coordinates on the ramp are calculated from the values of u and v. Then, sampling is carried out on the ramp texture according to the coordinates, and corresponding color values are acquired.
Curve fitting the thresholds means fitting a function using the pixel values of the ramp map, which is able to map the input thresholds to the corresponding colors.
Specifically, assume that there is a ramp map that contains a series of colors under different thresholds. There is also a set of known thresholds and corresponding ramp map pixel values. From these known data, a functional model is found that can input arbitrary thresholds and output the corresponding colors.
To achieve this goal, a curve fitting method may be used. The goal of curve fitting is to find a functional model that matches as closely as possible to known data points. In this case, a function is found which accepts the threshold as input and outputs the corresponding color.
Common curve fitting methods include polynomial fitting, exponential fitting, logarithmic fitting, and the like. And selecting a proper function model according to actual conditions. The known threshold values and corresponding ramp map pixel values may also be used as training data, parameters of the fitting function are obtained by the fitting process, and these parameters may then be used to calculate the color under any threshold.
In the step, the pixel value of the ramp map is adopted to perform curve fitting on the threshold value, and the v value and the u value of the map are used for sampling, so that the previous code can be adjusted to adapt to new requirements. In this case, it is necessary to provide the sampled data of v and u values and take them as inputs, and perform curve fitting with the pixel values of the ramp map as outputs.
Combining cartoon rendering with real physics-based rendering includes performing a numerical curve fit to the diffuse dark area portion using a ramp map, further comprising:
Determining a v value and a u value of the ramp map, wherein the v value is a preset first fixed value, and the u value takes the value of dot product according to a dark part threshold value and a first fitting constant respectively;
and performing corresponding curve fitting output through the v value and the pixel points of the u value sampling ramp map so as to realize mapping the input threshold value to a corresponding color.
For the dark part threshold part of the diffuse reflection color, the invention takes the v value 0.125 part (the first constant value is 0.125) of the map, the u value takes the value according to the dot product of the dark part threshold value and 0.3333 (the first fitting constant), samples the pixel point of the ramp map, and then carries out corresponding curve fitting on the dark part threshold value. The diffuse reflection color dark portion threshold portion mainly controls transition of a dark portion and a bright portion, and dark portion threshold calculation Shading =shadow NoL (Shadow is a pre-calculation projection, noL is a dot product of a normal line and a light source, and the pre-calculation projection Shadow can be preset at Unity).
The scheme realizes that the strong light-dark contrast is adjusted to soft light-dark transition; then, the first constant value and the first fitting constant can be adjusted according to specific simulation conditions, and the core is that the matching degree between the virtual model and the environment provided by the virtual scene is adjusted, so that the virtual model has cartoon effect and better matches the light and shadow effect in the virtual scene. For example, the example can be implemented by using a simulation model, and the first fixed value and the first fitting constant of different values are adjusted to output a rendering effect diagram. And selecting a rendering effect diagram with high matching degree between the virtual model and the environment provided by the virtual scene from the rendering effect diagram, wherein the corresponding first fixed value and first fitting constant are values adopted by the example.
Combining cartoon rendering with real physics-based rendering includes numerically curve fitting a highlight GGX coefficient portion using a ramp map, further comprising:
Determining a v value and a u value of the ramp map, wherein the v value is a preset second fixed value, and the u value takes a value according to a specular high light GGX coefficient in a D term calculation formula;
And performing corresponding curve fitting output through the pixel points of the v value and the u value sampling ramp map so as to realize mapping of the input highlight GGX coefficient part to the corresponding color.
This step is mainly a normal distribution function D term, such as remapping the range of GGX highlights. The specular reflection specular high light distribution function may be of the type the specular distribution function (BidirectionalReflectanceDistributionFunction, short for BRDF), the specular reflection specular distribution function may be GGX, where GGX may be a specular reflection specular distribution function in BRDF. The effect of the parameters of the specular reflection factor SpecularFactor calculated by GGX in the D term is similar to the simulation of the reflection of light by the material in terms of material, and the artistic effect of the reflection of light in the cartoon is simulated by controlling the ramp to SpecularFactor, so that the transition of the parameters is closer to the drawn feeling.
Briefly, a specular reflection factor (specularfactor) is calculated, the value of which can be related to the cosine value of the angle between the reflected ray and the vector from the point of incidence to the observer. The effect of specular reflection is only visible when this angle is less than 90 degrees, and it is therefore checked whether the value of this specular reflection factor is greater than 0. The final high-light color is obtained by multiplying the illumination color, the specular reflection intensity of the material and the specular reflection factor. The high light color, ambient light color, and diffuse reflected light color are added to give the overall illumination color. Finally this value is multiplied with the sampled value from the texture and the result is taken as the final color of the pixel. I can map the value between [0,1], and find the fine art effect of the through light reflection corresponding to the parameter value of the specular reflection factor SpecularFactor through multiple instances.
Combining cartoon rendering with real physics-based rendering includes numerically curve fitting an ambient light reflecting portion using a ramp map, further comprising:
Determining a v value and a u value of the ramp map, wherein the v value is a preset third fixed value, and the u value takes a value according to coefficients of an ambient light reflection calculation formula respectively;
and performing corresponding curve fitting (fitting by adopting an approximate fitting function of an illumination LUT graph) output through the pixel points of the v value and the u value sampling ramp map so as to realize mapping of the input ambient light reflection part to a corresponding color.
For example, the illumination LUT map stores data on a lookup table LUT. The LUT is further fit into a curved surface, so that the LUT can be directly calculated in a loader, and a primary texture sampling environment is omitted. The coefficients a, B of the light reflection calculation formula, the smoothed ambient light reflection calculation is f= FRESNELRAMP (NoL ×b), where NoL is the dot product of the normal and the light source.
In fitting using an approximate fitting function of the illumination LUT, the incoming parameters B are mapped out in the fitting function after the following computation of b=1.04×a004+r.w, a004=min (r.x×r.x, exp2 (-9.28×nov) ×r.x+r.y).
The parameter B is a coloring model parameter in the ambient light BRDF, and after the calculated F value passes through the ramp, the transition of the reflecting part can be adjusted according to the ramp to simulate the method of drawing the reflection change in the cartoon so as to meet the requirements of art.
Combining cartoon rendering with real physics-based rendering includes performing a numerical curve fit to the diffuse dark area of the additional light source using a ramp map, further comprising:
Determining a v value and a u value of the ramp map, wherein the v value is a preset fourth fixed value, and the u value takes the value of dot product according to the dark area of the additional light source and the second fitting constant respectively;
And (3) performing corresponding curve fitting output on the pixel points of the sampling ramp map so as to realize mapping of the diffuse reflection dark part area of the input additional light source to the corresponding color.
Such as: for the diffuse reflection dark area of the additional light source, we will take the v value of 0.875 of the map, the u value takes the value according to the dot product of the dark area of the additional light source and 0.3333, sample the pixel point of the ramp map, and then make the corresponding mapping smoothing for the ambient light reflection.
Generally, in order to improve the efficiency of real-time rendering, four parts, i.e. a diffuse reflection dark part area, a high-light GGX coefficient, an ambient light reflection and an additional light source diffuse reflection dark part area, are subjected to flattening transition treatment, and the coefficients of the four parts are stored on one ramp.
Combining cartoon rendering with real physics-based rendering may further include normalizing the Unity spherical harmonic illumination brightness, i.e., flattening the spherical harmonic illumination color according to the ratio of brightness of the spherical harmonic illumination color to the spherical harmonic encoding.
And applying the calculated illumination color and intensity to the material. Can be used
The loader, setglobalvector method passes the information of the spherical harmonic illumination map into the shader, thereby enabling the shader to calculate the illumination correctly.
A mature engine Unity has helped us store cubemap processed. There are such a set of variables in Unity:
//SHlightingenvironment
half4unity_SHAr;
half4unity_SHAg;
half4unity_SHAb;
half4unity_SHBr;
half4unity_SHBg;
half4unity_SHBb;
half4unity_SHC;
Here is global illumination encoded with spherical harmonics after integration. Namely Unity does: the environment map cubemap is integrated into a blurred global illumination map, and then the global illumination map is projected onto the basis function of spherical harmonic illumination for storage, wherein seven parameters are the coefficients of the stored basis function. The basis function for Unity is called the third order accompanying legendre polynomial. In this example, units_ SHAr, SHAg, and SHAb are global illuminations encoded with spherical harmonics after integration of units, they represent the brightest direction of spherical harmonics, colD is the color of spherical harmonic illumination, the ratio of the brightness of colD to the brightness of spherical harmonic coding coefficient dominantColor is normalized, and the colD is scaled to the brightness of the brightest direction of spherical harmonics.
An object rendering apparatus, the apparatus comprising:
A silk stocking object rendering, the apparatus comprising:
And a ramp map generating module: the method comprises the steps of setting a ramp map of a silk stocking object material adaptive gradual change effect by using a normal line smoothing tool, and performing numerical curve fitting according to the ramp map;
An initial parameter setting module: the method comprises the steps of setting initial parameter information including colors in silk stocking materials according to a ramp map so as to simulate silk stocking attribute information comprising different colors;
shader file processing module: the rendering parameters are used for configuring silk stocking object materials in the shader file, and comprise silk stocking color parameters which are matched according to different normal lines and different sight directions at different positions of the silk stocking object;
And the rendering module is used for combining cartoon rendering with real physical-based rendering based on the rendering parameters configured in the shader file and rendering the silk stocking objects in the three-dimensional model. This is just a simple example, and the actual fitting process may require more complex model selection and parameter adjustment depending on the actual situation. In addition, curve fitting may be affected by data noise and the number of samples, so that attention is paid to adjustment parameters and data quality in practical applications.

Claims (6)

1.A method of rendering a silk stocking object, comprising:
setting a ramp map with a silk stocking object material adaptive gradual change effect by using a normal line smoothing tool, and performing numerical curve fitting according to the ramp map;
Setting initial parameter information including colors in silk stocking materials according to the ramp map so as to simulate silk stocking attribute information comprising different colors;
configuring rendering parameters of silk stocking object materials in a shader file, wherein the rendering parameters comprise silk stocking color parameters which are matched with each other according to different normal lines and different sight directions at different positions of the silk stocking object;
Based on the rendering parameters configured in the shader file, combining cartoon rendering with real physical-based rendering, and rendering silk stocking objects in the three-dimensional model;
wherein, the silk stocking color parameters of the silk stocking object which are configured to be matched according to the normal line and the sight line direction at different positions further comprise:
Setting corresponding parameter information according to different normal and sight directions to obtain color transition information of the silk stocking object: the part of the silk stocking object perpendicular to the sight line direction is in skin color, the part of the silk stocking object with the largest angle to the sight line direction is in darkest color set by color initial parameters, and the gradual process from the skin color to the darkest color is carried out according to the difference between the silk stocking object and the sight line direction angle;
Wherein, setting initial parameter information including colors in silk stocking materials according to the ramp map further includes:
The set initial parameter information comprises StockingCenterColor parameters and StockingFallOffColor parameters, wherein StockingCenterColor parameters are set as a ramp map for gradual change of skin color and white, stockingFallOffColor parameters are set as a ramp map for gradual change of darkest black and white;
Wherein rendering the silk stocking object in the three-dimensional model further comprises:
Calculating interpolation according to the normal line and the sight line direction;
Mixing StockingCenterColor parameters and StockingFallOffColor parameters according to the interpolation to obtain the color of the silk stockings as the diffuse reflection color.
2. The silk stocking object rendering method according to claim 1, wherein numerical curve fitting is performed on the diffuse reflection dark area portion using a ramp map, comprising:
Determining a v value and a u value of the ramp map, wherein the v value is a preset first fixed value, and the u value takes the value of dot product according to a dark part threshold value and a first fitting constant respectively;
Performing corresponding curve fitting output through the v value and the pixel point of the u value sampling ramp map to realize mapping of an input threshold value to a corresponding color, wherein the dark part threshold value calculation Shading =shadow x NoL, shadow is pre-calculated projection, noL is the dot product of a normal line and a light source direction, and strong light-dark contrast is adjusted to soft light-dark transition; and the first constant value and the first fitting constant can be adjusted, and the adjusting condition is set as the matching degree of the virtual model and the environment provided by the virtual scene.
3. The method of claim 1, wherein numerical curve fitting is performed on the highlight GGX coefficient portion using a ramp map, further comprising:
Determining a v value and a u value of the ramp map, wherein the v value is a preset second fixed value, and the u value takes a value according to a specular high light GGX coefficient in a normal distribution function D item;
And performing corresponding curve fitting output through the pixel points of the v value and the u value sampling ramp map so as to realize mapping of the input highlight GGX coefficient part to the corresponding color.
4. The method of claim 1, wherein fitting a numerical curve to the ambient light reflecting portion using a ramp map, further comprises:
Determining a v value and a u value of the ramp map, wherein the v value is a preset third fixed value, and the u value takes a value according to a coefficient of an ambient light reflection calculation formula;
and performing corresponding curve fitting output through the pixel points of the v value and the u value sampling ramp map so as to realize mapping of the input ambient light reflection part to a corresponding color.
5. The method of claim 1, wherein fitting a numerical curve to the additional light source diffuse dark area using a ramp map, further comprising:
Determining a v value and a u value of the ramp map, wherein the v value is a preset fourth fixed value, and the u value takes the value of dot product according to the dark area of the additional light source and the second fitting constant respectively;
And performing corresponding curve fitting output through the v value and the pixel points of the u value sampling ramp map so as to realize mapping of the diffuse reflection dark part area input into the additional light source to a corresponding color.
6. A silk stocking object rendering device, the device comprising:
And a ramp map generating module: the method comprises the steps of setting a ramp map of a silk stocking object material adaptive gradual change effect by using a normal line smoothing tool, and performing numerical curve fitting according to the ramp map;
An initial parameter setting module: the method comprises the steps of setting initial parameter information including colors in silk stocking materials according to a ramp map so as to simulate silk stocking attribute information comprising different colors;
shader file processing module: the rendering parameters are used for configuring silk stocking object materials in the shader file, and comprise silk stocking color parameters which are matched according to different normal lines and different sight directions at different positions of the silk stocking object;
The rendering module is used for combining cartoon rendering with real physical-based rendering based on the rendering parameters configured in the shader file and rendering silk stocking objects in the three-dimensional model;
wherein, the silk stocking color parameters of the silk stocking object which are configured to be matched according to the normal line and the sight line direction at different positions further comprise:
Setting corresponding parameter information according to different normal and sight directions to obtain color transition information of the silk stocking object: the part of the silk stocking object perpendicular to the sight line direction is in skin color, the part of the silk stocking object with the largest angle to the sight line direction is in darkest color set by color initial parameters, and the gradual process from the skin color to the darkest color is carried out according to the difference between the silk stocking object and the sight line direction angle;
Wherein, setting initial parameter information including colors in silk stocking materials according to the ramp map further includes:
The set initial parameter information comprises StockingCenterColor parameters and StockingFallOffColor parameters, wherein StockingCenterColor parameters are set as a ramp map for gradual change of skin color and white, stockingFallOffColor parameters are set as a ramp map for gradual change of darkest black and white;
Wherein rendering the silk stocking object in the three-dimensional model further comprises:
Calculating interpolation according to the normal line and the sight line direction;
Mixing StockingCenterColor parameters and StockingFal lOffColor parameters according to the interpolation to obtain the color of the silk stockings as the diffuse reflection color.
CN202310830098.2A 2023-07-07 2023-07-07 Silk stocking object rendering method and device Active CN116883580B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310830098.2A CN116883580B (en) 2023-07-07 2023-07-07 Silk stocking object rendering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310830098.2A CN116883580B (en) 2023-07-07 2023-07-07 Silk stocking object rendering method and device

Publications (2)

Publication Number Publication Date
CN116883580A CN116883580A (en) 2023-10-13
CN116883580B true CN116883580B (en) 2024-06-18

Family

ID=88257969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310830098.2A Active CN116883580B (en) 2023-07-07 2023-07-07 Silk stocking object rendering method and device

Country Status (1)

Country Link
CN (1) CN116883580B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113052947A (en) * 2021-03-08 2021-06-29 网易(杭州)网络有限公司 Rendering method, rendering device, electronic equipment and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109887062B (en) * 2019-03-14 2023-05-16 网易(杭州)网络有限公司 Rendering method, device, equipment and storage medium
EP3772040A1 (en) * 2019-07-30 2021-02-03 Reactive Reality AG Method and computer program product for producing 3-dimensional model data of a garment
US11276227B2 (en) * 2019-12-24 2022-03-15 Tencent Technology (Shenzhen) Company Limited Object rendering method and apparatus, storage medium, and electronic device using a simulated pre-integration map
CN111009026B (en) * 2019-12-24 2020-12-01 腾讯科技(深圳)有限公司 Object rendering method and device, storage medium and electronic device
CN111369658B (en) * 2020-03-24 2024-02-02 北京畅游天下网络技术有限公司 Rendering method and device
CN113012273B (en) * 2021-03-24 2022-07-12 网易(杭州)网络有限公司 Illumination rendering method, device, medium and equipment based on target model
CN114299203A (en) * 2021-12-16 2022-04-08 网易(杭州)网络有限公司 Processing method and device of virtual model
CN116206006A (en) * 2023-03-02 2023-06-02 达瓦未来(北京)影像科技有限公司 Card style direct illumination effect rendering method based on UE rendering engine

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113052947A (en) * 2021-03-08 2021-06-29 网易(杭州)网络有限公司 Rendering method, rendering device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN116883580A (en) 2023-10-13

Similar Documents

Publication Publication Date Title
CN110599574B (en) Game scene rendering method and device and electronic equipment
d'Eon et al. Efficient rendering of human skin
Lu et al. Illustrative interactive stipple rendering
JP4276178B2 (en) Method for digital rendering of skin or similar
CN112316420B (en) Model rendering method, device, equipment and storage medium
US6593924B1 (en) Rendering a non-photorealistic image
US7864176B2 (en) Translucent object rendering methods and apparatus
US9619920B2 (en) Method and system for efficient modeling of specular reflection
CN109035381B (en) Cartoon picture hair rendering method and storage medium based on UE4 platform
US7859530B2 (en) Subsurface rendering methods and apparatus
US20070139408A1 (en) Reflective image objects
US7176918B2 (en) Three-dimensional paint projection weighting of diffuse and scattered illumination methods and apparatus
Bruckner et al. Hybrid visibility compositing and masking for illustrative rendering
Suarez et al. Real-time 3D rendering with hatching
CN116363288A (en) Rendering method and device of target object, storage medium and computer equipment
CN116883580B (en) Silk stocking object rendering method and device
Mattausch et al. Freeform shadow boundary editing
Vanderhaeghe et al. Dynamic stylized shading primitives
CN117252982A (en) Material attribute generation method and device for virtual three-dimensional model and storage medium
US20030025706A1 (en) System and method for rendering a texture map utilizing an illumination modulation value
CN117078838B (en) Object rendering method and device, storage medium and electronic equipment
Kubo et al. Curvature-dependent reflectance function for interactive rendering of subsurface scattering
CN116883567A (en) Fluff rendering method and device
Martin et al. Rendering silhouettes with virtual lights
CN113096229B (en) Real-time rendering method of glittering fabric in realistic clothing rendering

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