Perspective fabric rendering method and device
By dynamically adjusting the edge transparency value in transparent fabrics and optimizing the edge visual effect of the fabric using normal vectors and view direction vectors, the problem of unnatural edge visual effect is solved, achieving a more natural and realistic rendering effect and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies do not render the visual effect of the edges of transparent fabrics in a natural way, resulting in poor display of the fabric from certain viewing angles.
By using the normal vector and direction vector of each point on the fabric based on the current viewpoint, the edge transparency value is determined, and the transparency value is adjusted by nonlinear function and scaling factor to optimize the visual effect of the fabric edge.
It achieves a natural and realistic sense of layering in the fabric from different angles, enhances the realism and immersion of the rendering effect, reduces rendering complexity and computational load, and improves the user experience.
Smart Images

Figure CN121639902A_ABST
Abstract
Description
Technical Field
[0001] This disclosure belongs to the field of clothing modeling technology, specifically relating to a rendering method and apparatus for transparent fabrics. Background Technology
[0002] Sheer fabrics are a special type of textile material that allows one to see objects or skin behind them. The design of sheer fabrics considers a balance between transparency and comfort, as well as how to control the display effect through the fabric's transparency and design cut. This material is frequently used in fashion design, such as in clothing, swimwear, evening gowns, and some avant-garde garments, to showcase the beauty of skin or underwear, while also demonstrating the designer's creativity and craftsmanship.
[0003] In the apparel industry, simulation technology uses computer software to simulate and predict the physical behavior and appearance of fabrics under different conditions. Simulation technology can also be applied to see-through fabrics, simulating the transparency and translucency of the fabric under different lighting conditions. This helps designers and engineers better understand and optimize the performance and effect of the fabric, and helps evaluate the visual effects and textures of different design options in a virtual environment. It also helps designers determine the best cuts and designs to ensure that the expected see-through effect is maintained during use.
[0004] Because the edges of transparent fabrics have a front-to-back occlusion relationship, the edges often present complex visual effects in the simulation of transparent fabrics. Existing technology for rendering transparent fabrics usually uses a uniform transparency treatment on the edge area and the inner area of the fabric. However, this method will result in the fabric not displaying itself naturally from certain perspectives. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, this disclosure proposes a method for rendering transparent fabrics, the method comprising:
[0006] In response to the adjustment command, the edge transparency value of the fabric is determined based on the fabric shape from the current viewpoint;
[0007] The edge transparency value is applied to the rendering of the fabric to reflect the optimized edge visual effect on the fabric.
[0008] Specifically, the phrase "determining the edge transparency value of the fabric based on the fabric shape from the current viewpoint" includes:
[0009] Obtain the normal vector and the current view direction vector of each point on the fabric, and determine the edge transparency value of the fabric based on each normal vector and the direction vector.
[0010] Preferably, the method further includes:
[0011] Obtain the angle between the normal vector of each point of the fabric and the current view direction vector, determine the points whose angle value is not greater than a preset angle value as edge points, and determine the edge transparency value of each edge point so as to apply the edge transparency value to the rendering of its corresponding edge point.
[0012] Specifically, the phrase "applying the edge transparency value to the rendering of the fabric to reflect the optimized edge visual effect on the fabric" includes:
[0013] The final transparency value of the fabric is determined by the edge transparency value and the initial transparency value of the fabric.
[0014] The fabric is rendered based on the final transparency value to reflect the optimized edge visual effect on the fabric.
[0015] The formula for calculating the final transparency value is:
[0016] α f =α i +α e =1+α i -|N·V|
[0017] Where, α f Represents the final transparency value, α i Represents the initial transparency value, α e N represents the edge transparency value, N represents the normal vector, and V represents the direction vector.
[0018] Furthermore, the method also includes:
[0019] If the final transparency value of the fabric is greater than the first preset value, the final transparency value is redefined as the second preset value; neither the first preset value nor the second preset value is greater than the third preset value.
[0020] Preferably, the method further includes:
[0021] The edge transparency value is adjusted using a first function to correct the edge transparency value, and / or the edge transparency value is adjusted according to a scaling factor to correct the edge transparency value of the fabric; the formula for correcting the edge transparency value is:
[0022]
[0023] Where, α tThis represents the corrected edge transparency value, where x is the calculated adjustment value and scale is the scaling factor used to adjust the magnitude of the transparency change.
[0024] Furthermore, the value of the scaling factor is determined based on the material of the fabric and / or the display scenario of the fabric.
[0025] Furthermore, the phrase "applying the edge transparency value to the rendering of the fabric" includes:
[0026] If the current frame is not the initial frame, determine the color value of the fabric in the current frame;
[0027] The color value, the edge transparency value, and the rendering result of the previous frame are mixed and then rendered to obtain the rendering result of the fabric in the current frame.
[0028] This disclosure also proposes a rendering apparatus for transparent fabrics, the apparatus comprising:
[0029] A calculation module is used to determine the edge transparency value of the fabric based on the fabric shape from the current viewpoint in response to an adjustment command.
[0030] The rendering module is used to apply the edge transparency value to the rendering of the fabric to reflect the optimized edge visual effect on the fabric.
[0031] This disclosure also proposes a computer-readable storage medium storing executable instructions for implementing, when executed by a processor, the rendering method for the see-through fabric as described above.
[0032] This disclosure has at least the following beneficial effects:
[0033] The proposed solution can simulate a more natural and realistic fabric perspective effect, thereby reflecting the layering, lightness or heaviness of the fabric at different angles, making the rendered fabric closer to the real world, improving the overall visual realism and immersion, providing users with a better experience, and is suitable for application scenarios that require real-time interaction.
[0034] Specifically, the proposed solution uses the normal vector of each point on the fabric surface and the direction vector of the current viewpoint to determine the transparency value. It can accurately adjust the transparency according to the angle of light projection. By using nonlinear functions and scaling factors to adjust the edge transparency value, the transparency value can be more finely corrected, making the rendering effect smoother and more natural and compatible with the fabric material and display scene. At the same time, the consistency of the rendering result and the stability of the visual effect are ensured by preset limit values and correction values.
[0035] Furthermore, the proposed solution can also use a local optimization method that adjusts the transparency of only the edge parts instead of processing the entire fabric globally, thereby effectively reducing the complexity and computational load of rendering, improving rendering efficiency, reducing the consumption of system resources, and enabling the blending of the rendering results of the previous frame with the rendering results of consecutive frames to achieve a smooth transition and optimize the visual experience for users.
[0036] Therefore, this disclosure provides a rendering method and apparatus for transparent fabrics. The proposed solution can dynamically adjust the edge transparency value of the fabric according to the current viewing angle, so that the transparent fabric can achieve a more realistic and optimized edge visual effect under different viewing angles. This makes the fabric look more natural and realistic under different lighting and angles. Furthermore, by optimizing the edge visual effect of the fabric, the realism and visualization effect of the fabric in the virtual environment are improved. This can significantly improve the user's experience quality in the virtual environment or design preview, and help users evaluate the visual effects and textures of different design choices in the virtual environment. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 A schematic diagram of the method flow for rendering the see-through fabric provided in Example 1;
[0039] Figure 2 A flowchart illustrating the process of determining the final transparency value and rendering;
[0040] Figure 3 A flowchart illustrating the method for rendering mixed consecutive frames;
[0041] Figures 4(a)-(b) are control group diagrams comparing the normal rendering method and the rendering method of the transparent fabric provided in Example 1 for the same fabric, where Figure 4(a) is an example diagram using the normal rendering method and Figure 4(b) is an example diagram using the rendering method of the transparent fabric provided in Example 1.
[0042] Figure 5 A schematic diagram of the module structure of the rendering device for the transparent fabric provided in Example 2.
[0043] Figure Labels
[0044] 10-Calculation module; 20-Rendering module; 21-Overlay unit; 22-Constraint unit; 23-Processing unit; 24-Acquisition unit; 25-Blending unit; 30-Adjustment module. Detailed Implementation
[0045] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. Based on the embodiments of this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this disclosure.
[0046] Various embodiments of this disclosure will be described more fully below. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.
[0047] In the following, the terms “comprising” or “may include”, which may be used in various embodiments of this disclosure, indicate the presence of the disclosed functions, operations, or elements, and do not limit the addition of one or more functions, operations, or elements. Furthermore, as used in various embodiments of this disclosure, the terms “comprising,” “having,” and their cognates are intended only to indicate a particular feature, number, step, operation, element, component, or combination of the foregoing, and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing, or the possibility of adding one or more combinations of the foregoing.
[0048] In various embodiments of this disclosure, the expression "or" or "at least one of A and / or B" includes any combination or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A and / or B" may include A, may include B, or may include both A and B.
[0049] The terms used in the various embodiments of this disclosure (such as "first," "second," etc.) may modify various components in the various embodiments, but do not limit the corresponding components. For example, the above terms do not limit the order and / or importance of the components. The above terms are only used for the purpose of distinguishing one component from others. For example, a first user device and a second user device refer to different user devices, although both are user devices. For example, a first component may be referred to as a second component without departing from the scope of the various embodiments of this disclosure, and similarly, a second component may also be referred to as a first component.
[0050] It should be noted that, unless otherwise explicitly specified and defined, the terms "installation," "connection," and "fixation" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this disclosure according to the specific circumstances.
[0051] In this disclosure, those skilled in the art should understand that the terms indicating orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings and are only for the convenience of describing this disclosure and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure.
[0052] The terminology used in the various embodiments of this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the various embodiments of this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this disclosure pertain. Terms (such as those defined in a generally used dictionary) are to be interpreted as having the same meaning as in the context of the relevant technical field and are not to be interpreted as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this disclosure.
[0053] Example 1
[0054] This embodiment proposes a rendering method for transparent fabrics, see [link to documentation]. Figure 1 The method includes:
[0055] S100: In response to adjustment commands, determine the edge transparency value of the fabric based on the fabric shape from the current viewpoint.
[0056] In this embodiment, the determination of the edge transparency value of the fabric based on the fabric shape from the current viewpoint in step S100 is achieved by calculating the normal vector of each point on the fabric and the current viewpoint direction vector. Specifically, the formula for calculating the edge transparency value is:
[0057] α e =1-|N·V|
[0058] Where, α eThe value represents the edge transparency, N represents the normal vector, V represents the direction vector of the current view, and |N·V| is the absolute value of the dot product of the normal vector and the direction vector of the current view.
[0059] S200: Apply the edge transparency value to the fabric rendering to reflect the optimized edge visual effect on the fabric.
[0060] Preferably, step S100 further includes:
[0061] Obtain the angle between the normal vector of each point on the fabric and the current view direction vector, determine the points whose angle value is not greater than the preset angle value as edge points, and determine the edge transparency value of each edge point so that the edge transparency value can be applied to the rendering of its corresponding edge point in step S200.
[0062] It should be noted that in computer graphics, fabric surfaces are usually discretized into a set of meshes or triangular patches for processing and rendering. Each point on the fabric surface refers to a mesh point and / or vertex that makes up the fabric. Each point has surface properties and a definite three-dimensional coordinate, which can represent a discretized position on the fabric. These points are connected by edges to form meshes or patches, thereby defining the topological structure of the fabric surface.
[0063] Points where the angle between the fabric's normal vector and the current viewing direction vector is 0 degrees (i.e., points where the normal vector and the viewing direction vector completely coincide) are identified as edges or points of change on the fabric surface. These points typically occur when the fabric is wrinkled, curved, or at a large angle to the current viewing angle. Points where the angle between the fabric's normal vector and the current viewing direction vector is 90 degrees (i.e., points where the normal vector and the viewing direction vector are perpendicular) have the same normal vector as the current viewing direction vector. In these cases, the points are either flat or directly facing the current viewing angle.
[0064] In one specific embodiment, the preset angle value is 60 degrees.
[0065] Further, see Figure 2 Step S200 includes:
[0066] S210: Determine the final transparency value of the fabric by using the edge transparency value and the initial transparency value of the fabric.
[0067] Specifically, applying edge transparency values to fabric rendering involves determining the final transparency value of the fabric using its edge transparency value and initial transparency value, and then rendering the fabric based on the final transparency value. The formula for calculating the final transparency value of the fabric is as follows:
[0068] α f =α i +α e=1+α i -|N·V|
[0069] Where, α f α represents the final transparency value of the fabric. i This represents the initial transparency value of the fabric.
[0070] S220: If the final transparency value of the fabric is greater than the first preset value, the final transparency value is redefined as the second preset value.
[0071] It should be noted that the first preset value and the second preset value can be the same or different, and neither the first preset value nor the second preset value is greater than the third preset value. Depending on the specific application scenario in this field, the numerical expressions for the first preset value, the second preset value, and the third preset value can be varied. In this embodiment, the third preset value is 1. For example, when both the first preset value and the second preset value are 1, if the final transparency value α of the fabric... f If the value is greater than 1, then step S220 will set the final transparency value α of the fabric. f The value is reset to 1; in other embodiments, the first preset value and the second preset value can both use other values, such as 0.8, 0.9, etc.
[0072] S230: Render the fabric based on the final transparency value to reflect the optimized edge visual effect on the fabric.
[0073] Preferably, see Figure 3 Step S200 further includes:
[0074] S240: If the current frame is not the initial frame, determine the color value of the fabric in the current frame.
[0075] It should be noted that the color value mentioned in step S240 refers to the final RGB color value of each pixel in the rendering, that is, a combination of red, green, and blue. These color values determine the displayed color and transparency level of each pixel on the screen. When processing see-through fabrics, the generated color refers to the final color calculated after considering lighting, material properties, and other rendering parameters. This color can be any RGB value, depending on the influence of lighting in the scene and the reflective or refractive properties of the material.
[0076] S250: Mix the color value, edge transparency value and the rendering result of the previous frame and then render to obtain the rendering result of the fabric in the current frame.
[0077] By mixing the color and transparency generated in each frame with the result of the previous frame in step S250 before rendering, it is possible to ensure a smooth and realistic transition between consecutive frames. The mixing can be a simple linear interpolation mixing, or it can be mixed according to a specific mixing mode.
[0078] In this embodiment, the fabric rendering is automatically completed through the GPU rendering pipeline. It should be noted that the GPU rendering pipeline refers to the process and technology used by the graphics processing unit (GPU) to generate real-time graphics. It is highly optimized at both the hardware and software levels to support complex graphics effects and real-time rendering requirements.
[0079] A GPU rendering pipeline typically consists of multiple stages or steps that are executed in parallel on the GPU hardware to accelerate graphics rendering and achieve high graphics quality. Current modern GPU rendering pipelines include several main stages such as the application stage, geometry stage, rasterization stage, fragment shading stage, and output compositing stage.
[0080] In the application phase, the application sends graphics data such as vertex data and shader programs to the GPU. The application phase includes CPU-side application processing, such as scene management and animation calculations. In the geometry phase, the GPU processes vertex data, including the execution of vertex shaders. Vertex shaders are responsible for processing each vertex individually, performing transformations, lighting calculations, etc. The rasterization phase converts vertex data into image pixels, thereby determining which pixels are visible on the screen and generating corresponding pixel fragments for subsequent processing. The fragment shader is responsible for calculating the final color of each fragment, and can perform texture mapping, lighting models, transparency calculations, etc., to determine the final pixel color displayed on the screen. The output compositing phase is usually the final phase, where the GPU composites all fragment colors and depth information into the final image. The output compositing phase may also include operations such as blending to handle issues such as transparency and depth sorting.
[0081] Preferably, see Figure 3 The method further includes:
[0082] S300: Adjust the edge transparency value using a first function to correct the edge transparency value, and / or adjust the edge transparency value according to a scaling factor to correct the edge transparency value of the fabric.
[0083] Specifically, the first function may include, but is not limited to, a nonlinear function. For example, step S300 can adjust the edge transparency using a nonlinear function. This adjustment method has a smaller weight on the viewing angle parallel to the fabric and a larger weight on the side effect, thus achieving a smoother transition at the edge of the fabric. Specifically, the formula for correcting the edge transparency value is:
[0084]
[0085] Where, α t This represents the corrected edge transparency value, where x is the operation adjustment value. For example, when the edge transparency is adjusted by squaring the edge using a quadratic function, x = 2; when the edge transparency is adjusted by squaring the edge using a cubic function, x = 3; and when the edge transparency is adjusted by other operations, x can take values other than 2 and 3.
[0086] And / or, step S300 may further correct the edge transparency value according to the scaling factor to determine the edge transparency value of the fabric. The formula for correcting the edge transparency value may also be:
[0087] α t =α e *scale=(1-|N·V|)*scale
[0088] Here, scale is a scaling factor used to adjust the magnitude of changes in transparency.
[0089] After step S300, the edge transparency value is adjusted, and the formula for calculating the final transparency value of the fabric is modified accordingly:
[0090] α f =α i +α t *csale=α i +(1-|N·V|) x *scale
[0091] It should be noted that if the edge transparency is adjusted only through a non-linear function, the scaling factor (scale) can be set to 1. If the edge transparency is adjusted only through a scaling factor, the operation adjustment value (x) can be set to 1.
[0092] Preferably, the value of the scaling factor can be determined based on the fabric material and / or the fabric display scenario.
[0093] Referring to Figures 4(a)-(b), the method proposed in this embodiment can be applied to the three-dimensional display interface of transparent fabrics. The three-dimensional display interface can automatically adjust the viewing angle or dynamically adjust the viewing angle based on the user's operation. By applying the method proposed in this embodiment, the edge effect of transparent fabrics can be made to have continuity in the dynamic display process, so as to achieve a more natural, realistic and attractive visual effect.
[0094] Therefore, the method proposed in this embodiment not only improves the perspective of the fabric, but also dynamically adjusts the edge transparency according to the change of viewing angle, ensuring that users can feel the real texture and perspective effect of the fabric from any angle. This allows users to more intuitively perceive the details and texture of the fabric in the 3D display interface, and obtain a consistent high-quality visual experience whether in static observation or dynamic interactive operation.
[0095] Example 2
[0096] This embodiment proposes a rendering device for transparent fabrics to implement the rendering method for transparent fabrics proposed in Embodiment 1. See [link to embodiment]. Figure 5 The device includes:
[0097] The calculation module 10 is used to determine the edge transparency value of the fabric based on the fabric shape from the current viewpoint in response to the adjustment command.
[0098] Rendering module 20 is used to apply edge transparency values to the rendering of the fabric to reflect the optimized edge visual effect on the fabric.
[0099] In this embodiment, the calculation module 10 determines the edge transparency value by calculating the normal vector of each point on the fabric and the current viewpoint direction vector, using the following formula:
[0100] α e =1-|N·V|
[0101] Where, α e The value represents the edge transparency, N represents the normal vector, V represents the direction vector of the current view, and |N·V| is the absolute value of the dot product of the normal vector and the direction vector of the current view.
[0102] Preferably, the calculation module 10 can obtain the angle between the normal vector of each point of the fabric and the current view direction vector, determine the points whose angle value is not greater than the preset angle value as edge points, and determine the edge transparency value of each edge point respectively, so that the rendering module 20 only needs to apply the edge transparency value to the rendering of its corresponding edge point; in a specific embodiment, the preset angle value is 60 degrees.
[0103] Furthermore, the rendering module 20 includes:
[0104] The overlay unit 21 is used to determine the final transparency value of the fabric by using the edge transparency value and the initial transparency value of the fabric.
[0105] The limiting unit 22 is used to redefine the final transparency value to a second preset value when the final transparency value of the fabric is greater than a first preset value;
[0106] Processing unit 23 is used to render the fabric based on the final transparency value to reflect the optimized edge visual effect on the fabric.
[0107] Specifically, the overlay unit 21 applies the edge transparency value to the fabric rendering by determining the final transparency value of the fabric using the edge transparency value and the initial transparency value, and then rendering the fabric based on the final transparency value. The formula for calculating the final transparency value of the fabric is as follows:
[0108] α f =α i +α e =1+α i -|N·V|
[0109] Where, α f α represents the final transparency value of the fabric. i This represents the initial transparency value of the fabric.
[0110] The first and second preset values can be the same or different, and neither the first nor the second preset value is greater than the third preset value. Depending on the specific application scenario, the first, second, and third preset values can be expressed in many ways. In this embodiment, the third preset value is 1. For example, when both the first and second preset values are 1, if the final transparency value α of the fabric... f If the value is greater than 1, then the limiting unit 22 will set the final transparency value α of the fabric to... f The value is reset to 1; in other embodiments, the first preset value and the second preset value can both use other values, such as 0.8, 0.9, etc.
[0111] Preferably, the rendering module 20 further includes:
[0112] The acquisition unit 24 is used to determine the color value of the fabric in the current frame when the current frame is not the initial frame;
[0113] The blending unit 25 is used to blend the color value, edge transparency value and the rendering result of the previous frame before rendering to obtain the rendering result of the fabric in the current frame.
[0114] By using the blending unit 25 to blend the color and transparency generated in each frame with the result of the previous frame before rendering, a smooth and realistic transition between consecutive frames can be ensured. The blending can be a simple linear interpolation blend, or it can be blended according to a specific blending mode.
[0115] Preferably, the device further includes:
[0116] The adjustment module 30 is used to adjust the edge transparency value through a first function to correct the edge transparency value, and / or to adjust the edge transparency value according to a scaling factor to correct the edge transparency value of the fabric.
[0117] Specifically, the first function may include, but is not limited to, a nonlinear function. For example, the adjustment module 30 can adjust the edge transparency using a nonlinear function. This adjustment method has a smaller impact on the viewing angle parallel to the fabric and a larger impact on the side effect, thus achieving a smoother transition at the edge of the fabric. Specifically, the formula for correcting the edge transparency value is:
[0118]
[0119] Where, α t This represents the corrected edge transparency value, where x is the operational adjustment value;
[0120] And / or, the adjustment module 30 can also correct the edge transparency value according to the scaling factor to determine the edge transparency value of the fabric. The formula for correcting the edge transparency value can also be:
[0121] α t =α e *scale=(1-|N·V|)*scale
[0122] Here, scale is a scaling factor used to adjust the magnitude of changes in transparency.
[0123] After step S300, the edge transparency value is adjusted, and the formula for calculating the final transparency value of the fabric is modified accordingly:
[0124] α f =α i +α t *scale=α i +(1-|N·V|) x *scale
[0125] It should be noted that if the edge transparency is adjusted only through a non-linear function, the scaling factor (scale) can be set to 1. If the edge transparency is adjusted only through a scaling factor, the operation adjustment value (x) can be set to 1.
[0126] Preferably, the value of the scaling factor can be determined based on the fabric material and / or the fabric display scenario.
[0127] Example 3
[0128] This embodiment proposes a computer-readable storage medium storing executable instructions that, when executed by a processor, implement the rendering method for transparent fabrics as proposed in Embodiment 1.
[0129] In summary, this disclosure provides a rendering method and apparatus for transparent fabrics. The proposed solution can dynamically adjust the edge transparency value of the fabric according to the current viewing angle, so that the transparent fabric can achieve a more realistic and optimized edge visual effect under different viewing angles. This makes the fabric look more natural and realistic under different lighting and angles. Furthermore, by optimizing the edge visual effect of the fabric, the realism and visualization effect of the fabric in the virtual environment are improved. This can significantly enhance the user's experience quality in the virtual environment or design preview, and help users evaluate the visual effects and textures of different design choices in the virtual environment.
[0130] The above description is only a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.
Claims
1. A rendering method of a see-through fabric, characterized by, The method comprises: determining an edge transparency value of the fabric based on a fabric form of a current view angle in response to an adjustment instruction; applying the edge transparency value to rendering of the fabric to embody an optimized edge visual effect on the fabric.
2. The rendering method of a see-through fabric according to claim 1, wherein, The "determining an edge transparency value of the fabric based on a fabric form of a current view angle" comprises: obtaining normal vectors of each point on the fabric and a current view direction vector, and determining the edge transparency value of the fabric based on each normal vector and the direction vector.
3. The method of rendering a see-through fabric according to claim 2, wherein, The method further comprises: obtaining an angle value between the normal vector of each point on the fabric and the current view direction vector, determining a point with an angle value not greater than a preset angle value as an edge point, and determining an edge transparency value of each edge point respectively, so as to apply each edge transparency value to rendering of the corresponding edge point.
4. The rendering method of a see-through fabric according to claim 2 or 3, wherein, The "applying the edge transparency value to rendering of the fabric to embody an optimized edge visual effect on the fabric" comprises: determining a final transparency value of the fabric through the edge transparency value and an initial transparency value of the fabric; rendering the fabric based on the final transparency value to embody an optimized edge visual effect on the fabric.
5. The method of rendering a see-through fabric according to claim 4, wherein, The method further comprises: if the final transparency value of the fabric is greater than a first preset value, re-determining the final transparency value as a second preset value; the first preset value and the second preset value are both not greater than a third preset value.
6. The method of rendering a see-through fabric according to claim 4, wherein, The method further comprises: adjusting the edge transparency value through a first function to correct the edge transparency value, and / or adjusting the edge transparency value according to a scaling factor to correct the edge transparency value of the fabric.
7. The method of rendering a see-through fabric according to claim 6, wherein, The value of the scaling factor is determined based on a material of the fabric and / or a display scene of the fabric.
8. The method of rendering a see-through fabric according to claim 1, wherein, The "applying the edge transparency value to rendering of the fabric" comprises: if a current frame is not an initial frame, determining a color value presented by the fabric in the current frame; mixing the color value, the edge transparency value and a rendering result of a previous frame, and then rendering to obtain a rendering result of the fabric in the current frame.
9. An apparatus for rendering a see-through fabric, the apparatus comprising: a rendering device configured to render a see-through fabric; and a display device configured to display the rendered see-through fabric. The device comprises: a calculation module configured to determine an edge transparency value of the fabric based on a fabric form of a current view angle in response to an adjustment instruction; a rendering module configured to apply the edge transparency value to rendering of the fabric to embody an optimized edge visual effect on the fabric.
10. A computer-readable storage medium, characterized in that, The device further comprises a storage storing executable instructions for being executed by a processor to implement the method according to any one of claims 1-8.