Three-dimensional realistic real-time simulation method suitable for jacquard warp-knitted fabric

By generating real-time 3D realistic simulations of jacquard warp-knitted fabrics using Catmull-Rom spline curves and GPU hardware acceleration, the problems of low efficiency and insufficient realism in existing technologies are solved, and the correct representation of fiber-level details and light interaction is achieved.

CN120852670APending Publication Date: 2025-10-28XIAMEN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511011132.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency and insufficient realism in 3D modeling and simulation rendering of jacquard warp-knitted fabrics. In particular, they cannot achieve real-time simulation and cannot accurately represent fiber-level details and the interaction between light and yarn.

Method used

A 3D coil model is built using Catmull-Rom spline curves, and fiber-level details are generated using GPU hardware acceleration. The shadow occlusion effect is simulated through the physical interaction principle between light and fiber material, and the fiber curve is shaded using a bidirectional curve reflection distribution function.

Benefits of technology

It achieves real-time 3D realistic simulation of jacquard warp-knitted fabrics, improving the speed and realism of the simulation, and can accurately represent fiber-level details and light interaction behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120852670A_ABST
    Figure CN120852670A_ABST
Patent Text Reader

Abstract

The invention discloses a three-dimensional realistic real-time simulation method suitable for jacquard warp-knitted fabric, and belongs to the technical field of computer graphics. Comprising the following steps: analyzing an execution signal file of an industrial jacquard knitting machine and translating the execution signal file into yarn laying numerical codes; modeling a single three-dimensional coil model on the basis of a Catmull-Rom spline curve; calculating the arrangement and tension simulation of each coil of the whole cloth according to the yarn laying numerical code; gPU hardware is used for accelerating generation of fiber-level details; simulating a shadow shielding phenomenon in the cloth; and performing physics-based rendering on the fiber-grade model on the basis of the bidirectional curve scattering distribution function. The problems that a traditional three-dimensional simulation method is long in consumed time and low in speed when large jacquard cloth is subjected to three-dimensional simulation are solved, and the problems that the trueness is low and the credibility is low when three-dimensional knitted cloth is subjected to simulation rendering are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer graphics technology, specifically relating to a real-time simulation method for three-dimensional realism of jacquard warp-knitted fabrics. Background Technology

[0002] Jacquard warp-knitted fabrics are complex patterned fabrics produced on warp knitting machines using jacquard technology. Their core characteristic is the use of a jacquard device to control the movement of the warp yarns, achieving intricate pattern designs. Because the complex patterns of the finished product require multiple rounds of modification, adjustment, and trial knitting before finalization, this process incurs significant material and time costs. Therefore, a realistic fabric simulation system is needed to accurately simulate the fabric's appearance in advance for industry professionals, thereby reducing the number of trial knitting attempts, lowering production costs, and improving production efficiency. Currently, domestic research on jacquard warp-knitted fabric simulation mainly focuses on two-dimensional offline simulation, which has limited simulation effects, lacks realism, and cannot achieve real-time simulation (simulating an image takes less than 30ms).

[0003] In 3D modeling of jacquard warp-knitted fabrics, a common approach is to first establish an ideal loop model using spline curves as the basic structural unit formed by the forward movement of the yarn needle. Then, the loops are arranged according to the current fabric's padding yarn number, and extension lines are established between the loops to connect them, thus obtaining a preliminary 3D model of the jacquard warp-knitted fabric. However, most existing 3D modeling methods are only suitable for small-sized and relatively simple fabric types. For larger jacquard fabrics with complex stitch variations, explicitly modeling every possible basic jacquard warp-knitted structure is impractical. Furthermore, the loop shifting phenomenon caused by yarn tension within the fabric is not well described.

[0004] In the simulation and rendering of jacquard warp-knitted fabrics, curve-based methods take the fabric's microstructural units (such as yarns) as the research object and use spline curves to describe the three-dimensional spatial distribution of these microstructural units. Existing 3D fabric models are often based on triangular meshes on the CPU and use cylindrical pipes to model individual yarns. The expressive effect is limited, and it cannot reproduce the detailed information of the fabric at the fiber level, nor can it correctly represent the correct interaction behavior of light with these curves. When the fabric size is large, it also occupies a lot of memory space, and the time required to complete the simulation rendering is very long, which cannot achieve the speed of real-time simulation. Summary of the Invention

[0005] The purpose of this invention is to solve the above-mentioned technical problems existing in the prior art and provide a real-time simulation method for three-dimensional realism of jacquard warp-knitted fabrics. Starting from the machine execution signal of the jacquard warp knitting machine, the jacquard warp-knitted fabric is accurately modeled at the three-dimensional yarn level, then fiber-level geometric details are generated, and finally the material interaction behavior of light and fiber is considered, and visual effects such as shadow occlusion are simulated, thereby achieving real-time simulation of three-dimensional realism of jacquard warp-knitted fabrics.

[0006] To achieve the above-mentioned objectives, the present invention provides the following technical solutions.

[0007] A real-time simulation method for three-dimensional realism of jacquard warp-knitted fabrics includes the following steps:

[0008] Step 1: Using the machine execution signal file of the Jacquard warp knitting machine as input, translate it into yarn padding numbers;

[0009] Step 2: Use Catmull-Rom spline curves to build a single three-dimensional coil model;

[0010] Step 3: Calculate the arrangement and offset rules of each loop based on the yarn padding number;

[0011] Step 4: Using procedural generation methods and GPU hardware acceleration, fiber curves are generated in real time in the subdivision shader, and the fiber curves are modeled as quadrilateral meshes in the geometry shader.

[0012] Step 5: Achieve shadow occlusion effect. Control the ambient light occlusion inside the yarn based on the distance between the fiber vertex and the center point of the yarn. Determine the self-shadow inside the yarn by the position of the fiber vertex in the direction of light travel. Achieve shadow effect between yarns through shadow mapping of the yarn-level model.

[0013] Step 6: Based on the physical interaction principle between light and fabric fiber material, establish a bidirectional curve reflection distribution function for coloring the fiber curve.

[0014] Furthermore, in step 1, it is necessary to correctly read the machine execution signal file stored in hexadecimal format. The header of the file records the fabric's process parameters, such as the number of stitches, the number of timings, and the basic yarn padding number, while the load section records the Jacquard offset value of each yarn in each timing sequence.

[0015] First, read all the information in the file header; the first byte of the file header stores the file protocol version number, the second byte stores the number of Jacquard combs, the third and fourth bytes store the number of needles, and the fifth and sixth bytes store the timing number. Next, based on the number of Jacquard combs, read the basic yarn padding number of each Jacquard comb in groups of eight bytes; at this point, the information in the file header has been read.

[0016] Next, the information in the file payload is read; each Jacquard offset value occupies one binary bit. In the same time sequence, the offset values ​​of the same Jacquard comb are stored together, followed by the storage of offset values ​​of other Jacquard combs. After all Jacquard comb offset values ​​in this time sequence have been stored, the storage work for the next time sequence is performed. Therefore, the formula for calculating the starting address of the Jacquard offset value storage for any Jacquard comb at any given time is:

[0017] P Z,i =6+8N jac +(N jac ·S-4+i)·(Z / 8) (1)

[0018] Where Z is the total number of needles, i is the current Jacquard comb sequence number, S is the current time sequence number, and N is the number of needles. jac Given the total number of Jacquard combs, read Z / 8 binary bits each time and associate these binary bits with each yarn. Add these bits to the basic yarn padding number in groups of eight timing values. This gives the actual yarn padding number for each yarn.

[0019] Furthermore, in step 2, a single three-dimensional coil model is described using a series of adjustable mathematical curves, and the coil model is stored in the form of Catmull-Rom spline curve control points.

[0020] First, establish a local spatial coordinate system for the coil. Place the coil model at the origin of this coordinate system. Decompose the coil model into two parts: an arc and a cylinder. Observing the coil from the positive z-axis of the local spatial coordinate system, the arc is set to an elliptical arc shape, and the cylinder is set to a straight line. Observing from the negative x-axis, the arc is a straight line making a certain angle with the z-axis, while the cylinder is a parabola. The center point of the arc coincides with the origin of the local spatial coordinate system. The mathematical expression of the arc curve is:

[0021]

[0022] Where a and b are the major and minor axes of the ellipse, respectively, and α loop It is the angle between the arc and the negative z-axis; the mathematical expression for the cylindrical parabola is:

[0023]

[0024] Among them, h p This is an adjustable parameter used to control the curvature of the cylindrical parabola;

[0025] Then, a certain number of discrete vertices are calculated based on the mathematical expressions of the arcs and cylinders mentioned above, and these vertices are directly regarded as the control points of the Catmull-rom spline curve; thus, the modeling of a single three-dimensional coil is completed.

[0026] Furthermore, in step 3, the arrangement position and force offset of the coils are determined by the padding yarn numbers of each coil; in the world space coordinate system, the front side of the fabric is made coplanar with the xoy plane, then the three-dimensional space coordinates P of each coil are... loop (x, y, z) is calculated using the following formula:

[0027]

[0028] Among them, f i,j With b i,j Let w represent the loop at the j-th row of the i-th yarn, where i is the current yarn number, j is the current row number, w is the reference spacing between two adjacent yarns, h is the spacing between two adjacent rows, r is the yarn radius, and n is the number of yarns. jac F is the Jacquard comb number currently being processed. i,j The offset value caused by the force on the loop at the j-th row of the i-th yarn is calculated using the following formula:

[0029]

[0030] And it is stipulated that F 1,0 =0, where p i,j Let j·h be the position at the starting point of the i-th yarn, moving j·h distance in the yarn-threading direction. Through this set of mathematical formulas, the theoretical three-dimensional spatial coordinates of any loop in the fabric can be obtained. Then, using these coordinates as the origin of the local spatial coordinate system of the loop, the coordinates of the Catmull-Rom spline curve control points of any loop in the world spatial coordinate system can be obtained based on the three-dimensional model of a single loop. At this point, the yarn-level geometric modeling of the fabric is completed, and the three-dimensional coordinate values ​​of the Catmull-Rom spline curve control points describing each yarn have been generated.

[0031] Furthermore, in step 4, the GPU hardware is used to quickly generate fiber-level details from the yarn-level model in real time. Each fiber curve is represented by a quadrilateral strip composed of a series of triangles. For any point P on the yarn curve obtained by Catmull-Rom spline interpolation... yarn Let the tangent at that point be the z-axis, and the cross section perpendicular to the tangent be the xoy plane. Within this plane, take two vectors as the x-axis and y-axis, such that the x, y, and z coordinate axes are mutually perpendicular to each other, forming an orthogonal basis. This determines the yarn space coordinate system, with its origin at P. yarn ;

[0032] First, generate all the plies within a yarn; in the yarn space coordinate system, the mathematical expression for the plies is as follows:

[0033]

[0034] Where, rply P is the center point of the strand on the xoy plane. ply With the yarn center point P yarn The distance between them, α ply The twist of the strand controls the degree of torsion of the strand spiral. θ ply Let P be the line segment yarn P ply The initial angle with the x-axis, where i is the current stock number, and r is the angle between the stock and the x-axis. ply The total number of plies within a single yarn;

[0035] Subsequently, all fiber curves are generated for each strand. First, the starting vertex position of each fiber curve is determined, and then any point on the curve is calculated based on the mathematical expression of the fiber. A strand spatial coordinate system is established, with the center point of the strand curve as the origin and the tangent at that point as the z-axis. In the xoy plane, with the origin of the coordinate system as the center, r... ply Define a circular region with radius, randomly sample a vertex within this circular region, and calculate its distance to the center point P of the line. ply distance r fiber and the angle θ between it and the x-axis fiber , will r fiber Substituting into the fiber existence probability formula p(r) fiber Calculate the probability p that a fiber vertex exists at this point. fiber Then, using rejection sampling, a sample p is randomly drawn from a uniform distribution of 0-1. pass , if and only if p fiber ≥p pass If the sampling is successful, the sampling point is retained; otherwise, the point should be discarded and the sampling process repeated. The fiber existence probability formula is p(r). fiber The mathematical expression for ) is as follows:

[0036]

[0037] Where ε and β are physical parameters describing the fiber distribution of different fabric materials, obtained through actual measurement and statistics; after obtaining the initial vertex position of the fiber, any point on the fiber curve is calculated according to the following mathematical formula:

[0038]

[0039] Where, α fiber Controlling fiber twist, r min and r max is the scaling factor, used to control the theoretical maximum and minimum distances from the center point of the fiber curve to the center point of the strand curve, and s is used to control the rate of distance change.

[0040] Finally, each fiber vertex is calculated in real time in the GPU's subdivision shader according to the above mathematical formula, and the line segment is modeled as a quadrilateral patch in the geometry shader. The spline curve control points describing the yarn are used as input, and four control points are used as a patch input to the subdivision control shader. The subdivision level is set to control the number of fiber curves generated by the curve and the number of interpolations between two control points. In the subdivision evaluation shader, each yarn vertex is interpolated according to the Catmull-Rom spline curve formula and the tangent at that point is calculated. Then, a yarn space coordinate system is established and all ply centerline vertices are calculated according to formula (6). Then, the tangent of each ply centerline vertex is calculated and all fiber centerline vertices are calculated according to formulas (7) and (8). The line segment is output as a primitive to the geometry shader. In the geometry shader, the fiber center point is offset by a certain distance as the width of the quadrilateral patch by the normal direction obtained by the cross product of the viewing direction and the fiber curve tangent direction. Triangles are used as the output primitives of the geometry shader. Thus, the work of generating fiber-level details in real time using the GPU is completed.

[0041] Furthermore, in step 5, the physical phenomenon of actual fabric shading observed in reality is broken down into three independent calculation items: ambient light shading within the yarn, self-shading within the yarn, and shadow between yarns.

[0042] First, calculate the ambient light shading term within the yarn; based on the current fiber curve centerline vertex P... fiber to the vertex P of the center line of the yarn curve yarn The intensity of ambient light shading is calculated from the distance d. ao Its numerical expression is:

[0043]

[0044] Next, calculate the self-shadowing term within the yarn; project the illumination direction onto the xoy plane of the yarn spatial coordinate system, and use the projected direction as the x-axis, retaining the z-axis of the yarn spatial coordinate system and the origin of the xoy plane, then cross-multiply to obtain the y-axis. Establish a light source-yarn spatial coordinate system using these three coordinate axes and the origin, and then use the coordinates P of all fiber vertices calculated in step 4. fiber Projecting the coordinates onto the light source-yarn space coordinate system yields a new three-dimensional spatial coordinate value P. lf , by P lf The x-coordinate determines the intensity I of the self-shading term within the yarn. self :

[0045]

[0046] Finally, calculate the inter-yarn shading term; modify the subdivision control shader parameters so that the number of generated fibers is 1, and set r... ply and rfiber All values ​​are 0. In the subdivision evaluation shader, only the Catmull-rom spline curve is interpolated to obtain several yarn vertices. Then, in the geometry shader, the line segment is modeled with a radius equal to r. ply +r max r fiber The cylindrical pipe is used to generate a shadow map using the classic computer graphics shadow algorithm, ShadowMap. The shadow intensity I between the yarns can be sampled using UV coordinates. map ;

[0047] The ambient light shading term I within the yarn was calculated separately. ao Yarn Inner Shading Item I self Shading between yarns I map Then, when performing shading in the fragment shader, the calculation formula considering the shadow occlusion effect should be:

[0048] I res =I ao *I self *I map *I0 (11)

[0049] Where I0 is the albedo of the fiber, which is determined by the material properties of the fabric. res The fiber color is calculated after taking into account the shadow occlusion effect; at this point, the shadow occlusion effect inside the fabric is completed.

[0050] Furthermore, in step 6, a bidirectional curve scattering distribution function suitable for the fiber curve is established, and the colored fiber color I is calculated for each fiber fragment in the fragment shader based on this function. fiber ;

[0051] First, taking the tangent line of the fiber curve at the colored point as the z-axis, two directions are determined in the plane perpendicular to the z-axis as the x-axis and y-axis, respectively, such that the three coordinate axes x, y, and z are mutually perpendicular, thus establishing the fiber space coordinate system. For any direction ω in this coordinate system, find the angle θ between it and the xoy plane and the angle φ of rotation about the z-axis in the xoy plane. The transformation between the three-dimensional coordinates ω(x, y, z) in the fiber space coordinate system and the coordinates ω(θ, φ) in the spherical coordinate system is determined by the following mathematical formula:

[0052]

[0053] Next, the interaction between light and fiber material is divided into two categories: one is the phenomenon where light is reflected in a certain lobe direction when it reaches the fiber surface, called the R term; the other is the phenomenon where light penetrates the entire fiber after two consecutive refractions, called the TT term. This invention considers these two phenomena to occur independently at angles θ and φ, therefore both results are obtained by multiplying the results of the two angle calculations, and the final result of the interaction between light and fiber is obtained by adding the R term and the TT term. For the R term, it is assumed that the angle θ of the reflected light follows a normal distribution, with the mean value being the ideal specular reflection direction of the incident light about the xoy plane, while the angle φ is uniformly distributed. The specific mathematical description is as follows:

[0054]

[0055] Where, θ i Let θ be the angle between the incident light and the xoy plane. o Let φ be the angle between the emitted light and the xoy plane. i Let φ be the angle of rotation of the incident light in the xoy plane. o Let β be the angle of rotation of the emitted light in the xoy plane. R F is used to control the width of the reflected light's lobes at angle θ. R (θ i The mathematical expression for the approximate calculation of Fresnel reflection is:

[0056] F R (θ i ) = C R +(1-C R (1-cosθ) i ) 5 (14)

[0057] Among them, C R For θ i The initial value when = 0 is obtained from actual measurements and table lookup based on the fabric material type; while The normalized normal distribution is expressed as follows:

[0058]

[0059] Similarly, define the mathematical expression for the TT term:

[0060]

[0061] Where I0(x) is the modified 0th-order Bessel function, β TT γ is used to control the width of the transmitted light's lobes at angle θ. TT C is used to control the width of the transmitted light lobes distributed at angle φ. TTThe light color used to control the transmission term; based on the R and TT terms defined above, the final mathematical expression of the bidirectional curve scattering distribution function is determined as follows:

[0062] f s (w i w o ) = M R (θ i θ o )N R (φ i , φ o )+M TT (θ i θ o )N TT (φ i , φ o (17)

[0063] Finally, the bidirectional curve scattering distribution function is introduced into the real-time rendering calculation process, and the lighting is split into direct lighting and indirect lighting. For direct lighting, the L values ​​of each light source are directly accumulated. i The contribution of light from indirect lighting is assumed to be the total intensity L of all indirect light sources that contribute to the current shading point. amb If the same applies in all directions, the rendering equation can be rewritten as follows:

[0064]

[0065] For the direct lighting portion, since information about each direct light source can be obtained during shading, the calculation is performed in real time in the fragment shader. For the indirect lighting portion, the integral needs to be calculated at certain light emission angles on the CPU, stored as a one-dimensional texture, and then the integral value is obtained by mapping the emission angle to uv coordinates in the fragment shader and participating in the calculation. At this point, the work of establishing the bidirectional curve scattering distribution function and correctly calculating the shading is completed.

[0066] This invention addresses the limitations of current three-dimensional realistic simulation of jacquard warp-knitted fabrics. It correctly models the three-dimensional yarn-level model of the fabric using mathematical and geometric calculations, and achieves highly realistic real-time three-dimensional simulation based on the statistical laws of fiber distribution, GPU hardware acceleration, and a rendering process based on bidirectional curve scattering distribution function. This solves the problems of lack of realism and credibility in current computer simulation results of jacquard warp-knitted fabrics, as well as slow simulation speed. Attached Figure Description

[0067] Figure 1 This is a flowchart illustrating an embodiment of the present invention.

[0068] Figure 2 These are front and side views of a single 3D coil model.

[0069] Figure 3 This is a rendering of a 3D fabric model at the yarn level.

[0070] Figure 4 This is a schematic diagram showing the fiber-level detail effect.

[0071] Figure 5 This is a diagram illustrating the shadow occlusion effect.

[0072] Figure 6 This is a comparison chart of physically based rendering effects. Detailed Implementation

[0073] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. The technical solutions of the present invention can be implemented by those skilled in the art using computer software technology.

[0074] Combination Figure 1 This invention provides a real-time 3D realistic simulation method for jacquard warp-knitted fabrics, specifically including the following steps:

[0075] Step 1: Read and translate the machine execution signal file into a digital format.

[0076] Step 2: Use spline curves to build a single three-dimensional coil model.

[0077] Step 3: Determine the arrangement rules of each coil and the effect of tension.

[0078] Step 4: Use GPU hardware acceleration to generate fiber-level fabric models.

[0079] Step 5: Simulate shadows and occlusion effects inside the fabric.

[0080] Step 6: Perform physical-based coloring on the fiber profile.

[0081] The following examples illustrate the processing steps in detail: The examples use machine execution signal files used in industry as input to test the method of the present invention.

[0082] In step 1, this embodiment takes a machine execution signal file for single Jacquard single-needle bed knitting fabric as input, and reads and translates the first byte of the file in hexadecimal format to obtain the file protocol version number as 1, the second byte to obtain the number of Jacquard combs as 1, the third and fourth bytes to obtain the number of needles as 296, and the fifth and sixth bytes to obtain the timing number as 2080.

[0083] The next 8 bytes yield the basic chain block of the Jacquard comb: 1-0-1-1-1-2-1-1. The Jacquard offset information is read. Each Jacquard offset occupies one binary bit. In the same time sequence, the offsets of the same Jacquard comb are stored together, followed by the offsets of other Jacquard combs. After all Jacquard comb offsets in the current time sequence have been stored, the storage work for the next time sequence begins. Therefore, the formula for calculating the starting address of the Jacquard offset for any Jacquard comb at any given time is:

[0084] P Z,i =6+8N jac +(N jac ·S-4+i)·(Z / 8) (1)

[0085] Where Z is the total number of needles, i is the current Jacquard comb sequence number, S is the current time sequence number, and N is the number of needles. jac This represents the total number of Jacquard combs. In this embodiment, a two-dimensional array is used to store the padding numbers of all yarns in the fabric. For a subarray storing the padding number of each yarn, the eight-bit basic chain block value is tiled and copied so that the length of the subarray matches the timing value. Using each current timing value as the subarray index, Z / 8 binary bits are read each time, and these binary bits are added in sequential order to the value obtained from the current index of the subarray for each yarn, thereby obtaining the actual padding number of each yarn.

[0086] In step 2, combined Figure 2 In this embodiment, a single three-dimensional coil model is decomposed into two parts: an arc and a cylinder. Viewing the coil from the positive z-axis of the local spatial coordinate system, the arc is set as an elliptical arc, and the cylinder as a straight line. Viewed from the negative x-axis, the arc is a straight line forming a certain angle with the z-axis, while the cylinder is a parabola. The center point of the arc coincides with the origin of the local spatial coordinate system. The mathematical expression for the arc curve is:

[0087]

[0088] Where a and b are the major and minor axes of the ellipse, respectively, and α loop It is the angle between the arc and the negative z-axis. The mathematical expression for the cylindrical parabola is:

[0089]

[0090] Where h p This is an adjustable parameter used to control the curvature of the cylindrical parabola. Then, based on the above mathematical expression, four x-coordinate values ​​are uniformly sampled within the range -a ≤ x ≤ a and substituted into the calculation to obtain four discrete points as the vertices of the arc. Within the range -a ≤ x ≤ -a... p and a pThree x-coordinate values ​​are uniformly sampled within the range ≤x≤a and substituted into the calculation to obtain a total of 6 discrete points as the vertices of the two coil pillars. These vertices are then stored sequentially in the order of left coil pillar-coil arc-right coil pillar to obtain the Catmull-Rom spline curve control points of a single three-dimensional coil model.

[0091] In step 3, the arrangement and force offset of the coils are determined by the yarn padding numbers of each coil. In the world space coordinate system, the fabric face is made coplanar with the xoy plane; therefore, the three-dimensional spatial coordinates P of each coil are... loop (x,y,z) is calculated using the following formula:

[0092]

[0093] Among them, f i,j With b i,j Let w represent the loop at the j-th row of the i-th yarn, where i is the current yarn number, j is the current row number, w is the reference spacing between two adjacent yarns, h is the spacing between two adjacent rows, r is the yarn radius, and n is the number of yarns. jac F is the Jacquard comb number currently being processed. i,j The offset value caused by the force on the loop at the j-th row of the i-th yarn is calculated using the following formula:

[0094]

[0095] And it is stipulated that F 1,0 =0, where p i,j Let j·h be the position at which the yarn moves a distance j·h from the starting point of the i-th yarn in the direction of yarn threading. Using this set of mathematical formulas, the theoretical three-dimensional spatial coordinates of any loop in the fabric can be obtained. Then, using these coordinates as the origin of the local spatial coordinate system of the loop, the coordinates of the Catmull-Rom spline curve control points of any loop in the world spatial coordinate system can be obtained based on the three-dimensional model of a single loop.

[0096] In this embodiment, the final arrangement and tension changes of all loops on the same yarn are calculated in a bottom-up order, and the control points of each loop model are sequentially stored in the yarn subarray. Then, each yarn is processed in the same way from left to right. At this point, the three-dimensional coordinate values ​​of the control points of the Catmull-Rom spline curve describing each yarn have been generated. The color attribute of all yarns is set to magenta, and each yarn is modeled as a cylindrical pipe in the geometry shader using OpenGL tools and rendered to obtain the yarn-level three-dimensional model of the fabric. The resulting image is shown below. Figure 3 As shown, while accurately reflecting the fabric pattern, it also correctly calculates the mesh structure caused by tension.

[0097] In step 4, GPU hardware is used to quickly generate fiber-level details from the yarn-level model in real time. Each fiber curve is represented by a series of quadrilateral strips composed of triangles. For any point P on the yarn curve obtained using Catmull-Rom spline interpolation... yarn Let the tangent at that point be the z-axis, and the cross section perpendicular to the tangent be the xoy plane. Within this plane, take two vectors as the x-axis and y-axis, such that the x, y, and z coordinate axes are mutually perpendicular to each other, forming an orthogonal basis. This determines the yarn space coordinate system, with its origin at P. yarn .

[0098] First, generate all the plies within a yarn. The mathematical expression for a ply in the yarn space coordinate system is as follows:

[0099]

[0100] Where, r ply P is the center point of the strand on the xoy plane. ply With the yarn center point P yarn The distance between them, α ply The twist of the strand controls the degree of torsion of the strand spiral. θ ply Let P be the line segment yarn P ply The initial angle with the x-axis, where i is the current stock number, and r is the angle between the stock and the x-axis. ply This refers to the total number of plies within a single yarn.

[0101] Subsequently, all fiber curves are generated for each strand. First, the starting vertex position of each fiber curve is determined, and then any point on the curve is calculated based on the mathematical expression of the fiber. A strand spatial coordinate system is established, with the center point of the strand curve as the origin and the tangent at that point as the z-axis. In the xoy plane, with the origin of the coordinate system as the center, r... ply Define a circular region with radius, randomly sample a vertex within this circular region, and calculate its distance to the center point P of the line. ply distance r fiber and the angle θ between it and the x-axis fiber , will r fiber Substituting into the fiber existence probability formula p(r) fiber Calculate the probability p that a fiber vertex exists at this point. fiber Then, using rejection sampling, a sample p is randomly drawn from a uniform distribution of 0-1. pass , if and only if p fiber ≥p pass If the sampling is successful, the sampling point is retained; otherwise, the point should be discarded and the sampling process repeated. The fiber existence probability formula is p(r). fiber The mathematical expression for ) is as follows:

[0102]

[0103] Where ε and β are physical parameters describing the fiber distribution of different fabric materials, obtained through actual measurement and statistics. After obtaining the initial vertex position of the fiber, any point on the fiber curve is calculated using the following mathematical formula:

[0104]

[0105] Where, α fiber Controlling fiber twist, r min and r max is a scaling factor used to control the theoretical maximum and minimum distances from the center point of the fiber curve to the center point of the strand curve, and s controls the rate of change of the distance.

[0106] Finally, each fiber vertex is calculated in real time in the GPU's subdivision shader according to the above mathematical formula, and the line segment is modeled as a quadrilateral face in the geometry shader.

[0107] Using the spline curve control points describing the yarn as input, four control points are packaged into a patch and input into the subdivision control shader. The subdivision level is set to control the number of fiber curves generated by the curve and the number of interpolations between two control points. In this embodiment, the two parameters are set to 3 and 64 respectively. In the subdivision evaluation shader, each yarn vertex is interpolated according to the Catmull-Rom spline curve formula and the tangent at that point is calculated. Then, a yarn space coordinate system is established and all ply centerline vertices are calculated according to formula (6). Then, the tangent of each ply centerline vertex is calculated and all fiber centerline vertices are calculated according to formulas (7) and (8). The line segments are output as primitives to the geometry shader. In the geometry shader, the fiber center point is offset by 0.02 units as the width of the quadrilateral patch by the normal direction obtained by the cross product of the viewing direction and the fiber curve tangent direction. Triangles are used as the output primitives of the geometry shader. Thus, the work of generating fiber-level details in real time using the GPU is completed. In order to better display the fiber-level detail effect, Figure 4 Using an open-source knitted fabric model with more pronounced yarn overlap patterns as input, this invention renders a fabric simulation image with fiber-level detail. It's important to note that this invention supports any 3D model of a yarn-level knitted fabric described using Catmull-Rom splines as input.

[0108] In step 5, the physical phenomenon of shadow occlusion inside the actual fabric observed in reality is broken down into three independent calculation items: ambient light occlusion inside the yarn, self-shadow inside the yarn, and shadow between yarns.

[0109] First, calculate the ambient light shading term within the yarn. This is based on the current fiber curve centerline vertex P. fiber to the vertex P of the center line of the yarn curve yarn The intensity of ambient light shading is calculated from the distance d. ao Its numerical expression is:

[0110]

[0111] Next, calculate the self-shadowing term within the yarn. Project the illumination direction onto the xoy plane of the yarn spatial coordinate system, using the projected direction as the x-axis, preserving the z-axis of the yarn spatial coordinate system and the origin of the xoy plane, and then cross-multiplying to obtain the y-axis. Establish a light source-yarn spatial coordinate system using these three coordinate axes and the origin. Then, use the coordinates P of all fiber vertices calculated in step 4... fiber Projecting the coordinates onto the light source-yarn space coordinate system yields a new three-dimensional spatial coordinate value P. lf , by P lf The x-coordinate determines the intensity I of the self-shading term within the yarn. self :

[0112]

[0113] Finally, calculate the inter-yarn shading term. Modify the subdivision control shader parameters so that the number of fibers generated is 1, and set r... ply and r fiber All values ​​are 0. In the subdivision evaluation shader, only the Catmull-rom spline curve is interpolated to obtain several yarn vertices. Then, in the geometry shader, the line segment is modeled with a radius equal to r. ply +r max r fiber The cylindrical pipe is used to generate a shadow map using the classic computer graphics shadow algorithm, ShadowMap. The shadow intensity I between the yarns can be sampled using UV coordinates. map .

[0114] The ambient light shading term I within the yarn was calculated separately. ao Yarn Inner Shading Item I self Shading between yarns I map Then, when performing shading in the fragment shader, the calculation formula considering the shadow occlusion effect should be:

[0115] I res =I ao *I self *I map *I0 (11)

[0116] Where I0 is the albedo of the fiber, which is determined by the material properties of the fabric. In this embodiment, to facilitate the demonstration of the shadow occlusion effect, I0 = (1.0, 1.0, 1.0);res The fiber color was calculated after taking into account the shadow occlusion effect. At this point, the shadow occlusion effect inside the fabric is complete. Figure 5 The illustrations show the effects of having no shadow occlusion, only ambient occlusion, only yarn shadows, only inter-yarn shadows, and all shadow occlusion enabled.

[0117] In step 6, a bidirectional curve scattering distribution function suitable for the fiber curve is established, and the fiber color I after coloring is calculated for each fiber fragment in the fragment shader according to this function. fiber .

[0118] First, taking the tangent line of the fiber curve at the colored point as the z-axis, two directions are defined in a plane perpendicular to the z-axis as the x-axis and y-axis, respectively, such that the x, y, and z coordinate axes are mutually perpendicular, thus establishing the fiber space coordinate system. For any direction ω in this coordinate system, find the angle θ between it and the xoy plane, and the angle φ of rotation about the z-axis in the xoy plane. The transformation between the three-dimensional coordinates ω(x, y, z) in the fiber space coordinate system and the coordinates ω(θ, φ) in the spherical coordinate system is determined by the following mathematical formula:

[0119]

[0120] Next, the interaction between light and fiber material is divided into two categories: one is the phenomenon where light is reflected in a certain lobe direction when it reaches the fiber surface, called the R term; the other is the phenomenon where light penetrates the entire fiber after two consecutive refractions, called the TT term. This invention considers these two phenomena to occur independently at angles θ and φ, therefore both results are obtained by multiplying the calculated results of the two angles, and the final result of the interaction between light and fiber is obtained by adding the R term and the TT term. For the R term, it is assumed that the angle θ of the reflected light follows a normal distribution, with the mean value being the ideal specular reflection direction of the incident light about the xoy plane, while the angle φ is uniformly distributed. The specific mathematical description is as follows:

[0121]

[0122] Where, θ i Let θ be the angle between the incident light and the xoy plane. o Let φ be the angle between the emitted light and the xoy plane. i Let φ be the angle of rotation of the incident light in the xoy plane. o Let β be the angle of rotation of the emitted light in the xoy plane. R The width of the reflected light lobes at angle θ is used to control the distribution of the lobes. In this embodiment, β is taken as the lobes. R =1.0, F R (θ i The mathematical expression for the approximate calculation of Fresnel reflection is:

[0123] F R (θ i ) = C R +(1-C R (1-cosθ) i ) 5 (14)

[0124] Among them, C R For θ i The initial value when C = 0 is obtained from actual measurement and table lookup based on the fabric material type. In this embodiment, C is determined by looking up the table. R = (0.989, 0.959, 0.874). And... The normalized normal distribution is expressed as follows:

[0125]

[0126] Similarly, define the mathematical expression for the TT term:

[0127]

[0128] Where I0(x) is the modified 0th-order Bessel function, β TT γ is used to control the width of the transmitted light's lobes at angle θ. TT C is used to control the width of the transmitted light lobes distributed at angle φ. TT Used to control the color of light transmitted, in this embodiment, β is taken. TT =27.197, take γ TT =38.269, take C TT = (0.999, 0.999, 0.999). Based on the R and TT terms defined above, the final mathematical expression of the bidirectional curvilinear scattering distribution function is determined as follows:

[0129] f s (w i w o ) = M R (θ i θ o )N R (φ i , φ o )+M TT (θ i θ o )N TT (φ i , φ o (17)

[0130] Finally, the bidirectional curve scattering distribution function is introduced into the real-time rendering calculation process, and the lighting is split into direct lighting and indirect lighting. For direct lighting, the L values ​​of each light source are directly accumulated. i The contribution of light from indirect lighting is assumed to be the total intensity L of all indirect light sources that contribute to the current shading point. amb If the same applies in all directions, the rendering equation can be rewritten as follows:

[0131]

[0132] For the direct lighting portion, since information about each direct light source can be obtained during shading, the calculation is performed in real-time within the fragment shader. For the indirect lighting portion, the integral needs to be calculated at regular intervals at the CPU's emission angle, stored as a one-dimensional texture, and then sampled in the fragment shader by mapping the emission angle to UV coordinates to obtain the integral value, which is then used in the calculation. At this point, the work of establishing the bidirectional curve scattering distribution function and correctly calculating the shading is complete. Figure 6 The image shows a comparison between non-physical shading effects and physically based rendering effects. Using physically based rendering can obtain more realistic and reasonable simulation results while simplifying and standardizing the description of cloth material properties, thereby improving the realism and credibility of the simulation.

[0133] This concludes the description of the specific implementation process of this embodiment. This invention achieves real-time, three-dimensional realistic simulation of jacquard warp-knitted fabrics. Compared to traditional modeling methods such as triangular meshes, the fiber-level detail rendering of this invention improves texture realism and lighting interaction effects; the introduction of shadow occlusion enhances the naturalness of light and dark transitions within the fabric; and the application of a bidirectional curve scattering distribution function ensures high accuracy in material reproduction, effectively solving the problems of insufficient realism and slow speed in existing technologies.

[0134] Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

Claims

1. A real-time simulation method for three-dimensional realism of jacquard warp-knitted fabrics, characterized in that, It includes the following steps: Step 1: Using the machine execution signal file of the Jacquard warp knitting machine as input, translate it into yarn padding numbers; Step 2: Use Catmull-Rom spline curves to build a single three-dimensional coil model; Step 3: Calculate the arrangement and offset rules of each loop based on the yarn padding number; Step 4: Using procedural generation methods and GPU hardware acceleration, fiber curves are generated in real time in the subdivision shader, and the fiber curves are modeled as quadrilateral meshes in the geometry shader. Step 5: Achieve shadow occlusion effect. Control the ambient light occlusion inside the yarn based on the distance between the fiber vertex and the center point of the yarn. Determine the self-shadow inside the yarn by the position of the fiber vertex in the direction of light travel. Achieve shadow effect between yarns through shadow mapping of the yarn-level model. Step 6: Based on the physical interaction principle between light and fabric fiber material, establish a bidirectional curve reflection distribution function for coloring the fiber curve.

2. The three-dimensional realistic real-time simulation method for jacquard warp-knitted fabrics as described in claim 1, characterized in that, In step 1, the machine execution signal file is in hexadecimal format, including a file header and a load section; the file header records the fabric process parameters, including the protocol version number, number of Jacquard combs, number of needles, time sequence number, and basic padding yarn number; the load section records the Jacquard offset value of each yarn in each time sequence, with a single Jacquard offset value occupying one binary bit; The formula for calculating the starting address of the Jacquard offset value of any Jacquard comb at any given time is: P Z,i =6+8N jac +(N jac ·S-4+i)·(Z / 8) (1) Where Z is the total number of needles, i is the current Jacquard comb sequence number, S is the current time sequence number, and N is the number of needles. jac Given the total number of Jacquard combs, read Z / 8 binary bits each time and associate these binary bits with each yarn. Add these bits to the basic yarn padding number in groups of 8 timing values ​​to obtain the actual yarn padding number for each yarn.

3. The real-time simulation method for three-dimensional realism of jacquard warp-knitted fabrics as described in claim 1, characterized in that, In step 2, the specific steps for establishing a single three-dimensional coil model using Catmull-Rom spline curves are as follows: Establish a local spatial coordinate system for the coil, placing the coil model at the origin of this system. Decompose the coil model into an arc and a cylinder. Observing the coil from the positive z-axis of the local spatial coordinate system, the arc is set to an elliptical arc shape, and the cylinder to a straight line. Observing from the negative x-axis, the arc is a straight line making a certain angle with the z-axis, while the cylinder is a parabola. The center point of the arc coincides with the origin of the local spatial coordinate system. The mathematical expression for the arc curve is: Where a and b are the major and minor axes of the ellipse, respectively, and α loop It is the angle between the arc and the negative z-axis; the mathematical expression for the cylindrical parabola is: Where h p This is an adjustable parameter used to control the curvature of the cylindrical parabola; Calculate a certain number of discrete vertices based on the mathematical expressions of the above-mentioned arcs and cylinders, and directly regard these vertices as the control points of the Catmull-rom spline curve; complete the modeling of a single three-dimensional coil.

4. The three-dimensional realistic real-time simulation method for jacquard warp-knitted fabrics as described in claim 1, characterized in that, In step 3, the arrangement and offset rules of each loop are calculated based on the yarn padding number. The specific steps are as follows: The arrangement and force offset of the coils are determined by the yarn padding numbers of each coil. In the world space coordinate system, the front surface of the fabric is made coplanar with the xoy plane. Therefore, the three-dimensional spatial coordinates P of each coil are... loop (x, y, z) is calculated using the following formula: Among them, f i,j With b i,j Let w represent the loop at the j-th row of the i-th yarn, where i is the current yarn number, j is the current row number, w is the reference spacing between two adjacent yarns, h is the spacing between two adjacent rows, r is the yarn radius, and n is the number of yarns. jac F is the Jacquard comb number currently being processed. i,j The offset value caused by the force on the loop at the j-th row of the i-th yarn is calculated using the following formula: And it is stipulated that F 1,0 =0, where p i,j The position is determined by moving a distance j·h from the starting point of the i-th yarn in the yarn-threading direction. Using this set of formulas, the theoretical three-dimensional spatial coordinates of any loop in the fabric are obtained. Then, using these coordinates as the origin of the local spatial coordinate system of the loop, the coordinates of the Catmull-Rom spline curve control points of any loop in the world spatial coordinate system are obtained based on the three-dimensional model of a single loop. This completes the yarn-level geometric modeling of the fabric, generating the three-dimensional coordinate values ​​of the Catmull-Rom spline curve control points describing each yarn.

5. The three-dimensional realistic real-time simulation method for jacquard warp-knitted fabrics as described in claim 1, characterized in that, In step 4, the specific implementation of using procedural generation methods and GPU hardware acceleration to generate fiber curves in real time in the subdivision shader and model the fiber curves as quadrilateral meshes in the geometry shader is as follows: Utilizing GPU hardware, fiber-level details are rapidly generated in real-time from yarn-level models. Each fiber curve is represented by a series of quadrilateral strips composed of triangles. For any point P on the yarn curve obtained using Catmull-Rom spline interpolation... yarn Let the tangent at that point be the z-axis, and the cross section perpendicular to the tangent be the xoy plane. Within this plane, take two vectors as the x-axis and y-axis, such that the x, y, and z coordinate axes are mutually perpendicular to each other, forming an orthogonal basis. This determines the yarn space coordinate system, with its origin at P. yarn ; Generate all the plies within a yarn; the mathematical expression for plies in the yarn space coordinate system is as follows: Where, r ply P is the center point of the strand on the xoy plane. ply With the yarn center point P yarn The distance between them, α ply The twist of the strand controls the degree of torsion of the strand spiral. θ ply Let P be the line segment yarn P ply The initial angle with the x-axis, where i is the current stock number, and r is the angle between the stock and the x-axis. ply The total number of plies within a single yarn; Generate all fiber curves for each strand; first determine the starting vertex position of each fiber curve, and calculate any point on the curve according to the mathematical expression of the fiber; establish a strand spatial coordinate system with the center point of the strand curve as the origin and the tangent at that point as the z-axis, and in the xoy plane with the origin of the coordinate system as the center, r... ply Define a circular region with radius, randomly sample a vertex within this circular region, and calculate its distance to the center point P of the line. ply distance r fiber and the angle θ between it and the x-axis fiber , will r fiber Substituting into the fiber existence probability formula p(r) fiber Calculate the probability p that a fiber vertex exists at that point. fiber Then, using rejection sampling, a sample p is randomly drawn from a uniform distribution of 0-1. pass If and only if p fiber ≥p pass If the sampling is successful, the sampling point is retained; otherwise, the point should be discarded and the sampling process repeated. The fiber existence probability formula is p(r). fiber The mathematical expression for ) is as follows: Where ε and β are physical parameters describing the fiber distribution of different fabric materials, obtained through actual measurement and statistics; after obtaining the initial vertex position of the fiber, any point on the fiber curve is calculated according to the following mathematical formula: Where, α fiber Controlling fiber twist, r min and r max is the scaling factor, used to control the theoretical maximum and minimum distances from the center point of the fiber curve to the center point of the strand curve, and s is used to control the rate of distance change. According to the above formula, each fiber vertex is calculated in real time in the GPU subdivision shader, and the line segment is modeled as a quadrilateral patch in the geometry shader; the spline curve control points describing the yarn are used as input, and four control points are used as a patch input to the subdivision control shader. The subdivision level is set to control the number of fiber curves generated by the curve and the number of interpolations between two control points; in the subdivision evaluation shader, each yarn vertex is interpolated according to the Catmull-Rom spline curve formula and the tangent at that point is calculated. Then, the yarn space coordinate system is established and all ply center line vertices are calculated according to formula (6). Then, the tangent of each ply center line vertex is calculated and all fiber center line vertices are calculated according to formulas (7) and (8). The line segment is output as a primitive to the geometry shader; in the geometry shader, the fiber center point is offset by a certain distance as the width of the quadrilateral patch by the normal direction obtained by the cross product of the viewing direction and the fiber curve tangent direction, and a triangle is used as the output primitive of the geometry shader; the work of generating fiber-level details in real time using the GPU is completed.

6. The three-dimensional realistic real-time simulation method for jacquard warp-knitted fabrics as described in claim 1, characterized in that, In step 5, the steps to achieve the shadow occlusion effect are as follows: Calculate the ambient light shading term within the yarn; based on the current fiber curve centerline vertex P. fiber To the vertex P of the center line of the yarn curve yarn The intensity of ambient light shading is calculated from the distance d. ao Its numerical expression is: Calculate the self-shadow term within the yarn; project the illumination direction onto the xoy plane of the yarn spatial coordinate system, using the projected direction as the x-axis, retaining the z-axis of the yarn spatial coordinate system and the origin of the xoy plane, and then cross-multiplying to obtain the y-axis. Establish a light source-yarn spatial coordinate system using these three coordinate axes and the origin, and then calculate the coordinates P of all fiber vertices obtained in step 4. fiber Projecting the coordinates onto the light source-yarn space coordinate system yields a new three-dimensional spatial coordinate value P. lf , by P lf The x-coordinate determines the intensity I of the self-shading term within the yarn. self : Calculate the inter-yarn shading term; modify the subdivision control shader parameters so that the number of generated fibers is 1, and set r... ply and r fiber All values ​​are 0. In the subdivision evaluation shader, only the Catmull-rom spline curve is interpolated to obtain several yarn vertices. Then, in the geometry shader, the line segment is modeled with a radius equal to r. ply +r max r fiber The cylindrical pipe is used to generate a shadow map using the classic computer graphics shadow algorithm, ShadowMap. The shadow intensity I between the yarns is sampled using UV coordinates. map ; The ambient light shading term I within the yarn was calculated separately. ao Yarn Inner Shading Item I self Shading between yarns I map Then, when performing shading in the fragment shader, the calculation formula considering the shadow occlusion effect should be: I res =I ao *I self *I map *I0 (11) Where I0 is the albedo of the fiber, which is determined by the material properties of the fabric. res The fiber color is calculated after taking into account the shadow occlusion effect; to achieve the shadow occlusion effect inside the fabric.

7. The three-dimensional realistic real-time simulation method for jacquard warp-knitted fabrics as described in claim 1, characterized in that, In step 6, a bidirectional curve reflection distribution function is established based on the physical interaction principle between light and fabric fiber material for coloring the fiber curve. The specific steps are as follows: Using the tangent to the fiber curve at the colored point as the z-axis, two directions are defined in a plane perpendicular to the z-axis as the x-axis and y-axis, respectively, making the x, y, and z coordinate axes mutually perpendicular to each other, thus establishing the fiber space coordinate system. For any direction w in this coordinate system, find the angle θ between it and the xoy plane, and the angle φ of its rotation about the z-axis in the xoy plane. ω is determined by the following formula for the transformation between the three-dimensional coordinates ω(x, y, z) in the fiber space coordinate system and the coordinates ω(θ, φ) in the spherical coordinate system: The interaction between light and fiber material is divided into two categories: one is the phenomenon where light is reflected in a certain lobe direction when it reaches the fiber surface, called the R term; the other is the phenomenon where light penetrates the entire fiber after two consecutive refractions, called the TT term. These two phenomena occur independently at angles θ and φ, so both results are obtained by multiplying the results of the two angle calculations. The final result of the interaction between light and fiber is obtained by adding the R term and the TT term. For the R term, it is assumed that the angle θ of the reflected light follows a normal distribution, with the mean value being the ideal specular reflection direction of the incident light about the xoy plane, while the angle φ is uniformly distributed. The specific mathematical description is as follows: Where, θ i Let θ be the angle between the incident light and the xoy plane. o φ is the angle between the emitted light and the xoy plane. i Let φ be the angle of rotation of the incident light in the xoy plane. o Let β be the angle of rotation of the emitted light in the xoy plane. R F is used to control the width of the reflected light's lobes at angle θ. R (θ i The mathematical expression for the approximate calculation of Fresnel reflection is: F R (θ i )=C R +(1-C R )(1-cosθ i ) 5 (14) Among them, C R For θ i The initial value when = 0 is obtained from actual measurements and table lookup based on the fabric material type; while The normalized normal distribution is expressed as follows: Similarly, define the mathematical expression for the TT term: Where I0(x) is the modified 0th-order Bessel function, β TT γ is used to control the width of the transmitted light's lobes at angle θ. TT C is used to control the width of the transmitted light lobes distributed at angle φ. TT The light color used to control the transmission term; based on the R and TT terms defined above, the final mathematical expression of the bidirectional curve scattering distribution function is determined as follows: f s (w i ,w o )=M R (i i ,i o )N R (f i ,f o )+M TT (i i ,i o )N TT (f i ,f o ) (17) The bidirectional curvilinear scattering distribution function is introduced into the real-time rendering calculation process, and the lighting is divided into direct lighting and indirect lighting. For direct lighting, the L values ​​of each light source are directly accumulated. i The contribution of light from indirect lighting is assumed to be the total intensity L of all indirect light sources that contribute to the current shading point. amb If the same applies in all directions, the rendering equation is rewritten as follows: For the direct lighting portion, since information about each direct light source can be obtained during shading, the calculation is performed in real time in the fragment shader. For the indirect lighting portion, the integral needs to be calculated at certain light emission angles on the CPU, stored as a one-dimensional texture, and then the integral value is obtained by mapping the emission angle to uv coordinates in the fragment shader and participating in the calculation. This completes the work of establishing the bidirectional curve scattering distribution function and correctly calculating the shading.

Citation Information

Cited By

  • Warp knitting fabric three-dimensional modeling simulation method and device based on binary process file

    CN121480120A