CN113096230B - Real-time rendering method of laser fabric in realistic clothing rendering - Google Patents

Real-time rendering method of laser fabric in realistic clothing rendering Download PDF

Info

Publication number
CN113096230B
CN113096230B CN202110426717.2A CN202110426717A CN113096230B CN 113096230 B CN113096230 B CN 113096230B CN 202110426717 A CN202110426717 A CN 202110426717A CN 113096230 B CN113096230 B CN 113096230B
Authority
CN
China
Prior art keywords
rendering
laser
input
color
values
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
CN202110426717.2A
Other languages
Chinese (zh)
Other versions
CN113096230A (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.)
Zhejiang Lingdi Digital Technology Co ltd
Original Assignee
Zhejiang Lingdi Digital 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 Zhejiang Lingdi Digital Technology Co ltd filed Critical Zhejiang Lingdi Digital Technology Co ltd
Priority to CN202110426717.2A priority Critical patent/CN113096230B/en
Publication of CN113096230A publication Critical patent/CN113096230A/en
Application granted granted Critical
Publication of CN113096230B publication Critical patent/CN113096230B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/80Shading

Abstract

The invention discloses a real-time rendering method of a laser fabric in realistic clothing rendering, which comprises the following steps: (1) calculating to obtain five fixed color values after hue shift according to the five fixed color values input by the user and the hue shift coefficient input by the user; (2) calculating an observation coefficient according to an included angle between the observation direction of the camera and the normal direction of the observed fabric; (3) establishing a scatter diagram by taking five constants determined in advance as input values and five fixed color values after hue shift as output values, then taking an observation coefficient as an input value, and acquiring output color values, namely laser color values, by using an interpolation method; (4) calculating according to the laser color value and the laser smoothness input by a user to obtain a laser part rendering result; (5) and calculating to obtain a final rendering result value according to the laser weight input by the user and the original rendering result value obtained by using the rendering calculation based on physics.

Description

Real-time rendering method of laser fabric in realistic clothing rendering
Technical Field
The invention relates to the technical field of real-time rendering, in particular to a real-time rendering method of a laser fabric in realistic clothing rendering.
Background
The laser fabric is a complex material with special optical characteristics. The pattern of the fabric changes along with the change of the included angle between the observation direction and the normal line of the fabric. A recently popular laser fabric is mainly used for manufacturing down jackets and other coats and has pure color changing effects in different degrees. The principle of the laser fabric is similar to that of light beam laser paper, and different colors are corresponding to different diffraction angles through the grating, so that the characteristic that the color gradually changes along with the observation angle is realized. The essence of the principle is a holographic illumination technique.
And the graphics library program programming interface called by the fabric real-time rendering is OpenGL. OpenGL is a cross-language, cross-platform application programming interface for rendering 2D, 3D vector graphics. OpenGL exists in Windows, part of UNIX platforms and Mac OS, and utilizes graphics acceleration hardware to efficiently implement rendering. These implementations are typically provided by the display device vendor and are very dependent on the hardware provided by the vendor. The method strictly regulates the execution and output of each function in the graphic library, encapsulates the internal implementation of the functions of the graphic library, and is one of the common programming interfaces of the graphic library. The invention mainly relates to the fragment shader programming part of OpenGL, and the programming language of the fragment shader is GLSL language.
The rendering method for real-time rendering of the fabric is forward rendering. Unlike delayed rendering, forward rendering can achieve the final rendering result with only one rendering. The weakness of forward rendering compared to delayed rendering is that forward rendering does not handle the multiple light sources well, whereas garment rendering can better satisfy the light source effect due to the purpose of rendering garments in a smaller range. The forward rendering has the advantages of high speed, small occupied display memory and more suitability for the real-time rendering of complex rendering. The one-time rendering of the forward rendering mainly comprises the steps of vertex data transmission, vertex coloring, surface subdivision, geometric coloring, fragment subpackaging, fragment elimination, rasterization, fragment coloring, testing, mixing and the like. The present invention programs the fragment shader process in the rendering process, mainly to calculate the final color of each pixel.
The calculation method used for real-time rendering of the fabric is an improved method based on physical rendering (PBR). The physically based rendering differentiates the outgoing light into scattered and reflected components and follows the law of conservation of energy for calculation. The method considers the micro-surface distribution characteristics of the interface and the Fresnel effect, so that the rendering result is closer to reality, and the method is the most common rendering calculation method. But this method is mainly applicable to relatively simple surfaces and to materials that are less refractive or opaque.
At present, the mainstream rendering model based on physics simplifies the surface structure of the material into a micro-surface model, so that the laser phenomenon generated by tiny illumination on the surface of the laser fabric can not be considered. The laser fabric has unique optical characteristics due to the unique micro-surface structure, and is difficult to cover by a universal rendering model. At present, most of realistic garment simulation software in China does not support real-time rendering of laser fabric, the principle and rendering of laser materials are in a rational discussion stage and are not enough in connection with practical application, and no method can be used for achieving the rendering effect of the laser fabric by using the existing material model of the software.
Disclosure of Invention
Aiming at the technical problems and the defects in the field, the invention provides a real-time rendering method of a laser fabric in realistic clothing rendering, which can render the laser fabric in real time and the reality of the laser fabric meets the application requirements. The rendering result obtained by the rendering method ensures the reality and real-time performance of the rendering of the laser fabric.
A real-time rendering method of a laser fabric in realistic clothing rendering comprises the following steps:
(1) calculating to obtain five fixed color values after hue shift according to the five fixed color values input by the user and the hue shift coefficient input by the user;
(2) calculating an observation coefficient according to an included angle between the observation direction of the camera and the normal direction of the observed fabric;
(3) establishing a scatter diagram by taking five constants determined in advance as input values and five fixed color values after hue shift as output values, then taking an observation coefficient as an input value, and acquiring output color values, namely laser color values, by using an interpolation method;
(4) calculating according to the laser color value and the laser smoothness input by a user to obtain a laser part rendering result;
(5) and calculating to obtain a final rendering result value according to the laser weight input by the user and the original rendering result value obtained by using the rendering calculation based on physics.
The hue shift process in step (1) is to keep the lightness and saturation of the five fixed color values input by the user unchanged and only modify the hue.
In the step (2), the calculation formula of the observation coefficient is as follows:
x'=(1-n·v),
where x' represents an observation coefficient, and n · v represents a dot product of the normal direction of the observed fabric and the observation direction of the camera.
In step (3), the five fixed color values after hue shift are used as output values corresponding to five predetermined constants serving as input values, and the laser color values are obtained by linear interpolation calculation using the observation coefficients as input values, where:
color value f corresponding to the five constantscolor(xi) Comprises the following steps:
fcolor(xi)=Ci,i=1,2,...5,
in the formula, xiRepresents said five constants in terms of x1<x2<x3<x4<x5In the order of (A) CiDenotes xiThe corresponding five fixed color values after hue shift;
the color values corresponding to the other function input values x are calculated as follows:
Figure GDA0003554759010000031
fcolor(x)=αmix·fcolor(xi)+(1-αmix)·fcolor(xi+1),
wherein the content of the first and second substances,xi<x<xi+1,αmixweight factor, f, representing interpolationmixRepresenting a function of the weight factor for computing the interpolation.
In a preferred embodiment, x1~x50, 0.05, 0.15, 0.30 and 0.65 in sequence.
In the step (4), the calculation method of the laser part rendering result is the same as the physical-based rendering (PBR):
Cres=fPBR(CbaseColor,m,r),
wherein, CresColor value representing rendering result of laser part, fPBRRepresenting a physics-based rendering, CbaseColorRepresenting texture color values, m representing metallization, r representing smoothness;
and when calculating the rendering result of the laser part, replacing texture color values in the physical rendering by using the laser color values, replacing smoothness in the physical rendering by using laser smoothness input by a user, and replacing the metal degree in the physical rendering by 1.0.
In the step (5), a calculation formula of the final rendering result value is as follows:
Cfinal=(1-α)Corigin+α·Claser
wherein: cfinalRepresenting a final rendering result value; coriginRepresenting the original rendering result value; claserRepresenting a color value of a rendering result of the laser part; alpha represents the laser weight entered by the user.
In the step (5), according to the metal degree, smoothness and texture color value input by the user, an original rendering result value is obtained by using rendering calculation based on physics.
Compared with the prior art, the invention has the main advantages that:
1. the calculation method capable of rendering the laser fabric in real time is realized, and the sense of reality can meet the application requirements.
2. The five color values adjusted by a user and the laser smoothness and weight are independent from each other, and the adjustment is visual and flexible; adding hue shifts facilitates color adjustment.
Drawings
Fig. 1 is a schematic flow chart of a laser fabric rendering result according to an embodiment of the present invention;
fig. 2 is a schematic diagram of corresponding input values (i.e., observation coefficients) of the visualized laser colors in S2 shown in fig. 1;
fig. 3 is a distribution diagram of laser colors calculated in S3 shown in fig. 1;
fig. 4 is a schematic diagram of a result of rendering the laser part in S4 shown in fig. 1;
fig. 5 is a schematic diagram of a final rendering result in S5 shown in fig. 1.
Detailed Description
The invention is further described with reference to the following drawings and specific examples. It should be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. The following examples are conducted under conditions not specified, usually according to conventional conditions, or according to conditions recommended by the manufacturer.
As shown in fig. 1, the method for real-time rendering of laser fabric in realistic clothing rendering according to the embodiment includes the steps of:
s1, calculating five fixed color values after hue shift according to the five fixed color values input by the user and the hue shift coefficient input by the user;
s2, calculating an observation coefficient according to an included angle between the observation direction of the camera and the normal direction of the observed fabric;
s3, establishing a scatter diagram by taking five constants determined in advance as input values and five fixed color values after hue shift as output values, then taking an observation coefficient as an input value, and acquiring output color values, namely laser color values, by using an interpolation method;
s4, calculating according to the laser color value and the laser smoothness input by the user to obtain a laser part rendering result;
and S5, calculating to obtain a final rendering result value according to the laser weight input by the user and the original rendering result value obtained by using the rendering calculation based on physics.
A specific spherical laser fabric is taken as an example for explanation:
the hue shift process in step S1 is to modify only the hue by keeping the lightness and saturation of the five fixed color values input by the user unchanged. If the hue shift is zero, no calculation is necessary.
In step S2, the calculation formula of the observation coefficient is as follows:
x'=(1-n·v),
where x' represents an observation coefficient, and n · v represents a dot product of the normal direction of the observed fabric and the observation direction of the camera. The calculated observation coefficients are shown in FIG. 2
In step S3, the five fixed color values after hue shift are used as output values, which correspond to five predetermined constants as input values, and the laser color values are obtained by linear interpolation calculation using the observation coefficients as input values, where:
color value f corresponding to the five constantscolor(xi) Comprises the following steps:
fcolor(xi)=Ci,i=1,2,...5,
in the formula, xiRepresents said five constants in terms of x1<x2<x3<x4<x5In sequence of (C)iDenotes xiThe corresponding five fixed color values after hue shift;
the color values corresponding to the other function input values x are calculated as follows:
Figure GDA0003554759010000061
fcolor(x)=αmix·fcolor(xi)+(1-αmix)·fcolor(xi+1),
wherein x isi<x<xi+1,αmixWeight factor, f, representing interpolationmixRepresenting a function of the weight factor for computing the interpolation.
In this example, x1~x50, 0.05, 0.15, 0.30 and 0.65 in sequence. The calculated color distribution map is shown in fig. 3.
In step S4, the method for calculating the result of the laser partial rendering is the same as the method for physically-based rendering:
Cres=fPBR(CbaseColor,m,r),
wherein, CresColor value representing rendering result of laser part, fPBRRepresenting a physics-based rendering, CbaseColorRepresenting texture color values, m representing metallization, r representing smoothness;
and when calculating the rendering result of the laser part, replacing texture color values in the physical rendering by using the laser color values, replacing smoothness in the physical rendering by using laser smoothness input by a user, and replacing the metal degree in the physical rendering by 1.0. The calculated rendering result of the laser part is shown in fig. 4.
In step S5, the final rendering result value is calculated as follows:
Cfinal=(1-α)Corigin+α·Claser
wherein: cfinalRepresenting a final rendering result value; coriginRepresenting an original rendering result value, and rendering according to the metal degree, smoothness and texture color value input by a user by adopting a PBR rendering method; claserRepresenting a color value of a rendering result of the laser part; alpha represents the laser weight entered by the user. The final rendering result obtained by the calculation is shown in fig. 5.
Furthermore, it should be understood that various changes or modifications can be made by those skilled in the art after reading the above description of the present invention, and equivalents also fall within the scope of the invention defined by the appended claims.

Claims (6)

1. A real-time rendering method of a laser fabric in realistic clothing rendering is characterized by comprising the following steps:
(1) calculating to obtain five fixed color values after hue shift according to the five fixed color values input by the user and the hue shift coefficient input by the user;
(2) calculating an observation coefficient according to an included angle between the observation direction of the camera and the normal direction of the observed fabric; the calculation formula of the observation coefficient is as follows:
x'=(1-n·v),
wherein x' represents an observation coefficient, and n · v represents a dot product of a normal direction of the observed fabric and an observation direction of the camera;
(3) establishing a scatter diagram by taking five constants determined in advance as input values and five fixed color values after hue shift as output values, then taking an observation coefficient as an input value, and acquiring output color values, namely laser color values, by using an interpolation method;
the five fixed color values after hue shift are used as output values corresponding to five constants determined in advance as input values, and the laser color values are obtained by linear interpolation calculation with the observation coefficients as input values, wherein:
color value f corresponding to the five constantscolor(xi) Comprises the following steps:
fcolor(xi)=Ci,i=1,2,...5,
in the formula, xiRepresents said five constants in terms of x1<x2<x3<x4<x5In the order of (A) CiDenotes xiThe corresponding five fixed color values after hue shift;
the color values corresponding to the other function input values x are calculated as follows:
Figure FDA0003554758000000011
fcolor(x)=αmix·fcolor(xi)+(1-αmix)·fcolor(xi+1),
wherein x isi<x<xi+1,αmixWeight factor, f, representing interpolationmixA function representing a weight factor for calculating an interpolation;
(4) calculating according to the laser color value and the laser smoothness input by a user to obtain a laser part rendering result;
(5) and calculating to obtain a final rendering result value according to the laser weight input by the user and the original rendering result value obtained by using the rendering calculation based on physics.
2. The real-time laser fabric rendering method in realistic clothing rendering according to claim 1, wherein the hue shift process in the step (1) is to change only the hue by keeping the lightness and the saturation of the five fixed color values input by the user unchanged.
3. The method of claim 1, wherein x is the real-time rendering method of the laser fabric in the realistic clothing rendering1~x50, 0.05, 0.15, 0.30 and 0.65 in sequence.
4. The real-time rendering method for laser fabric in realistic garment rendering according to claim 1, wherein in step (4), the calculation method of the rendering result of the laser part is the same as that of the rendering based on physics:
Cres=fPBR(CbaseColor,m,r),
wherein, CresColor value representing rendering result of laser part, fPBRRepresenting a physics-based rendering, CbaseColorRepresenting texture color values, m representing metallization, r representing smoothness;
and when calculating the rendering result of the laser part, replacing texture color values in the physical rendering by using the laser color values, replacing smoothness in the physical rendering by using laser smoothness input by a user, and replacing the metal degree in the physical rendering by 1.0.
5. The real-time laser fabric rendering method in realistic clothing rendering according to claim 1, wherein in the step (5), the final rendering result value is calculated according to the following formula:
Cfinal=(1-α)Corigin+α·Claser
wherein: cfinalRepresenting a final rendering result value; coriginRepresenting the original rendering result value; claserRepresenting a color value of a rendering result of the laser part; alpha represents the laser weight entered by the user.
6. The method of claim 1, wherein in step (5), the original rendering result value is obtained by a physical-based rendering calculation according to the metal degree, smoothness and texture color value inputted by the user.
CN202110426717.2A 2021-04-20 2021-04-20 Real-time rendering method of laser fabric in realistic clothing rendering Active CN113096230B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110426717.2A CN113096230B (en) 2021-04-20 2021-04-20 Real-time rendering method of laser fabric in realistic clothing rendering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110426717.2A CN113096230B (en) 2021-04-20 2021-04-20 Real-time rendering method of laser fabric in realistic clothing rendering

Publications (2)

Publication Number Publication Date
CN113096230A CN113096230A (en) 2021-07-09
CN113096230B true CN113096230B (en) 2022-06-10

Family

ID=76679364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110426717.2A Active CN113096230B (en) 2021-04-20 2021-04-20 Real-time rendering method of laser fabric in realistic clothing rendering

Country Status (1)

Country Link
CN (1) CN113096230B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201417978D0 (en) * 2014-10-10 2014-11-26 Aveva Solutions Ltd Image rendering of laser scan data
CN108109194A (en) * 2017-12-29 2018-06-01 广东工业大学 The realization method and system of laser paper effect in virtual reality scenario
CN111862254A (en) * 2020-07-17 2020-10-30 福建天晴数码有限公司 Cross-rendering platform based material rendering method and system
CN112668178A (en) * 2020-12-25 2021-04-16 浙江凌迪数字科技有限公司 Fabric physical attribute measuring method in realistic clothing simulation

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050174349A1 (en) * 2004-02-05 2005-08-11 Watson Brian S. Image rendering apparatus with print preview projection mechanism
CN105658869B (en) * 2013-09-19 2018-12-11 莱沃拉泽有限责任公司 Generate the fabric for being used to handle the system and method for the pattern on surface of fabric by laser irradiation and being created by it

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201417978D0 (en) * 2014-10-10 2014-11-26 Aveva Solutions Ltd Image rendering of laser scan data
CN108109194A (en) * 2017-12-29 2018-06-01 广东工业大学 The realization method and system of laser paper effect in virtual reality scenario
CN111862254A (en) * 2020-07-17 2020-10-30 福建天晴数码有限公司 Cross-rendering platform based material rendering method and system
CN112668178A (en) * 2020-12-25 2021-04-16 浙江凌迪数字科技有限公司 Fabric physical attribute measuring method in realistic clothing simulation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Introduction of Potassium Permanganate spray with Laser Treatment to Achieve Improved Fading and Mechanical Properties of Denim Fabric;Muhammad Abdur Rashid;《Journal of Textile and Apparel Technology and Management》;20201231;全文 *
郭亮.实时虚拟服装渣染系统.《中国优秀硕士论文电子期刊网》.2016, *

Also Published As

Publication number Publication date
CN113096230A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
US10540810B2 (en) System and method of rendering a graphical object with modification in structure
US20050041024A1 (en) Method and apparatus for real-time global illumination incorporating stream processor based hybrid ray tracing
US20060176302A1 (en) Visible surface determination system &amp; methodology in computer graphics using interval analysis
CN108961373B (en) Hair rendering method and terminal
JP2002236938A (en) Surface shading method using texture map stored on the basis of bidirectional reflection distribution function
Stark et al. Barycentric parameterizations for isotropic BRDFs
Merlo et al. 3D model visualization enhancements in real-time game engines
Engel et al. Interactive high-quality volume rendering with flexible consumer graphics hardware.
US6297833B1 (en) Bump mapping in a computer graphics pipeline
JP2692783B2 (en) System and method for generating a two-dimensional representation of a three-dimensional object
CN113096230B (en) Real-time rendering method of laser fabric in realistic clothing rendering
CN113112582B (en) Real-time rendering method of sidelight fabric in realistic clothing rendering
Nielsen Real Time Rendering of| Atmospheric Scattering Effects for Flight Simulators
AU2017228700A1 (en) System and method of rendering a surface
Yuan X. Yuan
CN113096229B (en) Real-time rendering method of glittering fabric in realistic clothing rendering
US20180005432A1 (en) Shading Using Multiple Texture Maps
CN117058301B (en) Knitted fabric real-time rendering method based on delayed coloring
CN117437345B (en) Method and system for realizing rendering texture specular reflection effect based on three-dimensional engine
Kim et al. Surface Model and Scattering Analysis for Realistic Game Character
JP2004054634A (en) Picture processor and its method
Ilett Introduction to Shaders in Unity
Doggett Programmability features of graphics hardware
Tuliniemi Physically based rendering for embedded systems
Robb et al. Real-Time Per-pixel Rendering of Bump-mapped Textures Captured using Photometric Stereo.

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