General calculation method for multi-layer mixing of multi-material height data

Through a general calculation method for multi-layer mixing of multi-material height data, the problem of lack of realism and cross-platform universality in rendering results in multi-material mixing is solved, efficient and accurate multi-material mixing and cross-platform applicability are achieved, and rendering effects and performance are improved.

CN120632259APending Publication Date: 2025-09-12Shanghai Institute of Basic Aerospace Technology +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510980780.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing height data mixing methods cannot accurately reflect the complex interactions of multiple heterogeneous materials, resulting in rendering results that lack realism and cross-platform versatility, increasing development costs and workload.

Method used

A general calculation method for multi-layer mixing of multi-material height data is adopted. By obtaining and processing original height data, mask data, offset data, etc., material functions are used for unified data structure definition and calculation to generate multi-layer mixed data of material height data.

Benefits of technology

It achieves efficient and accurate mixing of multi-material height data, improves the visual realism of rendering, meets the performance requirements of real-time applications, and has cross-platform versatility, suitable for different engines and renderer platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120632259A_ABST
    Figure CN120632259A_ABST
Patent Text Reader

Abstract

The invention discloses a general calculation method for multi-layer mixing of height data of various materials. The general calculation method comprises the following steps: acquiring upper-layer data ATop and unifying a structure; offset data of the upper layer bottom end are obtained through calculation; data deviation values of the L0 height data and the L1 height data are obtained, and deviation data of the bottom end of the upper layer are obtained through calculation; calculating the acquired upper layer data ATop to obtain comprehensive upper layer data; acquiring lower-layer data ABottom, and unifying the structure; calculating to obtain offset data of the lower-layer top end; calculating to obtain comprehensive lower-layer data; obtaining additional data MMap; calculating the acquired additional data MMap to obtain comprehensive additional data; carrying out linear interpolation calculation on the integrated data and carrying out partial hybrid calculation on the integrated data; generating auxiliary data F3 and F4; and generating material height data multi-layer mixed data. The invention provides a universal and efficient calculation method for multi-layer mixing of height data of various materials; the method can be widely applied to different rendering engines and platforms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to technical fields such as computer graphics, digital image processing and virtual reality, and specifically to a general calculation method for multi-material height data multi-layer mixing. Background Art

[0002] In the fields of computer graphics and digital image processing, material height maps are widely used to enhance the detail and realism of 3D model surfaces. Traditional height data processing methods typically target a single material or a simple material combination, employing linear or simple blending strategies. However, with the increasing demand for visual realism in applications such as virtual reality, film and television special effects, and high-end gaming, scenes often contain complex interactions of multiple heterogeneous materials. This poses numerous challenges to traditional height data blending methods when dealing with the fusion of multi-material, multi-layer height maps.

[0003] Different materials have different physical properties and visual characteristics. Simple linear superposition or averaging methods cannot accurately reflect the complex interactions between materials, resulting in a lack of realism in the rendering results.

[0004] Existing methods lack versatility and are typically designed for specific engines or renderer platforms, making them difficult to share and reuse across different platforms. This limitation increases development costs and restricts developers' application across different projects and platforms.

[0005] In the process of mixing multi-level height data, the data scale and computational complexity increase significantly, which puts higher performance requirements on real-time rendering and resource-constrained systems.

[0006] Currently, different engine and renderer platforms on the market, such as Unity, Unreal Engine, 3ds Max, Maya, and Blender, use different methods for height data mixing and lack unified standards. This inconsistency makes cross-platform development difficult, increasing workload and costs.

[0007] A search of existing technologies, both domestically and internationally, revealed one patent application closely related to texture data processing: "A Texture Data Processing Method and Device, Electronic Device, and Storage Medium" (CN202010575660.8). This patent relates to a grayscale image that uses random parameters to create programmed textures, reducing production time and improving efficiency. However, its algorithmic principles and application areas differ significantly from the requirements of this technology and do not address the technical requirements.

[0008] Therefore, there is an urgent need for a universal computing method that can efficiently and accurately process a high degree of data mixing of multiple heterogeneous materials, so as to improve the visual realism of the rendering while meeting the performance requirements of real-time applications. At the same time, it has cross-platform versatility and is suitable for different engines and renderer platforms to adapt to the increasingly complex digital media environment and growing user expectations. Summary of the Invention

[0009] In order to solve the above problems, the present invention provides a general calculation method for multi-material height data multi-layer mixing.

[0010] The specific technical solutions of the present invention are as follows:

[0011] A general calculation method for multi-layer mixing of multi-material height data includes the following steps:

[0012] S1. Obtain upper layer data: calculate the original height data L1 and the original L1 mask data to obtain mixed height data; unify the mixed height data into a unified data structure and define the unified structure data as A. Top ;

[0013] S2. Obtaining upper layer bottom end offset data: Obtaining data offset values ​​of L0 height data and L1 height data, and calculating and obtaining upper layer bottom end offset data;

[0014] S3. Obtaining upper top offset data: obtaining data offset values ​​of L0 height data and L1 height data, and calculating and obtaining the upper top offset data;

[0015] S4. Calculate the comprehensive upper layer data: set constants and calculate intermediate variables A1, B1, C1, and obtain the upper layer data A Top The comprehensive upper-level data is obtained through calculation;

[0016] S5, obtain lower layer data: calculate the original height data L0 to obtain mixed height data; unify the mixed height data into a unified data structure, and define the unified structure data as A Bottom , as the underlying data;

[0017] S6. Obtaining the offset data of the top of the lower layer: obtaining the data offset values ​​of the L0 height data and the L1 height data, and calculating and obtaining the offset data of the top of the lower layer;

[0018] S7, calculate the comprehensive lower layer data: set constants and calculate intermediate variables 2-A1, 2-B1, 2-C1, and obtain the lower layer data A Bottom The comprehensive lower layer data is obtained through calculation;

[0019] S8. Get additional data: Process and package the basic additional data to form an additional data packet with a unified data structure, and perform linear interpolation calculation on the additional data packet to obtain additional data. The additional data is named M Map ;

[0020] S9, calculate comprehensive additional data: set constants and calculate intermediate variables 3-A1, 3-B1, 3-C1, and obtain additional data M Map Comprehensive additional data is obtained through calculations;

[0021] S10, performing linear interpolation calculation on the integrated data to obtain intermediate data F1 and performing partial mixing calculation on the integrated data to obtain intermediate data F2;

[0022] S11. Generate auxiliary data: obtain the comparison value of L0 height data and L1 height data, and pack the comparison value into data packing input; subtract the comparison value from the constant 1 to obtain the difference value. When the difference value result is less than 0, the value will be limited to 0. When the difference value result is greater than or equal to 0, the difference value is output as F3; obtain the linear superposition value of L0 height data and L1 height data, pack the linear superposition value into data packing input, and the result is F4; the constant 1 is a fixed value;

[0023] S12. Generate multi-layer mixed data of material height data: call relevant data to generate multi-layer mixed data of material height data through calculation.

[0024] Preferably, the step S1 of obtaining the upper layer data packet comprises the following steps:

[0025] S1-1. Perform pixel-level calculation on the original height data L1 and the original L1 mask data. Specifically, for each corresponding pixel, perform the following operations: multiply the pixel value of the original height data L1 by the pixel value of each corresponding original L1 mask data to obtain mixed height data; the pixel value of each original height data L1 and the pixel value of the original L1 mask data are both between 0 and 1;

[0026] S1-2. Using the integrated material function to package and input the mixed height data in step S1-1 to unify the data structure;

[0027] S1-3, define the data packaged by S1-2 as a reuse node, named A Top , used as upper-layer data for subsequent calculations.

[0028] Preferably, the step S2 of obtaining the upper layer bottom end offset data comprises the following steps:

[0029] S2-1. Calculate and obtain an offset value: obtain a data offset value of the L0 height data and the L1 height data, which represents the relative height difference between the two layers of height data;

[0030] S2-2, data packaging input: the data offset value of step S2-1 is packaged and input through the integrated material function to unify the data structure;

[0031] S2-3. Multiply the data offset value unified by S2-2 by the constant k1, and the product is limited to between 0 and 1; subtract the constant k2 from the product. If the subtraction result is lower than 0, the value will be limited to 0; if it is greater than or equal to 0, the subtraction result is the offset data at the bottom of the upper layer; the k1 value is 2, and the k2 value is 1.

[0032] Preferably, the step S3 of obtaining the upper layer top offset data comprises the following steps:

[0033] S3-1. Calculate and obtain an offset value: obtain a data offset value of the L0 height data and the L1 height data, which represents the relative height difference between the two layers of height data;

[0034] S3-2, data packaging input: the data offset value of step S3-1 is packaged and input through the integrated material function to unify the data structure;

[0035] S3-3. Multiply the data offset value unified in S3-2 by the constant k3, with each product limited between 0 and 1. The resulting product is the offset data at the top of the upper layer; the k3 value is 2.

[0036] Preferably, the specific steps of calculating the comprehensive upper layer data in step S4 are:

[0037] S4-1. Set constants:

[0038] Constant A: a floating point number ranging from 0 to 0.5;

[0039] Constant B: a floating point number ranging from 0 to 0.5;

[0040] Constant C: a floating point number ranging from 0.25 to 25;

[0041] Constant D: calculated by dividing constant C by 100, i.e. D = C / 100;

[0042] Constant E: a floating point number ranging from 0.5 to 1;

[0043] Constant F: a floating point number ranging from 0.5 to 1;

[0044] Constant G: A floating point number ranging from 0 to 1, with a default value of 0.5;

[0045] Constant H: a floating point number ranging from 0 to 1, with a default value of 1;

[0046] Constant J: A floating point number ranging from 0 to 1, with a default value of 0;

[0047] S4-2. Calculate the intermediate variable A1:

[0048] Step a: Calculate R1: Set constant G to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R1.

[0049] Step b: Calculate R2: Set constant A to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant A. If the difference is less than 0, it will be clamped to 0. If the difference is greater than or equal to 0, the difference is R2.

[0050] Step c: Calculate R3: Set R1 to the background input pixel value, set R2 to the foreground pixel value corresponding to R1, divide R1 by each corresponding R2, and the quotient is R3.

[0051] Step d: Calculate R4: Set constant E to the background input pixel value and constant D to the foreground input pixel value. Subtract constant D from constant E. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R4.

[0052] Step e: Calculate R5: Set R3 to the background input pixel value, set R4 to the foreground pixel value corresponding to R3, multiply R3 and R4, and obtain the product R5; R3 and R4 are both between 0 and 1;

[0053] Step f: Calculate A1: Use constant D as the foreground input value and R5 as the background pixel value, add D and R5, and the sum is A1.

[0054] S4-3. Calculate the intermediate variable B1:

[0055] Step a: Calculate S1: Set constant G to the background input pixel value, constant B to the foreground input pixel value, subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0; if the difference is greater than or equal to 0, the difference is S1;

[0056] Step b: Calculate S2: Set constant A to the background input pixel value and constant E to the foreground input pixel value. Subtract constant E from constant A. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is S2.

[0057] Step c: Calculate S3: Set S1 as the background input pixel value, S2 as the foreground pixel value corresponding to S1, and divide S1 by S2 to obtain the quotient S3;

[0058] Step d: Calculate S4: Set constant C to the background input pixel value, constant F to the foreground input pixel value, subtract constant F from constant C, if the difference is less than 0, the difference will be clamped to 0, if the difference is greater than or equal to 0, the difference is S4;

[0059] Step e: Calculate S5: S3 is set as the background input pixel value, S4 is set as the foreground pixel value corresponding to S3, S3 and S4 are multiplied, and the product obtained is S5; S3 and S4 are both between 0 and 1;

[0060] Step f: Calculate B1: Set F as the foreground input pixel value, S5 as the background input pixel value corresponding to F, add F and S5, and the resulting sum is the intermediate variable B1;

[0061] S4-4. Select output variable C1:

[0062] Conditional judgment: If the constant G is greater than 0.5, set C1 to B1; if the constant G is less than or equal to 0.5, set C1 to A1;

[0063] S4-5. Calculate comprehensive upper-level data

[0064] Step a: Calculate T1: transform the upper layer data A Top Set to the background input pixel value, constant J is set to the foreground input pixel value, and A Top Subtract the constant J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is T1.

[0065] Step b: Calculate T2: Set constant H to the background input pixel value, constant J to the foreground input pixel value, and subtract J from H. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is T2.

[0066] Step c: Calculate T3: Set T1 to the background input pixel value, set T2 to the foreground input pixel value corresponding to T1, divide T1 by T2, and the resulting quotient is T3;

[0067] Step d: Calculate T4: Use T3 as the base and C1 as the exponent to perform a power operation, and the result is T4;

[0068] Step e: Calculate T5: Set the upper layer top offset data obtained in step S3-3 as the background input pixel value, and the upper layer bottom offset data obtained in step S2-3 as the foreground input pixel value. Subtract the upper layer bottom offset data from the upper layer top offset data. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is T5.

[0069] Step f: Calculate T6: Set T4 as the background input pixel value, set T5 as the foreground input pixel value, multiply T4 and T5, and the product is T6; T4 and T5 are both limited to between 0 and 1;

[0070] Step g: Calculate the comprehensive upper layer data: set the upper layer bottom offset data obtained in step S2-3 as the background input pixel value, set T6 as the foreground input pixel value corresponding to the upper layer bottom offset data, add the upper layer bottom offset data and T6, and the sum obtained is the final comprehensive upper layer data.

[0071] Preferably, the step S6 of obtaining the lower layer top offset data comprises the following steps:

[0072] Obtaining data offset values ​​of the L0 height data and the L1 height data, indicating the relative height difference between the two layers of height data; and inputting the data offset values ​​of the L0 height data and the L1 height data into a data pack through an integrated material function to form a data offset pack value;

[0073] Set the data offset packing value to the background input pixel value, set the constant 0.5 to the foreground input pixel value, and select the higher value between the two as M1;

[0074] Set the constant 1 to the background input pixel value, M1 to the foreground input pixel value, and subtract M1 from the constant 1. If the result of the subtraction is less than 0, the difference is clamped to 0. If the difference is greater than or equal to 0, the difference is M2.

[0075] Set M2 as the background input pixel value, set constant 2 as the foreground input pixel value corresponding to each M2, multiply M2 by constant 2, and the product is the bottom layer top offset data; M2 and constant 2 are limited between 0 and 1; constant 2 is a fixed value;

[0076] Preferably, the step S7 of calculating the integrated lower layer data comprises the following steps:

[0077] S7-1, set constants:

[0078] Constant 2-A: a floating point number ranging from 0 to 0.5;

[0079] Constant 2-B: a floating point number ranging from 0 to 0.5;

[0080] Constant 2-C: a floating point number ranging from 0.25 to 25;

[0081] Constant 2-D: Calculated by dividing the constant C by 100, ie D = C / 100.

[0082] Constant 2-E: a floating point number ranging from 0.5 to 1;

[0083] Constant 2-F: a floating point number ranging from 0.5 to 1;

[0084] Constant 2-G: a floating point number ranging from 0 to 1, with a default value of 0.5;

[0085] Constant 2-H: a floating point number ranging from 0 to 1, with a default value of 1;

[0086] Constant 2-J: a floating point number ranging from 0 to 1, with a default value of 0;

[0087] S7-2, calculate intermediate variable 2-A1:

[0088] Step a: Calculate 2-R1: Set the constant 2-G to the background input pixel value, the constant 2-B to the foreground input pixel value, and subtract the constant 2-B from the constant 2-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R1.

[0089] Step b: Calculate 2-R2: Set constant 2-A to the background input pixel value, constant 2-B to the foreground input pixel value, and subtract constant 2-B from constant 2-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R2.

[0090] Step c: Calculate 2-R3: Set 2-R1 to the background input pixel value, set 2-R2 to the foreground input pixel value corresponding to 2-R1, and divide 2-R1 by 2-R2. The quotient is 2-R3.

[0091] Step d: Calculate 2-R4: Set the constant 2-E to the background input pixel value and the constant 2-D to the foreground input pixel value. Subtract the constant 2-D from the constant 2-E. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R4.

[0092] Step e: Calculate 2-R5: Set 2-R3 to the background input pixel value, set 2-R4 to the foreground input pixel value corresponding to 2-R3, multiply 2-R3 by 2-R4, and the resulting product is 2-R5; the values ​​of 2-R3 and 2-R4 are limited to between 0 and 1;

[0093] Step f: Calculate 2-A1: Set the constant 2-D to the background input pixel value, set 2-R5 to the foreground input pixel value corresponding to the constant 2-D, add the constant 2-D and 2-R5, and the resulting sum is 2-A1;

[0094] S7-3, calculate intermediate variable 2-B1:

[0095] Step a: Calculate 2-S1: Set constant 2-G to the background input pixel value, constant 2-B to the foreground input pixel value, and subtract constant 2-B from constant 2-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S1.

[0096] Step b: Calculate 2-S2: Set constant 2-A to the background input pixel value, constant 2-E to the foreground input pixel value, and subtract constant 2-E from constant 2-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S2.

[0097] Step c: Calculate 2-S3: Set 2-S1 to the background input pixel value, set 2-S2 to the foreground input pixel value corresponding to 2-S1, and divide 2-S1 by 2-S2. The quotient is 2-S3.

[0098] Step d: Calculate 2-S4: Set constant 2-C to the background input pixel value, constant 2-F to the foreground input pixel value, and subtract constant 2-F from constant 2-C. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S4.

[0099] Step e: Calculate 2-S5: Set 2-S3 to the background input pixel value, set 2-S4 to the foreground input pixel value corresponding to 2-S3, multiply 2-S3 by 2-S4, and the product is 2-S5; the values ​​of 2-S3 and 2-S4 are limited to between 0 and 1;

[0100] Step f: Calculate 2-B1: Set the constant 2-F to the background input pixel value, set 2-S5 to the foreground input pixel value corresponding to the constant 2-F, add the constants 2-F and 2-S5, and the resulting sum is 2-B1;

[0101] S7-4. Select output variable 2-C1: Conditional judgment: If the constant 2-G is greater than 0.5, set 2-C1 to 2-B1. If the constant 2-G is less than or equal to 0.5, set 2-C1 to 2-A1.

[0102] S7-5. Calculate the comprehensive lower-level data:

[0103] Step a: Calculate 2-T1: Substitute the lower layer data A Bottom Set as the background input pixel value, the constant 2-J is set as the foreground input pixel value, and use the lower layer data A Bottom Subtract the constant 2-J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is 2-T1.

[0104] Step b: Calculate 2-T2: Set constant 2-H to the background input pixel value, constant 2-J to the foreground input pixel value, and subtract constant 2-J from constant 2-H. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-T2.

[0105] Step c: Calculate 2-T3: Set 2-T1 to the background input pixel value, set 2-T2 to the foreground input pixel value corresponding to 2-T1, and divide 2-T1 by 2-T2. The quotient is 2-T3.

[0106] Step d: Calculate 2-T4: Use 2-T3 as the base and 2-C1 as the exponent to perform the power operation. The result is 2-T4.

[0107] Step e: Calculate 2-T5: Set the bottom layer top offset data as the background input pixel value, set the constant 0 as the foreground input pixel value, subtract the constant 0 from the bottom layer top offset data, and the difference is 2-T5; the constant 0 is a fixed value;

[0108] Step f: Calculate 2-T6: Set 2-T4 to the background input pixel value, set 2-T5 to the foreground input pixel value corresponding to 2-T4, multiply 2-T4 by 2-T5, and the resulting product is 2-T6; the values ​​of 2-T4 and 2-T5 are limited to between 0 and 1;

[0109] Step g: Calculate the comprehensive lower layer data: set 2-T6 as the background input pixel value, set the constant 0 as the foreground input pixel value, add 2-T6 and the constant 0, and the resulting sum is the comprehensive lower layer data.

[0110] Preferably, the step S8 of obtaining the additional data packet comprises the following steps:

[0111] Get the basic data of the additional data; use the integrated material function to pack the basic data of the additional data into a unified structure of the additional data packet; use constants 0 and 1 to perform linear interpolation calculations from 0 to 1 on the additional data packet to obtain the additional data; name the additional data M Map .

[0112] Preferably, the step S9 of calculating the comprehensive additional data comprises the following steps:

[0113] S9-1. Set constants:

[0114] Constant 3-A: a floating point number ranging from 0 to 0.5;

[0115] Constant 3-B: a floating point number ranging from 0 to 0.5;

[0116] Constant 3-C: a floating point number ranging from 0.25 to 25;

[0117] Constant 3-D: calculated by dividing the constant 3-C by 100, that is, D = C / 100;

[0118] Constant 3-E: a floating point number ranging from 0.5 to 1;

[0119] Constant 3-F: a floating point number ranging from 0.5 to 1;

[0120] Constant 3-G: a floating point number ranging from 0 to 1, with a default value of 0.5;

[0121] Constant 3-H: A floating point number ranging from 0 to 1, with a default value of 1.

[0122] Constant 3-J: A floating point number ranging from 0 to 1, with a default value of 0;

[0123] S9-2. Calculate intermediate variable 3-A1:

[0124] Step a: Calculate 3-R1: Set constant 3-G to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R1.

[0125] Step b: Calculate 3-R2: Set constant 3-A to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R2.

[0126] Step c: Calculate 3-R3: Set 3-R1 to the background input pixel value, set 3-R2 to the foreground input pixel value corresponding to 3-R1, and divide 3-R1 by 3-R2. The quotient is 3-T3.

[0127] Step d: Calculate 3-R4: Set constant 3-E to the background input pixel value, constant 3-D to the foreground input pixel value, and subtract constant 3-D from constant 3-E. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R4.

[0128] Step e: Calculate 3-R5: Set 3-R3 to the background input pixel value, set 3-R4 to the foreground input pixel value corresponding to 3-R3, multiply 3-R3 by 3-R4, and the product is 3-R5; the values ​​of 3-R3 and 3-R4 are limited to between 0 and 1;

[0129] Step f: Calculate 3-A1: Set the constant 3-D to the background input pixel value, set 3-R5 to the foreground input pixel value corresponding to the constant 3-D, add the constant 3-D and 3-R5, and the resulting sum is 3-A1;

[0130] S9-3. Calculate intermediate variable 3-B1:

[0131] Step a: Calculate 3-S1: Set constant 3-G to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S1.

[0132] Step b: Calculate 3-S2: Set constant 3-A to the background input pixel value, constant 3-E to the foreground input pixel value, and subtract constant 3-E from constant 3-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S2.

[0133] Step c: Calculate 3-S3: Set 3-S1 to the background input pixel value, set 3-S2 to the foreground input pixel value corresponding to 3-S1, and divide 3-S1 by 3-S2. The quotient is 3-S3.

[0134] Step d: Calculate 3-S4: Set constant 3-C to the background input pixel value, constant 3-F to the foreground input pixel value, and subtract constant 3-F from constant 3-C. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S4.

[0135] Step e: Calculate 3-S5: Set 3-S3 to the background input pixel value, set 3-S4 to the foreground input pixel value corresponding to 3-S3, multiply 3-S3 by 3-S4, and the product is 3-S5; the values ​​of 3-S3 and 3-S4 are limited to between 0 and 1;

[0136] Step f: Calculate 3-B1: Set the constant 3-F to the background input pixel value, set 3-S5 to the foreground input pixel value corresponding to the constant 3-F, add the constants 3-F and 3-S5, and the resulting sum is 3-B1;

[0137] S9-4. Select output variable 3-C1: Conditional judgment: if constant 3-G is greater than 0.5, set 3-C1 to 3-B1; if constant 3-G is less than or equal to 0.5, set 3-C1 to 3-A1;

[0138] S9-5. Calculate comprehensive additional data:

[0139] Step a: Calculate 3-T1: Add the extra data M Map Set to the background input pixel value, the constant 3-J is set to the foreground input pixel value, and the additional data M is used. Map Subtract the constant 3-J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is 3-T1.

[0140] Step b: Calculate 3-T2: Set constant 3-H to the background input pixel value, constant 3-J to the foreground input pixel value, and subtract constant 3-J from constant 3-H. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-T2.

[0141] Step c: Calculate 3-T3: Set 3-T1 to the background input pixel value, set 3-T2 to the foreground input pixel value corresponding to 3-T1, and divide 3-T1 by 3-T2. The quotient is 3-T3.

[0142] Step d: Calculate 3-T4: Use 3-T3 as the base and 3-C1 as the exponent to perform the power operation. The result is 3-T4.

[0143] Step e: Calculate 3-T5: Set constant 0 to the background input pixel value, constant 1 to the foreground input pixel value, and subtract constant 1 from constant 0. The difference is 3-T5.

[0144] Step f: Calculate 3-T6: Set 3-T4 to the background input pixel value, set 3-T5 to the foreground input pixel value corresponding to 3-T4, multiply 3-T4 by 3-T5, and the resulting product is 3-T6; the values ​​of 3-T4 and 3-T5 are limited to between 0 and 1;

[0145] Step g: Calculate the integrated additional data: set 3-T6 as the background input pixel value, set the constant 1 as the foreground input pixel value, add 3-T6 and the constant 1, and the resulting sum is the integrated additional data.

[0146] Preferably, the linear interpolation calculation of the integrated data and the partial mixed calculation of the integrated data in step S10 include the following steps:

[0147] Linear interpolation calculation of comprehensive data: call the comprehensive lower layer data A calculated in step S7 Bottom, step S5 obtains lower layer data and step S8 obtains additional data;

[0148] Perform linear interpolation calculation on the above retrieved data, where the additional data M Map As the intermediate data of weighted average, the lower layer data is taken as the starting value, and the lower layer data A Bottom As the end value;

[0149] The specific calculation process is as follows:

[0150] Step a: Set the lower layer data A from the end value Bottom Subtract the starting value from the pixel value of the integrated lower layer data; if the result of the subtraction is lower than 0, the value will be clamped to 0, if the difference is greater than or equal to 0, the difference is 2-W;

[0151] Step b: Calculate interpolation: Set 2-W as the background input pixel value, and the additional data M Map Set to the foreground pixel value corresponding to 2-W, and add 2-W to the additional data M Map Multiply, the product is 2-V; the 2-W and the additional data M Map The value is limited to between 0 and 1;

[0152] Step c: Calculate the final value: set 2-V as the background input pixel value, set the integrated lower layer data as the foreground pixel value corresponding to 2-V, add 2-V and the integrated lower layer data, and the sum is the intermediate data F1;

[0153] Partial mixed calculation of the integrated data: calling the integrated upper layer data calculated in step S4 and the integrated additional data calculated in step S9; setting the integrated upper layer data as the background input pixel value, setting the integrated additional data as the foreground pixel value corresponding to the integrated upper layer data, and multiplying the integrated upper layer data by the integrated additional data, the product of which is the intermediate number F2;

[0154] Preferably, the step S12 of generating material height data multi-layer mixed data comprises the following steps:

[0155] S12-1 calls related data:

[0156] Call F1 and F2; compare the F1 and F2 values ​​and select the higher value as Max(F1, F2); set Max(F1, F2) to the background input pixel value and F2 to the foreground input pixel value, subtract F2 from Max(F1, F2). If the subtraction result is lower than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is F5;

[0157] S12-2 generates the final data according to the comprehensive calculation method of S4:

[0158] S12-2-1. Set constants:

[0159] Constant A: a floating point number ranging from 0 to 0.5;

[0160] Constant B: a floating point number ranging from 0 to 0.5;

[0161] Constant C: a floating point number ranging from 0.25 to 25;

[0162] Constant D: calculated by dividing constant C by 100, i.e. D = C / 100;

[0163] Constant E: a floating point number ranging from 0.5 to 1;

[0164] Constant F: a floating point number ranging from 0.5 to 1;

[0165] Constant G: A floating point number ranging from 0 to 1, with a default value of 0.5;

[0166] Constant J: A floating point number ranging from 0 to 1, with a default value of 0;

[0167] S12-2-2. Calculate the intermediate variable A1:

[0168] Step a: Calculate R1: Set constant G to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R1.

[0169] Step b: Calculate R2: Set constant A to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant A. If the difference is less than 0, it will be clamped to 0. If the difference is greater than or equal to 0, the difference is R2.

[0170] Step c: Calculate R3: Set R1 to the background input pixel value, R2 to the foreground pixel value corresponding to R1, and divide R1 by each corresponding R2, the quotient is R3;

[0171] Step d: Calculate R4: Set constant E to the background input pixel value and constant D to the foreground input pixel value. Subtract constant D from constant E. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R4.

[0172] Step e: Calculate R5: Set R3 to the background input pixel value, set R4 to the foreground pixel value corresponding to R3, multiply R3 and R4, and obtain the product R5; R3 and R4 are both between 0 and 1;

[0173] Step f: Calculate A1: Use constant D as the foreground input value and R5 as the background pixel value, add D and R5, and the resulting sum is A1;

[0174] S12-2-3. Calculate the intermediate variable B1:

[0175] Step a: Calculate S1: Set constant G to the background input pixel value, constant B to the foreground input pixel value, subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0; if the difference is greater than or equal to 0, the difference is S1;

[0176] Step b: Calculate S2: Set constant A to the background input pixel value and constant E to the foreground input pixel value. Subtract constant E from constant A. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is S2.

[0177] Step c: Calculate S3: Set S1 as the background input pixel value, S2 as the foreground pixel value corresponding to S1, and divide S1 by S2 to obtain the quotient S3;

[0178] Step d: Calculate S4: Set constant C to the background input pixel value, constant F to the foreground input pixel value, subtract constant F from constant C, if the difference is less than 0, the difference will be clamped to 0, if the difference is greater than or equal to 0, the difference is S4;

[0179] Step e: Calculate S5: S3 is set as the background input pixel value, S4 is set as the foreground pixel value corresponding to S3, S3 and S4 are multiplied, and the product obtained is S5; S3 and S4 are both between 0 and 1;

[0180] Step f: Calculate B1: Set F as the foreground input pixel value, S5 as the background input pixel value corresponding to F, add F and S5, and the resulting sum is the intermediate variable B1;

[0181] S12-2-4. Select output variable C1:

[0182] Conditional judgment: If the constant G is greater than 0.5, set C1 to B1; if the constant G is less than or equal to 0.5, set C1 to A1;

[0183] S12-2-5. Calculate the intermediate number Fn5:

[0184] Step a: Calculate 4-T1: Set F5 to the background input pixel value and constant J to the foreground input pixel value. Subtract constant J from F5. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T1.

[0185] Step b: Calculate 4-T2: Set F3 to the background input pixel value and the constant J to the foreground input pixel value. Subtract J from F3. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T2.

[0186] Step c: Calculate 4-T3: Set 4-T1 to the background input pixel value, set 4-T2 to the foreground input pixel value corresponding to T1, and divide 4-T1 by 4-T2. The quotient is 4-T3.

[0187] Step d: Calculate 4-T4: Use 4-T3 as the base and C1 as the exponent to perform the power operation. The result is 4-T4.

[0188] Step e: Calculate 4-T5: Set constant 0 as the background input pixel value, set step F4 as the foreground input pixel value, and subtract F4 from constant 0. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T5.

[0189] Step f: Calculate 4-T6: Set 4-T4 as the background input pixel value, set 4-T5 as the foreground input pixel value, multiply 4-T4 and 4-T5, and the product is 4-T6; both 4-T4 and 4-T5 are limited to between 0 and 1;

[0190] Step g: Calculate Fn5: Set 4-T6 as the background input pixel value, F4 as the foreground input pixel value of 4-T6, add F4 and 4-T6, and the resulting sum is Fn5; limit the output value of Fn5 to the range of 0 to 1 to ensure data validity;

[0191] S12-3. Final linear interpolation calculation:

[0192] Call Fn5, F1, and F2, and perform linear interpolation calculation on Fn5, F1, and F2, where Fn5 is used as the intermediate data of weighted average, F1 is used as the starting value, and F2 is used as the ending value;

[0193] The specific calculation process is as follows:

[0194] Step a: Calculate the difference: set F2 as the end pixel value, F1 as the start pixel value, and subtract F1 from F2. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is W.

[0195] Step b: Calculate interpolation: Set W as the background input pixel value, set Fn5 as the foreground input pixel value corresponding to each W, multiply W by Fn5, and the product is V; W and Fn5 are limited between 0 and 1;

[0196] Step c: Calculate the final material height data: set V to the background input pixel value, set F1 to the foreground input pixel value corresponding to each V, and add V to F1 to obtain the final material height data multi-layer mixed data.

[0197] Through the above steps, we successfully generated multi-layered material height data. This data can be used in various rendering engines and platforms to achieve accurate multi-layered blending of height data from multiple materials, improving the realism and detail of the rendering effect.

[0198] Compared with the prior art, the present invention has the following beneficial effects:

[0199] (1) The present invention realizes the multi-layer mixing of height data of various materials and provides a general and efficient calculation method;

[0200] (2) The present invention strictly follows the specifications in its description and uses a detailed operation description method. It can be widely applied to different rendering engines and platforms to meet the needs of cross-platform, high-performance rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0201] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0202] Figure 1 This is a schematic diagram of an image information data processing method and a calculation method flow chart of a general calculation method for multi-material height data multi-layer mixing in an embodiment of the present invention;

[0203] Figure 2 This is a schematic diagram of a processing method and a calculation method flow chart for obtaining upper layer data in a general calculation method for multi-layer mixing of multi-material height data in an embodiment of the present invention;

[0204] Figure 3 This is a flow chart of a method for processing and calculating the top offset data of an upper layer in a general method for calculating multi-material height data mixed with multiple layers in an embodiment of the present invention;

[0205] Figure 4 A schematic diagram and flow chart of a comprehensive upper-layer data processing method and calculation method in a general calculation method for multi-material height data multi-layer mixing in an embodiment of the present invention;

[0206] Figure 5 A schematic diagram and flow chart of the integrated lower layer data processing method and calculation method in a general calculation method for multi-material height data multi-layer mixing in an embodiment of the present invention;

[0207] Figure 6 A schematic diagram and flow chart of the integrated additional data processing method and calculation method in a general calculation method for multi-material height data multi-layer mixing in an embodiment of the present invention;

[0208] Figure 7 A schematic diagram of a linear difference calculation method and flow chart of integrated data in a general calculation method for multi-material height data multi-layer mixing in an embodiment of the present invention;

[0209] Figure 8 A schematic diagram of a method and process for generating final data through comprehensive algorithm calculation in a general calculation method for multi-material height data multi-layer mixing in an embodiment of the present invention. DETAILED DESCRIPTION

[0210] The following describes the embodiments of the present invention through specific examples. Those skilled in the art will readily understand the other advantages and benefits of the present invention from the disclosure herein. The present invention may also be implemented or applied through various other specific embodiments, and the details in this specification may be modified or altered based on different viewpoints and applications without departing from the spirit of the present invention.

[0211] The following is combined with Figures 1-8 The present invention is described in further detail:

[0212] A general computational method for multi-layer mixing of multi-material height data, such as Figure 1 As shown, it includes the following steps:

[0213] S1. Obtain upper layer data: calculate the original height data L1 and the original L1 mask data to obtain mixed height data; unify the mixed height data into a unified data structure and define the unified structure data as A. Top ;

[0214] S2. Obtaining upper layer bottom end offset data: Obtaining data offset values ​​of L0 height data and L1 height data, and calculating and obtaining upper layer bottom end offset data;

[0215] S3. Obtaining upper layer top offset data: Obtaining data offset values ​​of L0 height data and L1 height data, and calculating and obtaining upper layer bottom offset data;

[0216] S4. Calculate the comprehensive upper layer data: set constants and calculate intermediate variables A1, B1, C1, and obtain the upper layer data A Top The comprehensive upper-level data is obtained through calculation;

[0217] S5, obtain lower layer data: calculate the original height data L0 to obtain mixed height data; unify the mixed height data into a unified data structure, and define the unified structure data as A Bottom , as the underlying data;

[0218] S6. Obtaining the offset data of the top of the lower layer: obtaining the data offset values ​​of the L0 height data and the L1 height data, and calculating and obtaining the offset data of the top of the lower layer;

[0219] S7, calculate the comprehensive lower layer data: set constants and calculate intermediate variables 2-A1, 2-B1, 2-C1, and obtain the lower layer data A Bottom The comprehensive lower layer data is obtained through calculation;

[0220] S8. Get additional data: Process and package the basic additional data to form an additional data packet with a unified data structure, and perform linear interpolation calculation on the additional data packet to obtain additional data. The additional data is named M Map ;

[0221] S9, calculate comprehensive additional data: set constants and calculate intermediate variables 3-A1, 3-B1, 3-C1, and obtain additional data M Map Comprehensive additional data is obtained through calculations;

[0222] S10, performing linear interpolation calculation on the integrated data to obtain intermediate data F1 and performing partial mixing calculation on the integrated data to obtain intermediate data F2;

[0223] S11. Generate auxiliary data: obtain the comparison value of L0 height data and L1 height data, and pack the comparison value into data packing input; subtract the comparison value from the constant 1 to obtain the difference value. When the difference value result is less than 0, the value will be limited to 0. When the difference value result is greater than or equal to 0, the difference value is output as F3; obtain the linear superposition value of L0 height data and L1 height data, pack the linear superposition value into data packing input, and the result is F4; the constant 1 is a fixed value;

[0224] S12. Generate multi-layer mixed data of material height data: call relevant data to generate multi-layer mixed data of material height data through calculation.

[0225] Preferably, if Figure 2 As shown, the step S1 of obtaining the upper layer data packet includes the following steps:

[0226] S1-1. Perform pixel-level calculation on the original height data L1 and the original L1 mask data. Specifically, for each corresponding pixel, perform the following operations: multiply the pixel value of the original height data L1 by the pixel value of each corresponding original L1 mask data to obtain mixed height data; the pixel value of each original height data L1 and the pixel value of the original L1 mask data are both between 0 and 1;

[0227] S1-2. Using the integrated material function to package and input the mixed height data in step S1-1 to unify the data structure;

[0228] S1-3, define the data packaged by S1-2 as a reuse node, named A Top , used as upper-layer data for subsequent calculations.

[0229] Preferably, the step S2 of obtaining the upper layer bottom end offset data comprises the following steps:

[0230] S2-1. Calculate and obtain an offset value: obtain a data offset value of the L0 height data and the L1 height data, which represents the relative height difference between the two layers of height data;

[0231] S2-2, data packaging input: the data offset value of step S2-1 is packaged and input through the integrated material function to unify the data structure;

[0232] S2-3. Multiply the data offset value unified by S2-2 by the constant k1, and the product is limited to between 0 and 1; subtract the constant k2 from the product. If the subtraction result is lower than 0, the value will be limited to 0; if it is greater than or equal to 0, the subtraction result is the offset data at the bottom of the upper layer; the k1 value is 2, and the k2 value is 1.

[0233] Preferably, if Figure 3 As shown, the step S3 of obtaining the upper top offset data includes the following steps:

[0234] S3-1. Calculate and obtain an offset value: obtain a data offset value of the L0 height data and the L1 height data, which represents the relative height difference between the two layers of height data;

[0235] S3-2, data packaging input: the data offset value of step S3-1 is packaged and input through the integrated material function to unify the data structure;

[0236] S3-3. Multiply the data offset value unified in S3-2 by the constant k3, with each product limited between 0 and 1. The resulting product is the offset data at the top of the upper layer; the k3 value is 2.

[0237] Preferably, the specific steps of calculating the comprehensive upper layer data in step S4 are:

[0238] S4-1, such as Figure 4 As shown, set the constant:

[0239] Constant A: a floating point number ranging from 0 to 0.5;

[0240] Constant B: a floating point number ranging from 0 to 0.5;

[0241] Constant C: a floating point number ranging from 0.25 to 25;

[0242] Constant D: calculated by dividing constant C by 100, i.e. D = C / 100;

[0243] Constant E: a floating point number ranging from 0.5 to 1;

[0244] Constant F: a floating point number ranging from 0.5 to 1;

[0245] Constant G: A floating point number ranging from 0 to 1, with a default value of 0.5;

[0246] Constant H: a floating point number ranging from 0 to 1, with a default value of 1;

[0247] Constant J: A floating point number ranging from 0 to 1, with a default value of 0;

[0248] S4-2. Calculate the intermediate variable A1:

[0249] Step a: Calculate R1: Set constant G to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R1.

[0250] Step b: Calculate R2: Set constant A to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant A. If the difference is less than 0, it will be clamped to 0. If the difference is greater than or equal to 0, the difference is R2.

[0251] Step c: Calculate R3: Set R1 to the background input pixel value, R2 to the foreground pixel value corresponding to R1, and divide R1 by each corresponding R2, the quotient is R3;

[0252] Step d: Calculate R4: Set constant E to the background input pixel value and constant D to the foreground input pixel value. Subtract constant D from constant E. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R4.

[0253] Step e: Calculate R5: Set R3 to the background input pixel value, set R4 to the foreground pixel value corresponding to R3, multiply R3 and R4, and obtain the product R5; R3 and R4 are both between 0 and 1;

[0254] Step f: Calculate A1: Use constant D as the foreground input value and R5 as the background pixel value, add D and R5, and the resulting sum is A1;

[0255] S4-3. Calculate the intermediate variable B1:

[0256] Step a: Calculate S1: Set constant G to the background input pixel value, constant B to the foreground input pixel value, subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0; if the difference is greater than or equal to 0, the difference is S1;

[0257] Step b: Calculate S2: Set constant A to the background input pixel value and constant E to the foreground input pixel value. Subtract constant E from constant A. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is S2.

[0258] Step c: Calculate S3: Set S1 as the background input pixel value, S2 as the foreground pixel value corresponding to S1, and divide S1 by S2 to obtain the quotient S3;

[0259] Step d: Calculate S4: Set constant C to the background input pixel value, constant F to the foreground input pixel value, subtract constant F from constant C, if the difference is less than 0, the difference will be clamped to 0, if the difference is greater than or equal to 0, the difference is S4;

[0260] Step e: Calculate S5: S3 is set as the background input pixel value, S4 is set as the foreground pixel value corresponding to S3, S3 and S4 are multiplied, and the product obtained is S5; S3 and S4 are both between 0 and 1;

[0261] Step f: Calculate B1: Set F as the foreground input pixel value, S5 as the background input pixel value corresponding to F, add F and S5, and the resulting sum is the intermediate variable B1;

[0262] S4-4. Select output variable C1:

[0263] Conditional judgment: If the constant G is greater than 0.5, set C1 to B1; if the constant G is less than or equal to 0.5, set C1 to A1;

[0264] S4-5. Calculate comprehensive upper-level data

[0265] Step a: Calculate T1: transform the upper layer data A TopSet to the background input pixel value, constant J is set to the foreground input pixel value, and A Top Subtract the constant J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is T1.

[0266] Step b: Calculate T2: Set constant H to the background input pixel value, constant J to the foreground input pixel value, and subtract J from H. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is T2.

[0267] Step c: Calculate T3: Set T1 to the background input pixel value, set T2 to the foreground input pixel value corresponding to T1, divide T1 by T2, and the resulting quotient is T3;

[0268] Step d: Calculate T4: Use T3 as the base and C1 as the exponent to perform a power operation, and the result is T4;

[0269] Step e: Calculate T5: Set the upper layer top offset data obtained in step S3-3 as the background input pixel value, and the upper layer bottom offset data obtained in step S2-3 as the foreground input pixel value. Subtract the upper layer bottom offset data from the upper layer top offset data. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is T5.

[0270] Step f: Calculate T6: Set T4 as the background input pixel value, set T5 as the foreground input pixel value, multiply T4 and T5, and the product is T6; T4 and T5 are both limited to between 0 and 1;

[0271] Step g: Calculate the comprehensive upper layer data: set the upper layer bottom offset data obtained in step S2-3 as the background input pixel value, set T6 as the foreground input pixel value corresponding to the upper layer bottom offset data, add the upper layer bottom offset data and T6, and the sum obtained is the final comprehensive upper layer data.

[0272] Preferably, the step S6 of obtaining the lower layer top offset data comprises the following steps:

[0273] Obtaining data offset values ​​of the L0 height data and the L1 height data, indicating the relative height difference between the two layers of height data; and inputting the data offset values ​​of the L0 height data and the L1 height data into a data pack through an integrated material function to form a data offset pack value;

[0274] Set the data offset packing value to the background input pixel value, set the constant 0.5 to the foreground input pixel value, and select the higher value between the two as M1;

[0275] Set the constant 1 to the background input pixel value, M1 to the foreground input pixel value, and subtract M1 from the constant 1. If the result of the subtraction is less than 0, the difference is clamped to 0. If the difference is greater than or equal to 0, the difference is M2.

[0276] Set M2 as the background input pixel value, set constant 2 as the foreground input pixel value corresponding to each M2, multiply M2 by constant 2, and the product is the bottom layer top offset data; M2 and constant 2 are limited between 0 and 1; constant 2 is a fixed value;

[0277] Preferably, the step S7 of calculating the integrated lower layer data comprises the following steps:

[0278] S7-1, such as Figure 5 As shown, set the constant:

[0279] Constant 2-A: a floating point number ranging from 0 to 0.5;

[0280] Constant 2-B: a floating point number ranging from 0 to 0.5;

[0281] Constant 2-C: a floating point number ranging from 0.25 to 25;

[0282] Constant 2-D: Calculated by dividing the constant C by 100, ie D = C / 100.

[0283] Constant 2-E: a floating point number ranging from 0.5 to 1;

[0284] Constant 2-F: a floating point number ranging from 0.5 to 1;

[0285] Constant 2-G: a floating point number ranging from 0 to 1, with a default value of 0.5;

[0286] Constant 2-H: a floating point number ranging from 0 to 1, with a default value of 1;

[0287] Constant 2-J: a floating point number ranging from 0 to 1, with a default value of 0;

[0288] S7-2, calculate intermediate variable 2-A1:

[0289] Step a: Calculate 2-R1: Set the constant 2-G to the background input pixel value, the constant 2-B to the foreground input pixel value, and subtract the constant 2-B from the constant 2-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R1.

[0290] Step b: Calculate 2-R2: Set constant 2-A to the background input pixel value, constant 2-B to the foreground input pixel value, and subtract constant 2-B from constant 2-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R2.

[0291] Step c: Calculate 2-R3: Set 2-R1 to the background input pixel value, set 2-R2 to the foreground input pixel value corresponding to 2-R1, and divide 2-R1 by 2-R2. The quotient is 2-R3.

[0292] Step d: Calculate 2-R4: Set the constant 2-E to the background input pixel value and the constant 2-D to the foreground input pixel value. Subtract the constant 2-D from the constant 2-E. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R4.

[0293] Step e: Calculate 2-R5: Set 2-R3 to the background input pixel value, set 2-R4 to the foreground input pixel value corresponding to 2-R3, multiply 2-R3 by 2-R4, and the resulting product is 2-R5; the values ​​of 2-R3 and 2-R4 are limited to between 0 and 1;

[0294] Step f: Calculate 2-A1: Set the constant 2-D to the background input pixel value, set 2-R5 to the foreground input pixel value corresponding to the constant 2-D, add the constant 2-D and 2-R5, and the resulting sum is 2-A1;

[0295] S7-3, calculate intermediate variable 2-B1:

[0296] Step a: Calculate 2-S1: Set constant 2-G to the background input pixel value, constant 2-B to the foreground input pixel value, and subtract constant 2-B from constant 2-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S1.

[0297] Step b: Calculate 2-S2: Set constant 2-A to the background input pixel value, constant 2-E to the foreground input pixel value, and subtract constant 2-E from constant 2-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S2.

[0298] Step c: Calculate 2-S3: Set 2-S1 to the background input pixel value, set 2-S2 to the foreground input pixel value corresponding to 2-S1, and divide 2-S1 by 2-S2. The quotient is 2-S3.

[0299] Step d: Calculate 2-S4: Set constant 2-C to the background input pixel value, constant 2-F to the foreground input pixel value, and subtract constant 2-F from constant 2-C. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S4.

[0300] Step e: Calculate 2-S5: Set 2-S3 to the background input pixel value, set 2-S4 to the foreground input pixel value corresponding to 2-S3, multiply 2-S3 by 2-S4, and the product is 2-S5; the values ​​of 2-S3 and 2-S4 are limited to between 0 and 1;

[0301] Step f: Calculate 2-B1: Set the constant 2-F to the background input pixel value, set 2-S5 to the foreground input pixel value corresponding to the constant 2-F, add the constants 2-F and 2-S5, and the resulting sum is 2-B1;

[0302] S7-4. Select output variable 2-C1: Conditional judgment: If the constant 2-G is greater than 0.5, set 2-C1 to 2-B1. If the constant 2-G is less than or equal to 0.5, set 2-C1 to 2-A1.

[0303] S7-5. Calculate the comprehensive lower-level data:

[0304] Step a: Calculate 2-T1: Substitute the lower layer data A Bottom Set as the background input pixel value, the constant 2-J is set as the foreground input pixel value, and use the lower layer data A Bottom Subtract the constant 2-J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is 2-T1.

[0305] Step b: Calculate 2-T2: Set constant 2-H to the background input pixel value, constant 2-J to the foreground input pixel value, and subtract constant 2-J from constant 2-H. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-T2.

[0306] Step c: Calculate 2-T3: Set 2-T1 to the background input pixel value, set 2-T2 to the foreground input pixel value corresponding to 2-T1, and divide 2-T1 by 2-T2. The quotient is 2-T3.

[0307] Step d: Calculate 2-T4: Use 2-T3 as the base and 2-C1 as the exponent to perform the power operation. The result is 2-T4.

[0308] Step e: Calculate 2-T5: Set the lower layer top offset data as the background input pixel value, set the constant 0 as the foreground input pixel value, subtract the constant 0 from the lower layer top offset data, and the difference is 2-T5; the constant 0 is a fixed value;

[0309] Step f: Calculate 2-T6: Set 2-T4 to the background input pixel value, set 2-T5 to the foreground input pixel value corresponding to 2-T4, multiply 2-T4 by 2-T5, and the resulting product is 2-T6; the values ​​of 2-T4 and 2-T5 are limited to between 0 and 1;

[0310] Step g: Calculate the comprehensive lower layer data: set 2-T6 as the background input pixel value, set the constant 0 as the foreground input pixel value, add 2-T6 and the constant 0, and the resulting sum is the comprehensive lower layer data.

[0311] Preferably, the step S8 of obtaining the additional data packet comprises the following steps:

[0312] Get the basic data of the additional data; use the integrated material function to pack the basic data of the additional data into a unified structure of the additional data packet; use constants 0 and 1 to perform linear interpolation calculations from 0 to 1 on the additional data packet to obtain the additional data; name the additional data M Map .

[0313] Preferably, the step S9 of calculating the comprehensive additional data comprises the following steps:

[0314] S9-1、 Figure 6 As shown, set the constant:

[0315] Constant 3-A: a floating point number ranging from 0 to 0.5;

[0316] Constant 3-B: a floating point number ranging from 0 to 0.5;

[0317] Constant 3-C: a floating point number ranging from 0.25 to 25;

[0318] Constant 3-D: calculated by dividing the constant 3-C by 100, that is, D = C / 100;

[0319] Constant 3-E: a floating point number ranging from 0.5 to 1;

[0320] Constant 3-F: a floating point number ranging from 0.5 to 1;

[0321] Constant 3-G: a floating point number ranging from 0 to 1, with a default value of 0.5;

[0322] Constant 3-H: A floating point number ranging from 0 to 1, with a default value of 1.

[0323] Constant 3-J: A floating point number ranging from 0 to 1, with a default value of 0;

[0324] S9-2. Calculate intermediate variable 3-A1:

[0325] Step a: Calculate 3-R1: Set constant 3-G to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R1.

[0326] Step b: Calculate 3-R2: Set constant 3-A to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R2.

[0327] Step c: Calculate 3-R3: Set 3-R1 to the background input pixel value, set 3-R2 to the foreground input pixel value corresponding to 3-R1, and divide 3-R1 by 3-R2. The quotient is 3-T3.

[0328] Step d: Calculate 3-R4: Set constant 3-E to the background input pixel value, constant 3-D to the foreground input pixel value, and subtract constant 3-D from constant 3-E. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R4.

[0329] Step e: Calculate 3-R5: Set 3-R3 to the background input pixel value, set 3-R4 to the foreground input pixel value corresponding to 3-R3, multiply 3-R3 by 3-R4, and the product is 3-R5; the values ​​of 3-R3 and 3-R4 are limited to between 0 and 1;

[0330] Step f: Calculate 3-A1: Set the constant 3-D to the background input pixel value, set 3-R5 to the foreground input pixel value corresponding to the constant 3-D, add the constant 3-D and 3-R5, and the resulting sum is 3-A1;

[0331] S9-3. Calculate intermediate variable 3-B1:

[0332] Step a: Calculate 3-S1: Set constant 3-G to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S1.

[0333] Step b: Calculate 3-S2: Set constant 3-A to the background input pixel value, constant 3-E to the foreground input pixel value, and subtract constant 3-E from constant 3-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S2.

[0334] Step c: Calculate 3-S3: Set 3-S1 to the background input pixel value, set 3-S2 to the foreground input pixel value corresponding to 3-S1, and divide 3-S1 by 3-S2. The quotient is 3-S3.

[0335] Step d: Calculate 3-S4: Set constant 3-C to the background input pixel value, constant 3-F to the foreground input pixel value, and subtract constant 3-F from constant 3-C. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S4.

[0336] Step e: Calculate 3-S5: Set 3-S3 to the background input pixel value, set 3-S4 to the foreground input pixel value corresponding to 3-S3, multiply 3-S3 by 3-S4, and the product is 3-S5; the values ​​of 3-S3 and 3-S4 are limited to between 0 and 1;

[0337] Step f: Calculate 3-B1: Set the constant 3-F to the background input pixel value, set 3-S5 to the foreground input pixel value corresponding to the constant 3-F, add the constants 3-F and 3-S5, and the resulting sum is 3-B1;

[0338] S9-4. Select output variable 3-C1: Conditional judgment: if constant 3-G is greater than 0.5, set 3-C1 to 3-B1; if constant 3-G is less than or equal to 0.5, set 3-C1 to 3-A1;

[0339] S9-5. Calculate comprehensive additional data:

[0340] Step a: Calculate 3-T1: Add the extra data M Map Set to the background input pixel value, the constant 3-J is set to the foreground input pixel value, and the additional data M is used. Map Subtract the constant 3-J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is 3-T1.

[0341] Step b: Calculate 3-T2: Set constant 3-H to the background input pixel value, constant 3-J to the foreground input pixel value, and subtract constant 3-J from constant 3-H. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-T2.

[0342] Step c: Calculate 3-T3: Set 3-T1 to the background input pixel value, set 3-T2 to the foreground input pixel value corresponding to 3-T1, and divide 3-T1 by 3-T2. The quotient is 3-T3.

[0343] Step d: Calculate 3-T4: Use 3-T3 as the base and 3-C1 as the exponent to perform the power operation. The result is 3-T4.

[0344] Step e: Calculate 3-T5: Set constant 0 to the background input pixel value, constant 1 to the foreground input pixel value, and subtract constant 1 from constant 0. The difference is 3-T5.

[0345] Step f: Calculate 3-T6: Set 3-T4 to the background input pixel value, set 3-T5 to the foreground input pixel value corresponding to 3-T4, multiply 3-T4 by 3-T5, and the resulting product is 3-T6; the values ​​of 3-T4 and 3-T5 are limited to between 0 and 1;

[0346] Step g: Calculate the integrated additional data: set 3-T6 as the background input pixel value, set the constant 1 as the foreground input pixel value, add 3-T6 and the constant 1, and the resulting sum is the integrated additional data.

[0347] Preferably, if Figure 7 As shown, the linear interpolation calculation of the integrated data and the partial mixed calculation of the integrated data in step S10 include the following steps:

[0348] Linear interpolation calculation of comprehensive data: call the comprehensive lower layer data A calculated in step S7 Bottom , step S5 obtains lower layer data and step S8 obtains additional data;

[0349] Perform linear interpolation calculation on the above retrieved data, where the additional data M Map As the intermediate data of weighted average, the lower layer data is taken as the starting value, and the lower layer data A Bottom as the end value.

[0350] The specific calculation process is as follows:

[0351] Step a: Set the lower layer data A from the end value Bottom The pixel value of the integrated lower layer data is subtracted from the starting value; if the result of the subtraction is lower than 0, the value will be clamped to 0, and if the difference is greater than or equal to 0, the difference is 2-W.

[0352] Step b: Calculate interpolation: Set 2-W as the background input pixel value, and the additional data M Map Set to the foreground pixel value corresponding to 2-W, and add 2-W to the additional data M Map Multiply, the product is 2-V; the 2-W and the additional data MMap The value is limited to between 0 and 1;

[0353] Step c: Calculate the final value: set 2-V as the background input pixel value, set the integrated lower layer data as the foreground pixel value corresponding to 2-V, add 2-V and the integrated lower layer data, and the sum is the intermediate data F1;

[0354] Partial mixed calculation of the integrated data: calling the integrated upper layer data calculated in step S4 and the integrated additional data calculated in step S9; setting the integrated upper layer data as the background input pixel value, setting the integrated additional data as the foreground pixel value corresponding to the integrated upper layer data, and multiplying the integrated upper layer data by the integrated additional data, the product of which is the intermediate number F2;

[0355] Preferably, if Figure 8 As shown, the step S12 of generating material height data multi-layer mixed data includes the following steps:

[0356] S12-1 calls related data:

[0357] Call F1 and F2; compare the F1 and F2 values ​​and select the higher value as Max(F1, F2); set Max(F1, F2) to the background input pixel value and F2 to the foreground input pixel value, subtract F2 from Max(F1, F2). If the subtraction result is lower than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is F5;

[0358] S12-2 generates the final data according to the comprehensive calculation method of S4:

[0359] S12-2-1. Set constants:

[0360] Constant A: a floating point number ranging from 0 to 0.5;

[0361] Constant B: a floating point number ranging from 0 to 0.5;

[0362] Constant C: a floating point number ranging from 0.25 to 25;

[0363] Constant D: calculated by dividing constant C by 100, i.e. D = C / 100;

[0364] Constant E: a floating point number ranging from 0.5 to 1;

[0365] Constant F: a floating point number ranging from 0.5 to 1;

[0366] Constant G: A floating point number ranging from 0 to 1, with a default value of 0.5;

[0367] Constant J: A floating point number ranging from 0 to 1, with a default value of 0;

[0368] S12-2-2. Calculate the intermediate variable A1:

[0369] Step a: Calculate R1: Set constant G to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R1.

[0370] Step b: Calculate R2: Set constant A to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant A. If the difference is less than 0, it will be clamped to 0. If the difference is greater than or equal to 0, the difference is R2.

[0371] Step c: Calculate R3: Set R1 to the background input pixel value, set R2 to the foreground pixel value corresponding to R1, divide R1 by each corresponding R2, and the quotient is R3.

[0372] Step d: Calculate R4: Set constant E to the background input pixel value and constant D to the foreground input pixel value. Subtract constant D from constant E. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R4.

[0373] Step e: Calculate R5: Set R3 to the background input pixel value, set R4 to the foreground pixel value corresponding to R3, multiply R3 and R4, and obtain the product R5; R3 and R4 are both between 0 and 1;

[0374] Step f: Calculate A1: Use constant D as the foreground input value and R5 as the background pixel value, add D and R5, and the resulting sum is A1;

[0375] S12-2-3. Calculate the intermediate variable B1:

[0376] Step a: Calculate S1: Set constant G to the background input pixel value, constant B to the foreground input pixel value, subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0; if the difference is greater than or equal to 0, the difference is S1;

[0377] Step b: Calculate S2: Set constant A to the background input pixel value and constant E to the foreground input pixel value. Subtract constant E from constant A. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is S2.

[0378] Step c: Calculate S3: Set S1 as the background input pixel value, S2 as the foreground pixel value corresponding to S1, and divide S1 by S2 to obtain the quotient S3;

[0379] Step d: Calculate S4: Set constant C to the background input pixel value, constant F to the foreground input pixel value, subtract constant F from constant C, if the difference is less than 0, the difference will be clamped to 0, if the difference is greater than or equal to 0, the difference is S4;

[0380] Step e: Calculate S5: S3 is set as the background input pixel value, S4 is set as the foreground pixel value corresponding to S3, S3 and S4 are multiplied, and the product obtained is S5; S3 and S4 are both between 0 and 1;

[0381] Step f: Calculate B1: Set F as the foreground input pixel value, S5 as the background input pixel value corresponding to F, add F and S5, and the resulting sum is the intermediate variable B1;

[0382] S12-2-4. Select output variable C1:

[0383] Conditional judgment: If the constant G is greater than 0.5, set C1 to B1; if the constant G is less than or equal to 0.5, set C1 to A1;

[0384] S12-2-5. Calculate the intermediate number Fn5

[0385] Step a: Calculate 4-T1: Set F5 to the background input pixel value and constant J to the foreground input pixel value. Subtract constant J from F5. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T1.

[0386] Step b: Calculate 4-T2: Set F3 to the background input pixel value and the constant J to the foreground input pixel value. Subtract J from F3. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T2.

[0387] Step c: Calculate 4-T3: Set 4-T1 to the background input pixel value, set 4-T2 to the foreground input pixel value corresponding to T1, and divide 4-T1 by 4-T2. The quotient is 4-T3.

[0388] Step d: Calculate 4-T4: Use 4-T3 as the base and C1 as the exponent to perform the power operation. The result is 4-T4.

[0389] Step e: Calculate 4-T5: Set constant 0 as the background input pixel value, set step F4 as the foreground input pixel value, and subtract F4 from constant 0. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T5.

[0390] Step f: Calculate 4-T6: Set 4-T4 as the background input pixel value, set 4-T5 as the foreground input pixel value, multiply 4-T4 and 4-T5, and the product is 4-T6; both 4-T4 and 4-T5 are limited to between 0 and 1;

[0391] Step g: Calculate Fn5: Set 4-T6 as the background input pixel value, F4 as the foreground input pixel value of 4-T6, add F4 and 4-T6, and the resulting sum is Fn5; limit the output value of Fn5 to the range of 0 to 1 to ensure data validity;

[0392] S12-3. Final linear interpolation calculation:

[0393] Call Fn5, F1, and F2, and perform linear interpolation calculation on Fn5, F1, and F2, where Fn5 is used as the intermediate data of weighted average, F1 is used as the starting value, and F2 is used as the ending value;

[0394] The specific calculation process is as follows:

[0395] Step a: Calculate the difference: set F2 as the end pixel value, F1 as the start pixel value, and subtract F1 from F2. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is W.

[0396] Step b: Calculate interpolation: Set W as the background input pixel value, set Fn5 as the foreground input pixel value corresponding to each W, multiply W by Fn5, and the product is V; W and Fn5 are limited between 0 and 1;

[0397] Step c: Calculate the final material height data: set V to the background input pixel value, set F1 to the foreground input pixel value corresponding to each V, and add V to F1 to obtain the final material height data multi-layer mixed data.

[0398] Through the above steps, we successfully generated multi-layered material height data. This data can be used in various rendering engines and platforms to achieve accurate multi-layered blending of height data from multiple materials, improving the realism and detail of the rendering effect.

[0399] Although the present invention has been disclosed above in terms of preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art may use the above-disclosed contents to make possible changes and modifications to the technical solutions of the present invention without departing from the spirit and scope of the present invention. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the contents of the technical solutions of the present invention shall fall within the scope of protection of the technical solutions of the present invention.

Claims

1. A general calculation method for multi-layer mixing of height data of various materials, characterized by: The following steps are involved: S1. Get upper layer data A Top and unify the structure; S2. Obtain the data offset values ​​of the L0 height data and the L1 height data, and calculate and obtain the offset data of the bottom end of the upper layer; S3, obtaining the data offset values ​​of the L0 height data and the L1 height data, and calculating and obtaining the offset data of the top of the upper layer; S4, the upper layer data A Top The comprehensive upper-level data is obtained through calculation; S5. Get lower layer data A Bottom , and unify the structure; S6. Obtain data offset values ​​of the L0 height data and the L1 height data, and calculate and obtain offset data of the top of the lower layer; S7, the acquired lower layer data A Bottom The comprehensive lower layer data is obtained through calculation; S8. Obtain basic data for additional data; Use the integrated material function to package the basic data of the additional data into an additional data packet with a unified structure; Using constants 0 and 1, perform linear interpolation from 0 to 1 on the additional data packet to obtain the additional data M Map ; The constant 0 and constant 1 are fixed values; S9. Additional data M to be obtained Map Comprehensive additional data is obtained through calculations; S10, performing linear interpolation calculation on the integrated data to obtain intermediate data F1 and performing partial mixing calculation on the integrated data to obtain intermediate data F2; S11, generating auxiliary data F3 and F4; S12. Generate multi-layer mixed data of material height data: call relevant data to generate multi-layer mixed data of material height data through calculation.

2. A general calculation method for multi-layer mixing of height data of multiple materials as claimed in claim 1, characterized in that: The step S1 of obtaining the upper layer data packet comprises the following steps: S1-1, performing pixel-level calculation on the original height data L1 and the original L1 mask data; multiplying the pixel value of the original height data L1 by the pixel value of each corresponding original L1 mask data to obtain mixed height data; the pixel value of each original height data L1 and the pixel value of the original L1 mask data are both between 0 and 1; S1-2. Using the integrated material function to package and input the mixed height data in step S1-1 to unify the data structure; S1-3, define the data packaged by S1-2 as a reuse node, named A Top , used as upper-layer data for subsequent calculations.

3. The general calculation method for multi-layer mixing of height data of multiple materials as claimed in claim 1, characterized in that: The step S2 of obtaining the upper bottom offset data packet comprises the following steps: S2-1. Calculate and obtain an offset value: obtain a data offset value of the L0 height data and the L1 height data, which represents the relative height difference between the two layers of height data; S2-2, data packaging input: the data offset value of step S2-1 is packaged and input through the integrated material function to unify the data structure; S2-3. Multiply the data offset value unified by S2-2 by the constant k1, and the product is limited to between 0 and 1; subtract the constant k2 from the product. If the subtraction result is lower than 0, the value will be limited to 0; if it is greater than or equal to 0, the subtraction result is the offset data at the bottom of the upper layer; the k1 value is 2, and the k2 value is 1.

4. The general calculation method for multi-layer mixing of height data of multiple materials as claimed in claim 1, characterized in that: The step S3 of obtaining the upper top offset data comprises the following steps: S3-1. Calculate and obtain an offset value: obtain a data offset value of the L0 height data and the L1 height data, which represents the relative height difference between the two layers of height data; S3-2, data packaging input: the data offset value of step S3-1 is packaged and input through the integrated material function to unify the data structure; S3-3. Multiply the data offset value unified in S3-2 by the constant k3, with each product limited between 0 and 1. The resulting product is the offset data at the top of the upper layer; the k3 value is 2.

5. The general calculation method for multi-layer mixing of height data of multiple materials as claimed in claim 1, characterized in that: The specific steps of calculating the comprehensive upper layer data in step S4 are as follows: S4-1. Set constants: Constant A, constant B, constant C, constant D, constant E, constant F, constant G, constant H, constant J; the constant D is calculated by dividing constant C by 100, i.e., D=C / 100; S4-2. Calculate the intermediate variable A1: Step a: Calculate R1: Set constant G to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R1. Step b: Calculate R2: Set constant A to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant A. If the difference is less than 0, it will be clamped to 0. If the difference is greater than or equal to 0, the difference is R2. Step c: Calculate R3: Set R1 to the background input pixel value, R2 to the foreground pixel value corresponding to R1, and divide R1 by each corresponding R2, the quotient is R3; Step d: Calculate R4: Set constant E to the background input pixel value and constant D to the foreground input pixel value. Subtract constant D from constant E. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R4. Step e: Calculate R5: Set R3 to the background input pixel value, set R4 to the foreground pixel value corresponding to R3, multiply R3 and R4, and obtain the product R5; R3 and R4 are both between 0 and 1; Step f: Calculate A1: Use constant D as the foreground input pixel value and R5 as the background pixel value, add D and R5, and the resulting sum is A1; S4-3. Calculate the intermediate variable B1: Step a: Calculate S1: Set constant G to the background input pixel value, constant B to the foreground input pixel value, subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0; if the difference is greater than or equal to 0, the difference is S1; Step b: Calculate S2: Set constant A to the background input pixel value and constant E to the foreground input pixel value. Subtract constant E from constant A. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is S2. Step c: Calculate S3: Set S1 as the background input pixel value, S2 as the foreground pixel value corresponding to S1, and divide S1 by S2 to obtain the quotient S3; Step d: Calculate S4: Set constant C to the background input pixel value, constant F to the foreground input pixel value, subtract constant F from constant C, if the difference is less than 0, the difference will be clamped to 0, if the difference is greater than or equal to 0, the difference is S4; Step e: Calculate S5: S3 is set as the background input pixel value, S4 is set as the foreground pixel value corresponding to S3, S3 and S4 are multiplied, and the product obtained is S5; S3 and S4 are both between 0 and 1; Step f: Calculate B1: Set F as the foreground input pixel value, S5 as the background input pixel value corresponding to F, add F and S5, and the resulting sum is the intermediate variable B1; S4-4. Select output variable C1: Conditional judgment: If the constant G is greater than 0.5, set C1 to B1; if the constant G is less than or equal to 0.5, set C1 to A1; S4-5. Calculate comprehensive upper-level data Step a: Calculate T1: transform the upper layer data A Top Set to the background input pixel value, constant J is set to the foreground input pixel value, and A Top Subtract the constant J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is T1. Step b: Calculate T2: Set constant H to the background input pixel value, constant J to the foreground input pixel value, and subtract J from H. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is T2. Step c: Calculate T3: Set T1 to the background input pixel value, set T2 to the foreground input pixel value corresponding to T1, divide T1 by T2, and the quotient is T3; Step d: Calculate T4: Use T3 as the base and C1 as the exponent to perform a power operation, and the result is T4; Step e: Calculate T5: Set the upper layer top offset data obtained in step S3-3 as the background input pixel value, and the upper layer bottom offset data obtained in step S2-3 as the foreground input pixel value. Subtract the upper layer bottom offset data from the upper layer top offset data. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is T5. Step f: Calculate T6: Set T4 as the background input pixel value, set T5 as the foreground input pixel value, multiply T4 and T5, and the product is T6; T4 and T5 are both limited to between 0 and 1; Step g: Calculate the comprehensive upper layer data: set the upper layer bottom offset data obtained in step S2-3 as the background input pixel value, set T6 as the foreground input pixel value corresponding to the upper layer bottom offset data, add the upper layer bottom offset data and T6, and the sum obtained is the final comprehensive upper layer data.

6. The general calculation method for multi-layer mixing of height data of multiple materials as claimed in claim 1, characterized in that: The step S6 of obtaining the lower layer top offset data comprises the following steps: Obtaining data offset values ​​of the L0 height data and the L1 height data, indicating the relative height difference between the two layers of height data; and inputting the data offset values ​​of the L0 height data and the L1 height data into a data pack through an integrated material function to form a data offset pack value; Set the data offset packing value to the background input pixel value, set the constant 0.5 to the foreground input pixel value, and select the higher value between the two as M1; Set the constant 1 to the background input pixel value, M1 to the foreground input pixel value, and subtract M1 from the constant 1. If the result of the subtraction is less than 0, the difference is clamped to 0. If the difference is greater than or equal to 0, the difference is M2. Set M2 as the background input pixel value, set constant 2 as the foreground input pixel value corresponding to each M2, multiply M2 by constant 2, and the product is the lower layer top offset data; the M2 and constant 2 are limited between 0 and 1; the constant 2 is a fixed value.

7. A general calculation method for multi-layer mixing of height data of multiple materials as claimed in claim 1, characterized in that: The step S7 of calculating the integrated lower layer data comprises the following steps: S7-1, set constants: Constant 2-A, constant 2-B, constant 2-C, constant 2-D, constant 2-E, constant 2-F, constant 2-G, constant 2-H, constant 2-J; the constant 2-D is calculated by dividing constant C by 100, that is, D=C / 100; S7-2, calculate intermediate variable 2-A1: Step a: Calculate 2-R1: Set the constant 2-G to the background input pixel value, the constant 2-B to the foreground input pixel value, and subtract the constant 2-B from the constant 2-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R1. Step b: Calculate 2-R2: Set constant 2-A to the background input pixel value, constant 2-B to the foreground input pixel value, and subtract constant 2-B from constant 2-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R2. Step c: Calculate 2-R3: Set 2-R1 to the background input pixel value, set 2-R2 to the foreground input pixel value corresponding to 2-R1, and divide 2-R1 by 2-R2. The quotient is 2-R3. Step d: Calculate 2-R4: Set the constant 2-E to the background input pixel value and the constant 2-D to the foreground input pixel value. Subtract the constant 2-D from the constant 2-E. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-R4. Step e: Calculate 2-R5: Set 2-R3 to the background input pixel value, set 2-R4 to the foreground input pixel value corresponding to 2-R3, multiply 2-R3 by 2-R4, and the resulting product is 2-R5; the values ​​of 2-R3 and 2-R4 are limited to between 0 and 1; Step f: Calculate 2-A1: Set the constant 2-D to the background input pixel value, set 2-R5 to the foreground input pixel value corresponding to the constant 2-D, add the constant 2-D and 2-R5, and the resulting sum is 2-A1; S7-3, calculate intermediate variable 2-B1: Step a: Calculate 2-S1: Set constant 2-G to the background input pixel value, constant 2-B to the foreground input pixel value, and subtract constant 2-B from constant 2-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S1. Step b: Calculate 2-S2: Set constant 2-A to the background input pixel value, constant 2-E to the foreground input pixel value, and subtract constant 2-E from constant 2-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S2. Step c: Calculate 2-S3: Set 2-S1 to the background input pixel value, set 2-S2 to the foreground input pixel value corresponding to 2-S1, and divide 2-S1 by 2-S2. The quotient is 2-S3. Step d: Calculate 2-S4: Set constant 2-C to the background input pixel value, constant 2-F to the foreground input pixel value, and subtract constant 2-F from constant 2-C. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-S4. Step e: Calculate 2-S5: Set 2-S3 to the background input pixel value, set 2-S4 to the foreground input pixel value corresponding to 2-S3, multiply 2-S3 by 2-S4, and the product is 2-S5; the values ​​of 2-S3 and 2-S4 are limited to between 0 and 1; Step f: Calculate 2-B1: Set the constant 2-F to the background input pixel value, set 2-S5 to the foreground input pixel value corresponding to the constant 2-F, add the constants 2-F and 2-S5, and the resulting sum is 2-B1; S7-4. Select output variable 2-C1: Conditional judgment: If the constant 2-G is greater than 0.5, set 2-C1 to 2-B1; if the constant 2-G is less than or equal to 0.5, set 2-C1 to 2-A1; S7-5. Calculate the comprehensive lower-level data: Step a: Calculate 2-T1: Substitute the lower layer data A Bottom Set as the background input pixel value, the constant 2-J is set as the foreground input pixel value, and use the lower layer data A Bottom Subtract the constant 2-J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is 2-T1. Step b: Calculate 2-T2: Set constant 2-H to the background input pixel value, constant 2-J to the foreground input pixel value, and subtract constant 2-J from constant 2-H. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 2-T2. Step c: Calculate 2-T3: Set 2-T1 to the background input pixel value, set 2-T2 to the foreground input pixel value corresponding to 2-T1, and divide 2-T1 by 2-T2. The quotient is 2-T3. Step d: Calculate 2-T4: Use 2-T3 as the base and 2-C1 as the exponent to perform the power operation. The result is 2-T4. Step e: Calculate 2-T5: Set the bottom layer top offset data to the background input pixel value, set the constant 0 to the foreground input pixel value, and subtract the constant 0 from the bottom layer top offset data. The difference is 2-T5. Step f: Calculate 2-T6: Set 2-T4 to the background input pixel value, set 2-T5 to the foreground input pixel value corresponding to 2-T4, multiply 2-T4 by 2-T5, and the resulting product is 2-T6; the values ​​of 2-T4 and 2-T5 are limited to between 0 and 1; Step g: Calculate the comprehensive lower layer data: set 2-T6 as the background input pixel value, set the constant 0 as the foreground input pixel value, add 2-T6 and the constant 0, and the resulting sum is the comprehensive lower layer data.

8. The general calculation method for multi-layer mixing of height data of multiple materials as claimed in claim 1, characterized in that: The step S9 of calculating the comprehensive additional data comprises the following steps: S9-1. Set constants: constant 3-A, constant 3-B, constant 3-C, constant 3-D, constant 3-E, constant 3-F, constant 3-G, constant 3-H, constant 3-J; constant 3-D is calculated by dividing constant 3-C by 100, i.e., D = C / 100; S9-2. Calculate intermediate variable 3-A1: Step a: Calculate 3-R1: Set constant 3-G to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R1. Step b: Calculate 3-R2: Set constant 3-A to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R2. Step c: Calculate 3-R3: Set 3-R1 to the background input pixel value, set 3-R2 to the foreground input pixel value corresponding to 3-R1, and divide 3-R1 by 3-R2. The quotient is 3-T3. Step d: Calculate 3-R4: Set constant 3-E to the background input pixel value, constant 3-D to the foreground input pixel value, and subtract constant 3-D from constant 3-E. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-R4. Step e: Calculate 3-R5: Set 3-R3 to the background input pixel value, set 3-R4 to the foreground input pixel value corresponding to 3-R3, multiply 3-R3 by 3-R4, and the product is 3-R5; the values ​​of 3-R3 and 3-R4 are limited to between 0 and 1; Step f: Calculate 3-A1: Set the constant 3-D to the background input pixel value, set 3-R5 to the foreground input pixel value corresponding to the constant 3-D, add the constant 3-D and 3-R5, and the resulting sum is 3-A1; S9-3. Calculate intermediate variable 3-B1: Step a: Calculate 3-S1: Set constant 3-G to the background input pixel value, constant 3-B to the foreground input pixel value, and subtract constant 3-B from constant 3-G. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S1. Step b: Calculate 3-S2: Set constant 3-A to the background input pixel value, constant 3-E to the foreground input pixel value, and subtract constant 3-E from constant 3-A. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S2. Step c: Calculate 3-S3: Set 3-S1 to the background input pixel value, set 3-S2 to the foreground input pixel value corresponding to 3-S1, and divide 3-S1 by 3-S2. The quotient is 3-S3. Step d: Calculate 3-S4: Set constant 3-C to the background input pixel value, constant 3-F to the foreground input pixel value, and subtract constant 3-F from constant 3-C. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-S4. Step e: Calculate 3-S5: Set 3-S3 to the background input pixel value, set 3-S4 to the foreground input pixel value corresponding to 3-S3, multiply 3-S3 by 3-S4, and the product is 3-S5; the values ​​of 3-S3 and 3-S4 are limited to between 0 and 1; Step f: Calculate 3-B1: Set the constant 3-F to the background input pixel value, set 3-S5 to the foreground input pixel value corresponding to the constant 3-F, add the constants 3-F and 3-S5, and the resulting sum is 3-B1; S9-4. Select output variable 3-C1: Conditional judgment: if constant 3-G is greater than 0.5, set 3-C1 to 3-B1; if constant 3-G is less than or equal to 0.5, set 3-C1 to 3-A1; S9-5. Calculate comprehensive additional data: Step a: Calculate 3-T1: Add the extra data M Map Set to the background input pixel value, the constant 3-J is set to the foreground input pixel value, and the additional data M is used. Map Subtract the constant 3-J. If the result of the subtraction is less than 0, the value will be clamped to 0. If the result of the subtraction is greater than or equal to 0, the difference is 3-T1. Step b: Calculate 3-T2: Set constant 3-H to the background input pixel value, constant 3-J to the foreground input pixel value, and subtract constant 3-J from constant 3-H. If the result of the subtraction is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 3-T2. Step c: Calculate 3-T3: Set 3-T1 to the background input pixel value, set 3-T2 to the foreground input pixel value corresponding to 3-T1, and divide 3-T1 by 3-T2. The quotient is 3-T3. Step d: Calculate 3-T4: Use 3-T3 as the base and 3-C1 as the exponent to perform the power operation. The result is 3-T4. Step e: Calculate 3-T5: Set constant 0 to the background input pixel value, constant 1 to the foreground input pixel value, and subtract constant 1 from constant 0. The difference is 3-T5. Step f: Calculate 3-T6: Set 3-T4 to the background input pixel value, set 3-T5 to the foreground input pixel value corresponding to 3-T4, multiply 3-T4 by 3-T5, and the resulting product is 3-T6; the values ​​of 3-T4 and 3-T5 are limited to between 0 and 1; Step g: Calculate the integrated additional data: set 3-T6 as the background input pixel value, set the constant 1 as the foreground input pixel value, add 3-T6 and the constant 1, and the resulting sum is the integrated additional data.

9. The general calculation method for multi-layer mixing of height data of multiple materials as claimed in claim 1, characterized in that: The linear interpolation calculation of the integrated data and the partial mixed calculation of the integrated data in step S10 include the following steps: Linear interpolation calculation of comprehensive data: call the comprehensive lower layer data A calculated in step S7 Bottom , step S5 obtains lower layer data and step S8 obtains additional data; Perform linear interpolation calculation on the above retrieved data, where the additional data M Map As the intermediate data of weighted average, the lower layer data is taken as the starting value, and the lower layer data A Bottom As the end value; The specific calculation process is as follows: Step a: Set the lower layer data A from the end value Bottom Subtract the starting value from the pixel value of the integrated lower layer data; if the result of the subtraction is lower than 0, the value will be clamped to 0, if the difference is greater than or equal to 0, the difference is 2-W; Step b: Calculate interpolation: Set 2-W as the background input pixel value, and the additional data M Map Set to the foreground pixel value corresponding to 2-W, and add 2-W to the additional data M Map Multiply, the product is 2-V; the 2-W and the additional data M Map The value is limited to between 0 and 1; Step c: Calculate the final value: set 2-V as the background input pixel value, set the integrated lower layer data as the foreground pixel value corresponding to 2-V, add 2-V and the integrated lower layer data, and the sum is the intermediate data F1; Partial mixed calculation of comprehensive data: call the comprehensive upper-layer data calculated in step S4 and the comprehensive additional data calculated in step S9; set the comprehensive upper-layer data as the background input pixel value, set the comprehensive additional data as the foreground pixel value corresponding to the comprehensive upper-layer data, and multiply the comprehensive upper-layer data by the comprehensive additional data, and the product is the intermediate number F2.

10. The universal calculation method for multi-layer mixing of height data of various materials as claimed in claim 1, characterized in that: The step S12 of generating material height data multi-layer mixed data comprises the following steps: S12-1 calls related data: Call F1 and F2; compare the F1 and F2 values ​​and select the higher value as Max(F1, F2); set Max(F1, F2) to the background input pixel value and F2 to the foreground input pixel value, subtract F2 from Max(F1, F2). If the subtraction result is lower than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is F5; S12-2 generates the final data according to the comprehensive calculation method of S4: S12-2-1. Set constants: Constant A, constant B, constant C, constant D, constant E, constant F, constant G, constant J; the constant D is calculated by dividing constant C by 100, that is, D=C / 100; S12-2-2. Calculate the intermediate variable A1: Step a: Calculate R1: Set constant G to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R1. Step b: Calculate R2: Set constant A to the background input pixel value and constant B to the foreground input pixel value. Subtract constant B from constant A. If the difference is less than 0, it will be clamped to 0. If the difference is greater than or equal to 0, the difference is R2. Step c: Calculate R3: Set R1 to the background input pixel value, R2 to the foreground pixel value corresponding to R1, and divide R1 by each corresponding R2, the quotient is R3; Step d: Calculate R4: Set constant E to the background input pixel value and constant D to the foreground input pixel value. Subtract constant D from constant E. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is R4. Step e: Calculate R5: Set R3 to the background input pixel value, set R4 to the foreground pixel value corresponding to R3, multiply R3 and R4, and obtain the product R5; R3 and R4 are both between 0 and 1; Step f: Calculate A1: Use constant D as the foreground input pixel value and R5 as the background pixel value, add D and R5, and the resulting sum is A1; S12-2-3. Calculate the intermediate variable B1: Step a: Calculate S1: Set constant G to the background input pixel value, constant B to the foreground input pixel value, subtract constant B from constant G. If the difference is less than 0, the difference will be clamped to 0; if the difference is greater than or equal to 0, the difference is S1; Step b: Calculate S2: Set constant A to the background input pixel value and constant E to the foreground input pixel value. Subtract constant E from constant A. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is S2. Step c: Calculate S3: Set S1 as the background input pixel value, S2 as the foreground pixel value corresponding to S1, and divide S1 by S2 to obtain the quotient S3; Step d: Calculate S4: Set constant C to the background input pixel value, constant F to the foreground input pixel value, subtract constant F from constant C, if the difference is less than 0, the difference will be clamped to 0, if the difference is greater than or equal to 0, the difference is S4; Step e: Calculate S5: S3 is set as the background input pixel value, S4 is set as the foreground pixel value corresponding to S3, S3 and S4 are multiplied, and the product obtained is S5; S3 and S4 are both between 0 and 1; Step f: Calculate B1: Set F as the foreground input pixel value, S5 as the background input pixel value corresponding to F, add F and S5, and the resulting sum is the intermediate variable B1; S12-2-4. Select output variable C1: Conditional judgment: If the constant G is greater than 0.5, set C1 to B1; if the constant G is less than or equal to 0.5, set C1 to A1; S12-2-5. Calculate the intermediate number Fn5 Step a: Calculate 4-T1: Set F5 to the background input pixel value and constant J to the foreground input pixel value. Subtract constant J from F5. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T1. Step b: Calculate 4-T2: Set F3 to the background input pixel value and the constant J to the foreground input pixel value. Subtract J from F3. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T2. Step c: Calculate 4-T3: Set 4-T1 to the background input pixel value, set 4-T2 to the foreground input pixel value corresponding to T1, and divide 4-T1 by 4-T2. The quotient is 4-T3. Step d: Calculate 4-T4: Use 4-T3 as the base and C1 as the exponent to perform the power operation. The result is 4-T4. Step e: Calculate 4-T5: Set constant 0 as the background input pixel value, set step F4 as the foreground input pixel value, and subtract F4 from constant 0. If the subtraction result is less than 0, the value will be clamped to 0. If the subtraction result is greater than or equal to 0, the difference is 4-T5. Step f: Calculate 4-T6: Set 4-T4 as the background input pixel value, set 4-T5 as the foreground input pixel value, multiply 4-T4 and 4-T5, and the product is 4-T6; both 4-T4 and 4-T5 are limited to between 0 and 1; Step g: Calculate Fn5: Set 4-T6 as the background input pixel value, F4 as the foreground input pixel value of 4-T6, add F4 and 4-T6, and the resulting sum is Fn5; limit the output value of Fn5 to the range of 0 to 1 to ensure data validity; S12-3. Final linear interpolation calculation: Call Fn5, F1, and F2, and perform linear interpolation calculation on Fn5, F1, and F2, where Fn5 is used as the intermediate data of weighted average, F1 is used as the starting value, and F2 is used as the ending value; The specific calculation process is as follows: Step a: Calculate the difference: set F2 as the end pixel value, F1 as the start pixel value, and subtract F1 from F2. If the difference is less than 0, the difference will be clamped to 0. If the difference is greater than or equal to 0, the difference is W. Step b: Calculate interpolation: Set W as the background input pixel value, set Fn5 as the foreground input pixel value corresponding to each W, multiply W by Fn5, and the product is V; W and Fn5 are limited between 0 and 1; Step c: Calculate the final material height data: set V to the background input pixel value, set F1 to the foreground input pixel value corresponding to each V, and add V to F1 to obtain the final material height data multi-layer mixed data.

Citation Information

Patent Citations

  • A method and apparatus for processing texture data, an electronic device, and a storage medium.

    CN111667564B