CN116883580A - Silk stocking object rendering method and device - Google Patents
Silk stocking object rendering method and device Download PDFInfo
- Publication number
- CN116883580A CN116883580A CN202310830098.2A CN202310830098A CN116883580A CN 116883580 A CN116883580 A CN 116883580A CN 202310830098 A CN202310830098 A CN 202310830098A CN 116883580 A CN116883580 A CN 116883580A
- Authority
- CN
- China
- Prior art keywords
- rendering
- silk stocking
- value
- color
- ramp
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/50—Lighting effects
- G06T15/80—Shading
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
Technical Field
The embodiment of the application 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.
Beijing free travel world network technology Co., ltd discloses a rendering method (application number 202010214140.4) comprising: 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 application 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 application 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 set initial parameter information includes StockingCenterColor parameter and StockingCenterColor parameter
The StockingFallOffcolor parameter is set to be the ramp map for the skin color and white color gradation, and the StockingFallOffcolor parameter is set to be the ramp map for the darkest black and white color gradation.
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;
and mixing the StockingCenterColor parameter and the StockingFallOffColor parameter on diffuse reflection according to the interpolation to obtain the color of the silk stockings.
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 application, 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), 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-realistic rendering (NPR rendering) is a rendering mode that is opposed 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 further include coordinate information, color information, vertex (vertex) information, primitive (Primitives) information, fragment (Fragments) information, texture (Texture) information, depth information, and the like of the silk stocking object, which are not limited 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 set initial parameter information includes a stopcenter color parameter and a stopfall offcolor parameter, the stopcenter color parameter is set as a ramp map for gradual change of skin color and white, and the stopfall offcolor parameter is set as a ramp map for gradual change of darkest black and white.
As shown in fig. 3, the stockingcenter color parameter is the original parameter of the color of the middle position of the silk stocking, which is the skin color (flesh or pink) and the ramp map of the white gradient.
The StockingFallOffcolor parameter is the original parameter of the extreme edges of the silk stockings, which is the darkest black and white gradient of the ramp map.
From the above, the stockingcenter color parameter and the stockingFallOffcolor parameter in the present proposal are dynamic parameters, and the values of the parameters are different 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
And finally, calculating interpolation according to the normal line and the line of sight, mixing the StockingCenterColor and StockingFallOffColor which are set by the art on diffuse reflection according to the interpolation, and finally obtaining the color of the silk stockings.
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.
And mixing the StockingCenterColor parameter and the StockingFallOffColor parameter on diffuse reflection according to the interpolation to obtain the color of the silk stockings.
The corresponding object rendering calculation is performed according to the parameter information mentioned in step S120, which is the corresponding stockingcenter color parameter and the stockingfall offcolor parameter of the pixel, and the diffuse reflection color setting of the pixel is obtained by mixing the two parameter information and the interpolation.
Fig. 4A-4B are schematic views showing rendering effects of silk stockings according to the present application.
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 application 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 the dark portion threshold value is calculated by shading=shadow NoL (Shadow is a pre-calculated projection, noL is a dot product of a normal line and a light source, and the pre-calculated 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 highlight distribution function may be a specular highlight the bi-directional reflectance distribution function (bidirectory reflectance distribution function, abbreviated as 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 specular reflection factor specularly factor parameter calculated by GGX in the item D is similar to the simulation of the reflection of light by the material in terms of the material, and the artistic effect of the reflection of light in the cartoon is simulated by controlling specularly factor through ramp, so that the transition of the specularly factor parameter is closer to the drawn feeling.
Briefly, a specular reflection factor (speculfactor) 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 through multiple instances to correspond to the specular factor parameter value.
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=fresnel ramp (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 the cube process. 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: integrating the environment map cube into a fuzzy global illumination map, and projecting the global illumination map onto a base function of spherical harmonic illumination for storage, wherein seven parameters are coefficients of the stored base function. The basis function for Unity is called the third order accompanying legendre polynomial. In this example, units_shar, units_shag, units_shab are global illumination coded by spherical harmonics after units integration, 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 dominintcolor is normalized, and colD is scaled to the brightness in 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 (9)
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 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.
2. The method of rendering a silk stocking object according to claim 1, wherein the configuration of the adaptive silk stocking color parameters at different positions of the silk stocking object according to the normal and the line of sight direction further comprises:
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.
3. The silk stocking object rendering method according to claim 1 or 2, wherein setting initial parameter information including colors in silk stocking materials according to a ramp map further comprises:
the set initial parameter information includes a stopcenter color parameter and a stopfall offcolor parameter, the stopcenter color parameter is set as a ramp map for gradual change of skin color and white, and the stopfall offcolor parameter is set as a ramp map for gradual change of darkest black and white.
4. A silk stocking object rendering method according to claim 3, 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;
and mixing the StockingCenterColor parameter and the StockingFallOffColor parameter on diffuse reflection according to the interpolation to obtain the color of the silk stockings.
5. The silk stocking object rendering method of claim 1, wherein combining cartoon rendering with real physics-based rendering further comprises performing numerical curve fitting on the diffuse 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 u value sampling pixel points of the ramp map so as to map an input threshold value to a corresponding color, wherein the dark part threshold value is calculated by shading=shadow NoL, shadow is a pre-calculated projection, noL is a 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 conditions are set to provide environment matching degree for the virtual model and the virtual scene.
6. The method of claim 1, wherein combining the cartoon rendering with the real physics-based rendering further comprises 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.
7. The method of claim 1, wherein combining the cartoon rendering with the real physics-based rendering further comprises performing a numerical curve fit to the 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 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.
8. The method of claim 1, wherein combining the cartoon rendering with the real physics-based rendering further comprises performing a numerical curve fit 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.
9. 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.
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 true CN116883580A (en) | 2023-10-13 |
CN116883580B 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 (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109887062A (en) * | 2019-03-14 | 2019-06-14 | 网易(杭州)网络有限公司 | Rendering method, device, equipment and storage medium |
CN111009026A (en) * | 2019-12-24 | 2020-04-14 | 腾讯科技(深圳)有限公司 | Object rendering method and device, storage medium and electronic device |
CN111369658A (en) * | 2020-03-24 | 2020-07-03 | 北京畅游天下网络技术有限公司 | Rendering method and device |
CN113012273A (en) * | 2021-03-24 | 2021-06-22 | 网易(杭州)网络有限公司 | Illumination rendering method, device, medium and equipment based on target model |
US20210192838A1 (en) * | 2019-12-24 | 2021-06-24 | Tencent Technology (Shenzhen) Company Limited | Object rendering method and apparatus, storage medium, and electronic device |
CN113052947A (en) * | 2021-03-08 | 2021-06-29 | 网易(杭州)网络有限公司 | Rendering method, rendering device, electronic equipment and storage medium |
CN114299203A (en) * | 2021-12-16 | 2022-04-08 | 网易(杭州)网络有限公司 | Method and device for processing virtual model |
US20220189095A1 (en) * | 2019-07-30 | 2022-06-16 | Reactive Reality Ag | Method and computer program product for producing 3 dimensional model data of a garment |
CN116206006A (en) * | 2023-03-02 | 2023-06-02 | 达瓦未来(北京)影像科技有限公司 | A card-style direct lighting effect rendering method based on UE rendering engine |
-
2023
- 2023-07-07 CN CN202310830098.2A patent/CN116883580B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109887062A (en) * | 2019-03-14 | 2019-06-14 | 网易(杭州)网络有限公司 | Rendering method, device, equipment and storage medium |
US20220189095A1 (en) * | 2019-07-30 | 2022-06-16 | Reactive Reality Ag | Method and computer program product for producing 3 dimensional model data of a garment |
CN111009026A (en) * | 2019-12-24 | 2020-04-14 | 腾讯科技(深圳)有限公司 | Object rendering method and device, storage medium and electronic device |
US20210192838A1 (en) * | 2019-12-24 | 2021-06-24 | Tencent Technology (Shenzhen) Company Limited | Object rendering method and apparatus, storage medium, and electronic device |
CN111369658A (en) * | 2020-03-24 | 2020-07-03 | 北京畅游天下网络技术有限公司 | Rendering method and device |
CN113052947A (en) * | 2021-03-08 | 2021-06-29 | 网易(杭州)网络有限公司 | Rendering method, rendering device, electronic equipment and storage medium |
CN113012273A (en) * | 2021-03-24 | 2021-06-22 | 网易(杭州)网络有限公司 | Illumination rendering method, device, medium and equipment based on target model |
CN114299203A (en) * | 2021-12-16 | 2022-04-08 | 网易(杭州)网络有限公司 | Method and device for processing virtual model |
CN116206006A (en) * | 2023-03-02 | 2023-06-02 | 达瓦未来(北京)影像科技有限公司 | A card-style direct lighting effect rendering method based on UE rendering engine |
Non-Patent Citations (1)
Title |
---|
WESLEY13: "Unity中的仿真丝袜渲染", pages 1 - 6, Retrieved from the Internet <URL:https://www.helloworld.net/p/0106480712> * |
Also Published As
Publication number | Publication date |
---|---|
CN116883580B (en) | 2024-06-18 |
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 | |
JP4276178B2 (en) | Method for digital rendering of skin or similar | |
Lu et al. | Illustrative interactive stipple rendering | |
US9619920B2 (en) | Method and system for efficient modeling of specular reflection | |
CN112316420A (en) | Model rendering method, device, equipment and storage medium | |
US6593924B1 (en) | Rendering a non-photorealistic image | |
US7864176B2 (en) | Translucent object rendering methods and apparatus | |
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 | |
Okabe et al. | Illumination brush: Interactive design of all-frequency lighting | |
Suarez et al. | Real-time 3D rendering with hatching | |
CN117671125A (en) | Illumination rendering method, device, equipment and storage medium | |
CN116883567B (en) | Fluff rendering method and device | |
Vanderhaeghe et al. | Dynamic stylized shading primitives | |
CN116883580B (en) | Silk stocking object rendering method and device | |
Bruckner et al. | Hybrid visibility compositing and masking for illustrative rendering | |
CN117911600A (en) | Method and device for generating stylized hand-drawing effect, storage medium and electronic device | |
CN117252982A (en) | Material attribute generation method and device for virtual three-dimensional model and storage medium | |
CN117078838B (en) | Object rendering method and device, storage medium and electronic equipment | |
CN118674853B (en) | Three-dimensional model surface skin rendering method, system, storage medium and equipment | |
Öhrn | Different mapping techniques for realistic surfaces | |
Zhang et al. | InstantSticker: Realistic Decal Blending via Disentangled Object Reconstruction | |
Johnson et al. | A survey of Shading Techniques for Facial Deformations on Sign Language Avatars |
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 |