Intelligent rendering method and device for 3D contour shadow of multi-layer texture, and electronic equipment

CN122676038APending Publication Date: 2026-09-01SHENZHEN GREEN CONNECTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610519483.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-17
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

对于方案一,虽然其方案实现简单,但存在单层阴影的效果较为单一、缺乏层次感、无法模拟真实的立体堆叠效果、阴影边缘模糊度固定,难以形成清晰的轮廓感,以及,在深色背景下阴影不明显,视觉效果差

Benefits of technology

本发明实施例中,提供了一种多图层纹理的3D轮廓阴影智能渲染方法,实施本发明,能够通过异步加载、离屏上下文、图层顺序管控及主线程解耦机制,将较为耗时的渲染计算过程与主线程分离,仅在最终合成图像时传递至主线程进行显示,有效降低了主线程的负载,减少了界面卡顿与丢帧现象,有利于提升渲染效率、界面流畅度与渲染准确性,以及保障了复杂图层结构下显示输出的稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122676038A_ABST
    Figure CN122676038A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, and electronic device for intelligent rendering of 3D contour shadows with multi-layer textures. The method includes: asynchronously loading a target image according to image rendering requirements, and performing task scheduling, off-screen context creation, and layer parameter configuration to obtain a first image processing result; determining whether there is at least one layer to be drawn, and if so, performing stack storage, layer parameter setting operations based on the first image processing result, and image drawing on all target layers in layer order to obtain a second image processing result for each target layer; when there is no layer to be drawn, generating a target composite image based on all second image processing results, and performing image rendering and display operations on the target composite image by the main thread to display the target composite image. It is evident that implementing this invention can improve the rendering precision and effect of 3D shadows while reducing rendering resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image rendering technology, and in particular to a method, apparatus, and electronic device for intelligent rendering of 3D contour shadows with multi-layer textures. Background Technology

[0002] In large-screen multimedia applications, visual elements such as homepage posters, brand logos, and cover images typically need to convey a sense of depth and layering to enhance the interface's visual appeal and professionalism. Common implementation solutions in existing technologies include: Option 1: Single-Layer Shadow Solution. This solution uses standard shadow APIs provided by the system (such as `layer.shadowColor`, `layer.shadowOffset`, and `layer.shadowRadius` in iOS) to apply shadow effects to a single image. Option 2: Multi-View Overlay Solution. This solution creates multiple UIImageViews or SwiftUIViews, copies the same image multiple times, and overlays them, setting different offsets and opacities for each layer to achieve the desired image effect. Option 3: Pre-rendered Asset Solution. This solution involves designers pre-creating image assets with shadow effects, which are then directly loaded and displayed on the client side.

[0003] However, existing technical solutions have several shortcomings. For Solution 1, while simple to implement, the single-layer shadow effect is rather monotonous, lacks depth, cannot simulate realistic 3D stacking, has fixed shadow edge blur, making it difficult to form a clear outline, and the shadow is indistinct against dark backgrounds, resulting in poor visual effects. For Solution 2, multi-view overlay requires creating multiple view instances, leading to high memory consumption. Each view layer needs independent rendering, increasing the GPU load. Furthermore, aligning and synchronizing different view layers is difficult, easily causing misalignment. Additionally, multi-view overlay cannot achieve perspective transformation, failing to meet users' needs for a sense of depth. For Solution 3, since all rendering materials are pre-made, it has low flexibility and cannot dynamically adjust themes / content according to user needs. Therefore, providing a corresponding solution to address the aforementioned technical shortcomings of existing image rendering technologies is particularly important. Summary of the Invention

[0004] This invention provides a method, apparatus, and electronic device for intelligent rendering of 3D contour shadows with multi-layer textures, which improves the rendering precision, layering, and rendering effect of 3D shadows in images while reducing rendering resource consumption.

[0005] The first aspect of this invention discloses a method for intelligent rendering of 3D contour shadows using multi-layer textures, the method comprising: The method is applied to an electronic device with an application installed, and the electronic device is communicatively connected to a network-attached storage device (NAT). The electronic device accesses the NAT through the application. The method includes: When an image rendering requirement is detected, a target image matching the image rendering requirement is asynchronously loaded according to a preset process, and task scheduling operation, off-screen context creation operation, and layer parameter configuration operation are performed according to the image rendering requirement to obtain a first image processing result for the image rendering requirement; the first image processing result is used to provide reference data for subsequent rendering operations of the target image; Determine whether there is at least one layer to be drawn. When it is determined that there is at least one layer to be drawn, perform stack storage operation, layer parameter setting operation based on the first image processing result, and image drawing operation on all target layers to be processed in the order of the layers to obtain the second image processing result corresponding to each target layer. When it is determined that there are no more layers to be drawn, a target composite image is generated for the target image based on all the second image processing results, and the target composite image is passed to the main thread. The main thread then performs image rendering and display operations on the target composite image to display the target composite image on the display interface of the electronic device.

[0006] As an optional implementation, in the first aspect of the present invention, the step of performing task scheduling operations, off-screen context creation operations, and layer parameter configuration operations according to the image rendering requirements to obtain a first image processing result for the image rendering requirements includes: Identify all target image processing tasks that respond to the image rendering request, and schedule the target image processing tasks to a global background concurrent queue to schedule the target image processing tasks from the main thread to a background thread; An off-screen rendering context with the same image size as the target image is created, and the off-screen rendering context is set outside the display interface of the electronic device; the off-screen rendering context includes a blank canvas; Determine all first layer parameters for the blank canvas, and perform parameter initialization operations on all first layer parameters to obtain initialization results for all first layer parameters; The off-screen rendering context and the initialization result are determined as the first image processing result for the image rendering requirements.

[0007] As an optional implementation, in a first aspect of the present invention, the blank canvas is used to draw layers; the first layer parameters include at least one of the following: total number of layers, shadow color, shadow offset, shadow blur, transparency attenuation coefficient, perspective intensity, and translation increment. The process of determining all target image processing tasks in response to the image rendering request includes: Determine multiple image processing tasks from the main thread to respond to the image rendering request; Determine the expected task time for each of the image processing tasks; Select all target image processing tasks whose expected task time exceeds a preset time threshold from all the image processing tasks.

[0008] As an optional implementation, in the first aspect of the present invention, the step of performing a stack storage operation, a layer parameter setting operation based on the first image processing result, and an image drawing operation on all target layers to be processed in layer order to obtain a second image processing result corresponding to each target layer includes: Based on the preset layer order, select the layer to be processed from all target layers and designate it as the first layer; The first layer is pushed onto the stack for storage. The push operation is used to save the graphics state of the rendering context corresponding to the first layer and to isolate the first layer to a preset state stack. Based on the image rendering requirements, determine the layer drawing items for the first layer, which include parameter setting details for multiple second layer parameters; Based on the layer drawing requirements, perform parameter setting operations on all second layer parameters to set the parameter values ​​of the second layer parameters; all second layer parameters include shadow parameters, transparency, and perspective transformation parameters; Based on the first image processing result and all the parameters of the second layer, perform an image drawing operation on the first layer to obtain the drawn second layer, which is used as the second image processing result. In addition, the third layer is determined as the new first layer, wherein the third layer is the layer that is adjacent to the first layer among all the target layers and whose layer order is after the first layer.

[0009] As an optional implementation, in the first aspect of the invention, before determining the third layer as the new first layer, the method further includes: Perform a pop operation on the second layer to remove the second layer from the state stack; Perform a parameter reset operation on all parameters of the second layer to obtain the parameter reset result for all parameters of the second layer; Determine whether the number of layers of the target layer other than the first layer is 0. If the determination result is yes, determine that the drawing operation for all the target layers is completed. If the determination result is negative, according to the layer order, the target layer that is adjacent to the first layer and after the first layer is determined as the third layer, and the operation of determining the third layer as the new first layer is triggered.

[0010] As an optional implementation, in the first aspect of the present invention, the shadow parameters include shadow color, relative offset between the shadow to be rendered and the image, and shadow blur; the perspective transformation parameters include a three-dimensional transformation matrix and its corresponding perspective parameters; the perspective parameters are used to adjust the perspective intensity of the image to which the three-dimensional transformation matrix is ​​applied. Furthermore, all the target layers include at least one bottom-level layer and one top-level layer; the parameter value corresponding to each second layer parameter of the top-level layer is 0; the bottom-level layer needs to set at least one second layer parameter; and the first layer belongs to the bottom-level layer.

[0011] As an optional implementation, in the first aspect of the present invention, the asynchronous loading of the target image matching the image rendering requirements according to a preset process includes: Receive the image URL corresponding to the image rendering requirement; A query operation is performed on the local cache based on the image URL to obtain a query result for the image URL; when the query result indicates that a first image resource corresponding to the image URL exists in the local cache, the first image resource is read to obtain the target image; When the query result indicates that there is no image resource corresponding to the image URL in the local cache, a network request is initiated, and a second image resource corresponding to the image URL is asynchronously downloaded according to the network request, so as to obtain an asynchronous download result for the image URL; When the asynchronous download result indicates that the second image resource corresponding to the image URL has been successfully downloaded, an image decoding operation is performed on the second image resource to obtain the target image; When the asynchronous download result indicates that the second image resource corresponding to the image URL has not been successfully downloaded, a preset placeholder image or default icon is determined as the target image, and a prompt message indicating download failure is output.

[0012] A second aspect of this invention discloses a 3D contour shadow intelligent rendering device with multi-layer textures. The device is applied to an electronic device with an application installed, and the electronic device is communicatively connected to a network-attached storage device (NAT). The electronic device accesses the NAT through the application. The device includes: The image loading module is used to asynchronously load the target image that matches the image rendering requirement according to a preset process when an image rendering requirement is detected. The first image processing module is used to perform task scheduling operations, off-screen context creation operations, and layer parameter configuration operations according to the image rendering requirements, so as to obtain a first image processing result for the image rendering requirements; the first image processing result is used to provide reference data for subsequent rendering operations of the target image; The judgment module is used to determine whether there is at least one layer to be drawn. The second image processing module is used to perform a stack storage operation, a layer parameter setting operation based on the first image processing result, and an image drawing operation on all target layers to be processed in the order of the layers when the judgment module determines that there is at least one layer to be drawn, so as to obtain a second image processing result corresponding to each target layer. An image generation module is used to generate a target composite image for the target image based on all the second image processing results when the judgment module determines that there is no longer a layer to be drawn. The display module is used to pass the target composite image to the main thread, and the main thread performs image rendering and display operations on the target composite image to display the target composite image on the display interface of the electronic device.

[0013] As an optional implementation, in a second aspect of the present invention, the first image processing module performs task scheduling operations, off-screen context creation operations, and layer parameter configuration operations according to the image rendering requirements to obtain a first image processing result for the image rendering requirements, specifically including: Identify all target image processing tasks that respond to the image rendering request, and schedule the target image processing tasks to a global background concurrent queue to schedule the target image processing tasks from the main thread to a background thread; An off-screen rendering context with the same image size as the target image is created, and the off-screen rendering context is set outside the display interface of the electronic device; the off-screen rendering context includes a blank canvas; Determine all first layer parameters for the blank canvas, and perform parameter initialization operations on all first layer parameters to obtain initialization results for all first layer parameters; The off-screen rendering context and the initialization result are determined as the first image processing result for the image rendering requirements.

[0014] As an optional implementation, in a second aspect of the invention, the blank canvas is used to draw layers; the first layer parameters include at least one of the following: total number of layers, shadow color, shadow offset, shadow blur, transparency attenuation coefficient, perspective intensity, and translation increment. The first image processing module determines the specific methods for all target image processing tasks in response to the image rendering request, including: Determine multiple image processing tasks from the main thread to respond to the image rendering request; Determine the expected task time for each of the image processing tasks; Select all target image processing tasks whose expected task time exceeds a preset time threshold from all the image processing tasks.

[0015] As an optional implementation, in the second aspect of the present invention, the second image processing module performs a stack storage operation, a layer parameter setting operation based on the first image processing result, and an image drawing operation on all target layers to be processed in layer order, respectively, to obtain a second image processing result corresponding to each target layer. Specifically, this includes: Based on the preset layer order, select the layer to be processed from all target layers and designate it as the first layer; The first layer is pushed onto the stack for storage. The push operation is used to save the graphics state of the rendering context corresponding to the first layer and to isolate the first layer to a preset state stack. Based on the image rendering requirements, determine the layer drawing items for the first layer, which include parameter setting details for multiple second layer parameters; Based on the layer drawing requirements, perform parameter setting operations on all second layer parameters to set the parameter values ​​of the second layer parameters; all second layer parameters include shadow parameters, transparency, and perspective transformation parameters; Based on the first image processing result and all the parameters of the second layer, perform an image drawing operation on the first layer to obtain the drawn second layer, which is used as the second image processing result. In addition, the third layer is determined as the new first layer, wherein the third layer is the layer that is adjacent to the first layer among all the target layers and whose layer order is after the first layer.

[0016] As an optional implementation, in the second aspect of the present invention, the second image processing module performs a stack storage operation, a layer parameter setting operation based on the first image processing result, and an image drawing operation on all target layers to be processed in layer order, respectively, to obtain a second image processing result corresponding to each target layer. Specifically, this method further includes: Before determining the third layer as the new first layer, a pop operation is performed on the second layer to remove the second layer from the state stack; Perform a parameter reset operation on all parameters of the second layer to obtain the parameter reset result for all parameters of the second layer; Determine whether the number of layers of the target layer other than the first layer is 0. If the determination result is yes, determine that the drawing operation for all the target layers is completed. If the determination result is negative, according to the layer order, the target layer that is adjacent to the first layer and after the first layer is determined as the third layer, and the operation of determining the third layer as the new first layer is triggered.

[0017] As an optional implementation, in a second aspect of the present invention, the shadow parameters include shadow color, relative offset between the shadow to be rendered and the image, and shadow blur; the perspective transformation parameters include a three-dimensional transformation matrix and its corresponding perspective parameters; the perspective parameters are used to adjust the perspective intensity of the image to which the three-dimensional transformation matrix is ​​applied; Furthermore, all the target layers include at least one bottom-level layer and one top-level layer; the parameter value corresponding to each second layer parameter of the top-level layer is 0; the bottom-level layer needs to set at least one second layer parameter; and the first layer belongs to the bottom-level layer.

[0018] As an optional implementation, in the second aspect of the present invention, the method by which the image loading module asynchronously loads the target image matching the image rendering requirements according to a preset process specifically includes: Receive the image URL corresponding to the image rendering requirement; A query operation is performed on the local cache based on the image URL to obtain a query result for the image URL; when the query result indicates that a first image resource corresponding to the image URL exists in the local cache, the first image resource is read to obtain the target image; When the query result indicates that there is no image resource corresponding to the image URL in the local cache, a network request is initiated, and a second image resource corresponding to the image URL is asynchronously downloaded according to the network request, so as to obtain an asynchronous download result for the image URL; When the asynchronous download result indicates that the second image resource corresponding to the image URL has been successfully downloaded, an image decoding operation is performed on the second image resource to obtain the target image; When the asynchronous download result indicates that the second image resource corresponding to the image URL has not been successfully downloaded, a preset placeholder image or default icon is determined as the target image, and a prompt message indicating download failure is output.

[0019] A third aspect of the present invention discloses an electronic device, the electronic device having an application program installed; the electronic device being communicatively connected to a network attached storage device; and the electronic device accessing the network attached storage device through the application program. The electronic device integrates a 3D contour shadow intelligent rendering device for multi-layer textures as described in any of the second aspects of the present invention, and is used to execute a 3D contour shadow intelligent rendering method for multi-layer textures as described in any of the first aspects of the present invention. The electronic device is also used to perform the image rendering and display operation on the target composite image after receiving the target composite image transmitted by the main thread, and to display the image rendering and display image corresponding to the target composite image on the display interface of the electronic device.

[0020] The fourth aspect of this invention discloses a 3D contour shadow intelligent rendering system for multi-layer textures. The system includes a 3D contour shadow intelligent rendering device for multi-layer textures as described in any of the second aspects of this invention, and a network-attached storage device communicatively connected to the 3D contour shadow intelligent rendering device for multi-layer textures. The 3D contour shadow intelligent rendering device for multi-layer textures intelligently manages and processes image data stored in the network-attached storage device according to the 3D contour shadow intelligent rendering method for multi-layer textures as described in any of the first aspects of this invention, in order to respond to detected image rendering requirements. or, The system includes an electronic device as described in the third aspect of the present invention, and a network-attached storage device communicatively connected to the electronic device; wherein the electronic device intelligently manages and processes image data stored in the network-attached storage device according to the 3D contour shadow intelligent rendering method of multi-layer texture as described in any of the first aspects of the present invention, in order to respond to detected image rendering requirements.

[0021] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a method for intelligent rendering of 3D contour shadows with multi-layer textures. By implementing this invention, the time-consuming rendering calculation process can be separated from the main thread through asynchronous loading, off-screen context, layer order control, and main thread decoupling mechanism. The process is only passed to the main thread for display when the final composite image is generated, which effectively reduces the load on the main thread, reduces interface lag and frame drops, and helps to improve rendering efficiency, interface smoothness and rendering accuracy, as well as ensure the stability of display output under complex layer structures. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating a 3D contour shadow intelligent rendering method for multi-layer textures disclosed in an embodiment of the present invention; Figure 2 This is a flowchart illustrating another intelligent rendering method for 3D contour shadows of multi-layer textures disclosed in an embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of a 3D contour shadow intelligent rendering device with multi-layer textures disclosed in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a 3D contour shadow intelligent rendering system with multi-layer textures disclosed in an embodiment of the present invention. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.

[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0027] This invention discloses a method, apparatus, and electronic device for intelligent rendering of 3D contour shadows with multi-layer textures. Through asynchronous loading, off-screen context, layer order control, and a main thread decoupling mechanism, the time-consuming rendering calculation process is separated from the main thread, only being passed to the main thread for display during the final image synthesis. This effectively reduces the load on the main thread, minimizes interface stuttering and frame drops, and improves rendering efficiency, interface smoothness, and rendering accuracy, while also ensuring the stability of display output under complex layer structures. Detailed descriptions follow.

[0028] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a 3D contour shadow intelligent rendering method for multi-layer textures disclosed in an embodiment of the present invention. Figure 1 The described intelligent rendering method for 3D contour shadows of multi-layer textures can be applied to an intelligent rendering device for 3D contour shadows of multi-layer textures. Optionally, this method can also be applied to an electronic device with an application installed, wherein the electronic device is communicatively connected to a network-attached storage device, and the electronic device accesses the network-attached storage device through the application. This embodiment of the invention does not impose limitations. Figure 1 As shown, the intelligent rendering method for 3D contour shadows of multi-layer textures can include the following operations: 101. When an image rendering requirement is detected, the target image matching the image rendering requirement is loaded asynchronously according to the preset process.

[0029] 102. Perform task scheduling, off-screen context creation, and layer parameter configuration operations according to the image rendering requirements to obtain the first image processing result for the image rendering requirements.

[0030] In this embodiment of the invention, the first image processing result is used to provide reference data for subsequent rendering operations of the target image.

[0031] In this embodiment of the invention, by executing steps 101-102, the time-consuming rendering calculation process is separated from the main thread and only passed to the main thread for display when the final composite image is generated. This effectively reduces the load on the main thread, reduces interface lag and frame drops, and effectively improves display smoothness.

[0032] 103. Determine if there is at least one layer to be drawn.

[0033] 104. When it is determined that there is at least one layer to be drawn, perform stack storage operation, layer parameter setting operation based on the first image processing result, and image drawing operation on all target layers to be processed in the order of the layers to obtain the second image processing result corresponding to each target layer.

[0034] 105. When it is determined that there is no layer to be drawn, generate a target composite image for the target image based on all the second image processing results.

[0035] In this embodiment of the invention, the relevant image processing order can be performed on all layers to be drawn according to the layer order, ensuring that the relationship between layers is consistent with the rendering logic, avoiding display errors caused by disordered layer order, and improving the accuracy of the obtained second image processing result.

[0036] 106. Pass the target composite image to the main thread, and have the main thread perform image rendering and display operations on the target composite image to display the target composite image on the display interface of the electronic device.

[0037] In this embodiment of the invention, the main thread is a general concept at the operating system level of electronic devices.

[0038] In this embodiment of the invention, the electronic device can be a display device with display function, such as a smart display, but this embodiment of the invention does not limit the scope of the device.

[0039] It is evident that implementation Figure 1 The described intelligent rendering method for 3D contour shadows of multi-layer textures can separate the time-consuming rendering calculation process from the main thread through asynchronous loading, off-screen context, layer order control, and main thread decoupling mechanism. The process is only passed to the main thread for display when the final composite image is generated, which effectively reduces the load on the main thread, reduces interface lag and frame drops, and helps to improve rendering efficiency, interface smoothness and rendering accuracy, as well as ensure the stability of display output under complex layer structures.

[0040] In an optional embodiment, step 102 above, which performs task scheduling, off-screen context creation, and layer parameter configuration operations according to image rendering requirements, specifically includes the following methods to obtain the first image processing result for the image rendering requirements: Identify all target image processing tasks that respond to image rendering requirements, and schedule the target image processing tasks to a global background concurrent queue to move the target image processing tasks from the main thread to a background thread; Create an off-screen rendering context with the same image size as the target image. The off-screen rendering context is set outside the display interface of the electronic device; the off-screen rendering context includes a blank canvas. Determine all first-layer parameters for the blank canvas, and perform parameter initialization operations on all first-layer parameters to obtain the initialization results for all first-layer parameters; The off-screen rendering context and initialization results are determined as the first image processing result for the image rendering requirements.

[0041] In this alternative embodiment, the background thread is a general concept at the electronic operating system level.

[0042] In this optional embodiment, a blank canvas is used to draw layers; the first layer parameters include at least one of the following: total number of layers, shadow color, shadow offset, shadow blur, transparency decay coefficient, perspective intensity, and translation increment. The total number of layers determines the richness of the texture hierarchy and is typically set to 3-5 layers. The shadow-related parameters (shadow color, shadow offset, shadow blur) control the shape of the outline effect, including color (e.g., semi-transparent white), offset direction and distance, and blur radius (zero blur produces a sharp outline). The transparency decay coefficient defines the rate of change of transparency from the bottom layer to the top layer, creating a gradual sense of layering. The perspective intensity parameter controls the depth of three-dimensional space. The translation increment determines the spatial spacing between layers. Furthermore, the parameter values ​​for all first layer parameters can be flexibly configured according to actual usage needs to adapt to different visual design requirements.

[0043] In this optional embodiment, by scheduling the target image processing task, which is expected to take a long time, from the main thread to a global background concurrent queue, the high-load rendering computation task is decoupled from the UI main thread. This directly avoids the "frame dropping" or "application unresponsiveness (ANR)" phenomenon caused by rendering tasks occupying the main thread for a long time, which is beneficial to improving the real-time performance and smoothness of user interaction and interface updates.

[0044] In this optional embodiment, after the target image processing task is scheduled from the main thread to the global background concurrent queue, the background thread can utilize the parallel capabilities of the multi-core processor to perform complex drawing calculations without affecting UI responsiveness. Furthermore, the background system can automatically allocate appropriate thread resources based on task priority and current load. Since the overhead of switching threads is minimal, involving only the enqueueing operation of the task queue, there is no significant delay. The main thread returns immediately after scheduling the task to continue processing user interaction events, such as focus movement and key presses, ensuring smooth interface display even when thread switching occurs.

[0045] In this optional embodiment, the target image processing task is executed using a global background concurrent queue. Compared with serial processing, this can significantly shorten the overall completion time of multiple image rendering tasks, that is, improve the execution efficiency of image processing tasks.

[0046] In this optional embodiment, by constructing an off-screen rendering context outside the display interface of the electronic device, it is ensured that the drawing, compositing, and parameter adjustment of all layers are completed in a "background buffer" that is not visible to the user. This effectively avoids visual defects such as screen tearing, flickering, or partial rendering caused by intermediate states being submitted to the screen, and ensures the integrity of the final image presentation.

[0047] In this optional embodiment, based on the constructed off-screen rendering context, appropriate memory space can be automatically allocated according to the size and color space of the source image, and a transparency channel is supported to preserve the image's alpha information. Simultaneously, after the off-screen rendering context is created, a blank canvas is initialized, and all subsequent layer drawing operations are performed on this canvas. Furthermore, the background system can automatically manage the context's lifecycle and memory release, eliminating the need for manual handling by developers.

[0048] In this optional embodiment, the method for determining all target image processing tasks in response to image rendering requirements specifically includes: Determine multiple image processing tasks from the main thread to respond to image rendering requirements; Determine the expected task time for each image processing task; Select all target image processing tasks from all image processing tasks whose expected time exceeds a preset time threshold.

[0049] As can be seen, in this optional embodiment, by scheduling time-consuming image processing tasks to background threads for concurrent execution, the rendering tasks are decoupled from the main thread, eliminating interface lag and ensuring smooth interaction; furthermore, it can also combine an off-screen rendering context that is precisely matched with the target image to avoid the occupation of graphics processing resources.

[0050] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating another intelligent rendering method for 3D contour shadows of multi-layer textures disclosed in an embodiment of the present invention. Figure 2 The described intelligent rendering method for 3D contour shadows of multi-layer textures can be applied to intelligent rendering devices for 3D contour shadows of multi-layer textures, and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the intelligent rendering method for 3D contour shadows of multi-layer textures can include the following operations: 201. When an image rendering requirement is detected, the target image matching the image rendering requirement is loaded asynchronously according to the preset process.

[0051] 202. Based on the image rendering requirements, perform task scheduling operations, off-screen context creation operations, and layer parameter configuration operations to obtain the first image processing result for the image rendering requirements.

[0052] 203. Determine if there is at least one layer to be drawn.

[0053] 204. When it is determined that there is at least one layer to be drawn, select the layer to be processed from all target layers according to the preset layer order, and record it as the first layer.

[0054] In this embodiment of the invention, by drawing all layers one by one in a single blank canvas, only a single composite UIImage is output, fundamentally avoiding the memory waste caused by multiple instances. Furthermore, since all drawing operations are completed in a single traversal in a background thread, the GPU only needs to process the display of the final composite image once, rather than rendering multiple views in layers, significantly reducing GPU load. This design allows the application to run smoothly even on low-end devices, without causing stuttering or memory warnings due to the addition of layer effects. It is particularly suitable for scenarios that require displaying a large number of images with 3D effects, such as homepage poster walls and media library cover displays.

[0055] 205. Perform a push-to-stack storage operation on the first layer. The push-to-stack storage operation is used to save the graphics state of the rendering context corresponding to the first layer, and also to isolate the first layer to a preset state stack.

[0056] In this embodiment of the invention, the push-to-store operation includes a state storage operation and a push-to-store operation. The state storage operation saves the complete graphic state of the first layer to be processed before the rendering operation, including all drawing attributes such as transformation matrix, clipping region, blending mode, shadow parameters, line style, and fill color. Furthermore, the push-to-store operation pushes the graphic state into a stack structure for management. The purpose of this push-to-store operation is to achieve independence and isolation between layers, ensuring that the drawing operations of the current layer (such as transformations and shadow settings) do not affect the drawing of subsequent layers. Each layer can freely modify its context attributes to achieve specific effects without worrying about state contamination.

[0057] In this embodiment of the invention, since the state storage operation only involves copying pointers and a small number of flag bits, its operation efficiency is high and it does not incur significant performance overhead. This stack-based management mechanism supports nested saving and restoring, making it suitable for complex multi-layer drawing scenarios.

[0058] In this embodiment of the invention, by performing a stack storage operation on the corresponding rendering context graphics state before rendering each layer, and isolating the layer to a preset state stack, it is ensured that the rendering settings of different layers (such as transformation matrix, clipping region, blending mode, etc.) do not interfere with each other. That is, through this stack storage operation, it is possible to prevent later rendered layers from accidentally overwriting or tampering with the state configuration of earlier rendered layers, thus ensuring the logical and visual independence of multi-layer rendering results.

[0059] 206. Based on the image rendering requirements, determine the layer drawing items for the first layer. The layer drawing items include the parameter setting details for multiple second layer parameters.

[0060] 207. Based on the layer drawing requirements, perform parameter setting operations on all second layer parameters to set the parameter values ​​of the second layer parameters.

[0061] In this embodiment of the invention, all second layer parameters include shadow parameters, transparency, and perspective transformation parameters.

[0062] In this embodiment of the invention, the shadow parameters further include shadow color, relative offset between the shadow to be rendered and the image, and shadow blur; the perspective transformation parameters include a three-dimensional transformation matrix and its corresponding perspective parameters; the perspective parameters are used to adjust the perspective intensity of the image to which the three-dimensional transformation matrix is ​​applied.

[0063] In this embodiment of the invention, the shadow color is typically semi-transparent white or black, used to generate highlight outlines or projection effects against different backgrounds. The relative offset between the shadow to be rendered and the image defines the positional offset of the shadow relative to the image, including horizontal and vertical distances, used to determine the directionality of the light source. The shadow blur is particularly crucial; when set to zero, it produces perfectly sharp edges, forming a clear outline effect; when set to a larger value, it produces a soft, blurred shadow, forming a traditional projection effect. Optionally, in practical applications, a zero-blur shadow combined with semi-transparent white can be used to form a distinct highlight outline on a dark background and a soft boundary separation on a light background, clearly highlighting the subject regardless of the background. Through multi-layer overlay, each layer applies the same outline shadow parameters, with the shadow of the lower-level image partially obscured by the upper-level image, forming a natural hierarchical progression. Combined with a gradient of transparency, the lower the image layer, the lighter it becomes, and its outline shadow weakens accordingly, forming a smooth transition from the subject to the background. This design is particularly suitable for logo displays, brand logos, and other scenarios where the subject needs to be highlighted and recognizable. Therefore, after applying this second layer parameter, subsequent images drawn in this context will automatically have good 3D rendering effects.

[0064] In this embodiment of the invention, regarding the transparency, the background system can calculate the transparency value of the current layer based on its index value using a transparency decay algorithm, and apply it to the off-screen rendering context. In practical applications, the transparency is set to gradually increase from the bottom layer to the top layer by default, with the bottom layer being the most transparent (e.g., 55%), the top layer being less transparent (e.g., 85%), and the original top layer being completely opaque (100%). This gradual change in transparency creates a sense of space from far to near, simulating the atmospheric perspective effect—distant objects appear fainter due to the air medium. Furthermore, this transparency can be achieved through Alpha channel blending; pixels in the current layer are weighted and blended with pixels in the lower layer according to their Alpha values, forming a natural overlay effect. The decay coefficient can be flexibly configured; adjusting the decay rate can change the strength of the layer contrast. Therefore, in practical applications, by reasonably setting the transparency, the overlay of multiple images can be prevented from becoming too heavy, maintaining visual transparency and the recognizability of layers.

[0065] In this embodiment of the invention, for perspective transformation parameters, the background system creates a 3D transformation matrix and sets the perspective parameters. Then, it calculates the corresponding translation amount based on the current layer index and applies the translation transformation to produce a spatial displacement effect. The perspective parameters control the perspective intensity by setting specific elements (m34) of the transformation matrix, causing the image to exhibit a perspective relationship of near objects appearing larger and far objects smaller during translation, conforming to the visual laws of the human eye. In practical application, the bottom layer image has the smallest translation amount and is located closer; the next layer image has a larger translation amount and moves further away; the top layer original image does not translate and is located in the foreground. Furthermore, this 3D transformation matrix supports composite transformations of translation, rotation, scaling, and perspective projection, and finally needs to be converted into a 2D affine transformation matrix for application to the rendering context. This transformation technique for the 3D transformation matrix is ​​the core technology for 3D effects, enabling planar images to present a three-dimensional spatial depth relationship. Combined with transparency gradients and contour shadows, it forms a rich 3D layered visual effect.

[0066] In this embodiment of the invention, all target layers include at least one bottom-level layer and one top-level layer; the parameter value corresponding to each second layer parameter of the top-level layer is 0; the bottom-level layer needs to set at least one second layer parameter; and the first layer belongs to the bottom-level layer.

[0067] In this embodiment of the invention, the underlying layer forms the outline and texture effect surrounding the main body through shadows, transparency, and displacement.

[0068] In this embodiment of the invention, the top-level class layer is specifically the last complete original image layer drawn after all the bottom-level class layers with transformation and shadow effects have been drawn. This top-level class layer does not apply any shadow, transparency, or transformation effects, maintains 100% opacity and its original position, and is presented in the foreground as the visual focus, preserving all the detailed information of the image.

[0069] In this embodiment of the invention, a top-bottom layer combination is used, which results in a final effect that has a rich sense of 3D depth without sacrificing the clarity of the subject. The user's attention is naturally focused on the clear top-layer image, while the user can also perceive the surrounding three-dimensional contour effect, forming a perfect balance between visual focus and background depth.

[0070] 208. Based on the first image processing result and all second layer parameters, perform image drawing operations on the first layer to obtain the drawn second layer, and add the second layer to the second image processing result.

[0071] 209. Designate the third layer as the new first layer. The third layer is the layer that is adjacent to the first layer among all target layers and whose layer order is after the first layer.

[0072] In this embodiment of the invention, after executing step 209, the above steps 205-209 are repeated until it is determined that there is no layer to be drawn, at which point step 210 is triggered.

[0073] In this embodiment of the invention, before determining the third layer as the new first layer in step 209, the method further includes: Perform a pop operation on the second layer to remove it from the state stack; Perform a parameter reset operation on all second-layer parameters to obtain the parameter reset results for all second-layer parameters; Determine if the number of layers in the target layer, excluding the first layer, is 0. If the result is yes, confirm that the drawing operation for all target layers is complete. If the judgment result is negative, the target layer that is adjacent to the first layer and follows the first layer is determined as the third layer according to the layer order, and the operation corresponding to determining the third layer as the new first layer is triggered.

[0074] In this embodiment of the invention, the push operation establishes an independent snapshot of the rendering state of each layer, while the pop operation achieves precise and directional restoration of the state. Through this reasonable push and pop operation, the rendering process can seamlessly revert to the graphics state environment of the previous layer after completing the rendering of the current layer, which is beneficial to improving the accuracy and stability of the sequential rendering of multiple layers.

[0075] In this embodiment of the invention, after the current layer is drawn and the stack is popped, the parameters of all second layer parameters (shadow, transparency, perspective, etc.) can be reset. This achieves timely reset of the second layer parameters, prevents them from affecting the rendering effect of subsequent layers in the form of "dirty data", and ensures that each layer is drawn in its independent and expected parameter environment.

[0076] 210. When it is determined that there is no layer to be drawn, generate a target composite image for the target image based on all the second image processing results.

[0077] In this embodiment of the invention, after all layers are drawn, the renderer converts the canvas content in the off-screen rendering context into the final image object. This process involves operations such as reading pixel data, color space conversion, alpha channel processing, and memory allocation. The renderer can generate a new bitmap image based on the current state of the canvas, containing the final visual effect after all layers are overlaid and blended. The generated target composite image is a complete and independent object that can be used like a normal image, supporting saving to a file, passing to other components, applying additional filter effects, etc. Furthermore, the generated target composite image contains a complete 3D outline shadow effect, appearing as a single image with a three-dimensional sense of depth, rather than a superposition of multiple views.

[0078] In this embodiment of the invention, after the target composite image is generated, the mission of the pre-built off-screen rendering context has been completed, and the background system will automatically release the memory resources it occupies.

[0079] 211. Pass the target composite image to the main thread, and have the main thread perform image rendering and display operations on the target composite image to display the target composite image on the display interface of the electronic device.

[0080] In this embodiment of the invention, after the target composite image is generated, the background system needs to pass the target composite image from the background thread back to the main thread for UI updates. All UI operations must be executed on the main thread, which is a basic requirement of the UI framework. Specifically, the background system schedules an update task through the main thread queue, which carries the generated target composite image as a parameter. Simultaneously, after processing the current event loop, the main thread executes this update task, assigning the image to the corresponding view property. The update of the view property triggers the redrawing and layout of the view, ultimately displaying the new image on the screen. The entire process is imperceptible to the user; the user only sees the image smoothly transition from the loading state to the final 3D effect image.

[0081] In this embodiment of the invention, the overhead of switching the main thread is minimal, resulting in no noticeable delay. This background processing and main thread update mode ensures both high efficiency in image processing and the security and consistency of UI operations.

[0082] In this embodiment of the invention, after the main thread receives the target composite image, it sets it as the display content of the view. The target composite image then passes through the view rendering pipeline and is finally displayed on the screen. The user then sees a 3D image with clear outline shadows and a sense of depth. Visually, the main subject of the image is clearly visible, surrounded by an outline halo effect formed by multiple layers. The gradual change in transparency and displacement of the underlying layers create a distinct sense of spatial hierarchy. Against a dark background, semi-transparent white shadows form highlight outlines, making the image edges particularly striking; against a light background, the outlines form soft separations, still allowing for clear identification of the subject. The entire effect is natural and smooth, without any harsh compositing artifacts. Compared to flat images, 3D images have greater visual impact and recognizability, making them particularly suitable for scenarios requiring prominent main subjects, such as logo displays, brand logos, and cover images.

[0083] In this embodiment of the invention, by encapsulating all complex layer relationships within a UIImage extension method, only a simple function interface and a few configuration parameters are exposed externally. The caller only needs to pass in the source image (target image) and the number of layers to obtain the final effect image, without needing to concern themselves with the internal implementation details. The composited image can be used like a regular UIImage, supporting all standard UIImage operations, such as saving to a file, passing it to other components, and applying additional filter effects. In SwiftUI, a declarative usage approach is implemented through the UGThrDimImage component. Developers only need to specify the image URL and callback closure to automatically complete the entire process of loading, compositing, and displaying. This highly encapsulated design lowers the barrier to entry and improves code maintainability and reusability.

[0084] For further descriptions of steps 201-203 and 210-211 in this embodiment of the invention, please refer to the other specific descriptions of steps 101-103 and 105-106 in Embodiment 1. These descriptions will not be repeated in this embodiment of the invention.

[0085] It is evident that implementation Figure 2 The described intelligent rendering method for 3D contour shadows of multi-layer textures isolates the rendering states of each layer through push / pop operations, avoiding state pollution between layers and improving the independence and accuracy of the rendering results of each layer. After each layer completes rendering, parameters can be reset in a timely manner, realizing the timely removal of parameter residues and effectively avoiding interference with subsequent layers. Furthermore, through built-in layer recursion and quantity judgment logic, closed-loop sequential rendering of multiple layers is achieved, improving the reliability and intelligence of the rendering execution process.

[0086] In an optional embodiment, step 201 above, which asynchronously loads the target image matching the image rendering requirements according to a preset process, specifically includes: Receive the image URL corresponding to the image rendering requirements; A query operation is performed on the local cache based on the image URL to obtain the query results for the image URL; when the query results indicate that the first image resource corresponding to the image URL exists in the local cache, the first image resource is read to obtain the target image; When the query result indicates that there is no image resource corresponding to the image URL in the local cache, a network request is initiated, and a second image resource corresponding to the image URL is downloaded asynchronously according to the network request, so as to obtain the asynchronous download result for the image URL; When the asynchronous download result indicates that the second image resource corresponding to the image URL has been successfully downloaded, an image decoding operation is performed on the second image resource to obtain the target image; When the asynchronous download result indicates that the second image resource corresponding to the image URL was not successfully downloaded, the preset placeholder image or default icon is set as the target image, and a prompt message indicating the download failure is output.

[0087] In this optional embodiment, when the query result indicates that a first image resource corresponding to the image URL exists in the local cache, the image data can be read directly from the local memory or disk to achieve fast reading of the image resource.

[0088] In this optional embodiment, when the second image resource is downloaded asynchronously based on a network request, a progress callback function can be set in the download process to update and display the loading and download progress of the second image resource to the user in real time in the form of a loading progress bar.

[0089] In this optional embodiment, the image decoding operation is used to convert compressed image data into a bitmap format that can be processed subsequently.

[0090] In this optional embodiment, the download method for the second image resource adopts asynchronous download and execution based on a background queue, so as not to block the main thread and ensure that the current display interface maintains a smooth response.

[0091] In this optional embodiment, when the download of the second image resource fails, network error, timeout, 404, or other prompts can be output. Furthermore, error messages can be displayed on the current display interface using preset placeholder images or default icons to avoid a blank display.

[0092] As can be seen, in this optional embodiment, a three-level image loading mechanism is constructed, which prioritizes caching, asynchronous loading, and failure degradation: the local caching priority strategy avoids redundant network requests, realizes instant image loading, and reduces bandwidth and power consumption; the asynchronous download and decoding mechanism moves time-consuming operations off the main thread, eliminating the negative impact of the image loading process on the interface response performance; and in the case of image download failure, automatic degradation processing and output prompt information can be performed to ensure that the rendering task can still be executed completely in the case of resource shortage, which is conducive to improving the overall stability of image loading.

[0093] Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a multi-layer texture 3D contour shadow intelligent rendering device disclosed in an embodiment of the present invention. The multi-layer texture 3D contour shadow intelligent rendering device can be applied to an electronic device with an application installed, and the electronic device is communicatively connected to a network attached storage device (LAN), which is accessed through the application. Furthermore, the multi-layer texture 3D contour shadow intelligent rendering device can be used to execute some or all of the steps in any of the multi-layer texture 3D contour shadow intelligent rendering methods described in Embodiment 1 or Embodiment 2 of the present invention. Figure 3 As shown, the 3D contour shadow intelligent rendering device for multi-layer textures may include an image loading module 301, a first image processing module 302, a judgment module 303, a second image processing module 304, an image generation module 305, and a display module 306, wherein: Image loading module 301 is used to asynchronously load target images that match the image rendering requirements according to a preset process when an image rendering requirement is detected.

[0094] The first image processing module 302 is used to perform task scheduling operations, off-screen context creation operations, and layer parameter configuration operations according to image rendering requirements, so as to obtain a first image processing result for image rendering requirements; the first image processing result is used to provide reference data for subsequent rendering operations of the target image.

[0095] The judgment module 303 is used to determine whether there is at least one layer to be drawn.

[0096] The second image processing module 304 is used to perform stack storage operation, layer parameter setting operation based on the first image processing result and image drawing operation on all target layers to be processed in the order of the layers when the judgment module 303 determines that there is at least one layer to be drawn, so as to obtain the second image processing result corresponding to each target layer.

[0097] The image generation module 305 is used to generate a target composite image for the target image based on all the second image processing results when the judgment module 303 determines that there is no layer to be drawn.

[0098] Display module 306 is used to pass the target composite image to the main thread, and the main thread performs image rendering and display operations on the target composite image to display the target composite image on the display interface of the electronic device.

[0099] It is evident that implementation Figure 3 The described 3D contour shadow intelligent rendering device with multi-layer textures can separate the time-consuming rendering calculation process from the main thread through asynchronous loading, off-screen context, layer order control, and main thread decoupling mechanism. It is only passed to the main thread for display when the final composite image is generated, which effectively reduces the load on the main thread, reduces interface lag and frame drops, and helps to improve rendering efficiency, interface smoothness and rendering accuracy, as well as ensure the stability of display output under complex layer structures.

[0100] In an optional embodiment, the first image processing module 302 performs task scheduling operations, off-screen context creation operations, and layer parameter configuration operations according to image rendering requirements, and obtains the first image processing result for the image rendering requirements in the following specific ways: Identify all target image processing tasks that respond to image rendering requirements, and schedule the target image processing tasks to a global background concurrent queue to move the target image processing tasks from the main thread to a background thread; Create an off-screen rendering context with the same image size as the target image. The off-screen rendering context is set outside the display interface of the electronic device; the off-screen rendering context includes a blank canvas. Determine all first-layer parameters for the blank canvas, and perform parameter initialization operations on all first-layer parameters to obtain the initialization results for all first-layer parameters; The off-screen rendering context and initialization results are determined as the first image processing result for the image rendering requirements.

[0101] In this optional embodiment, a blank canvas is used to draw layers; the first layer parameters include at least one of the following: total number of layers, shadow color, shadow offset, shadow blur, transparency attenuation coefficient, perspective intensity, and translation increment. The first image processing module 302 determines the specific methods for all target image processing tasks in response to image rendering requirements, including: Determine multiple image processing tasks from the main thread to respond to image rendering requirements; Determine the expected task time for each image processing task; Select all target image processing tasks from all image processing tasks whose expected time exceeds a preset time threshold.

[0102] As can be seen, in this optional embodiment, by scheduling time-consuming image processing tasks to background threads for concurrent execution, the rendering tasks are decoupled from the main thread, eliminating interface lag and ensuring smooth interaction; furthermore, it can also combine an off-screen rendering context that is precisely matched with the target image to avoid the occupation of graphics processing resources.

[0103] In another optional embodiment, the second image processing module 304 performs a stack storage operation, a layer parameter setting operation based on the first image processing result, and an image drawing operation on all target layers to be processed in layer order, respectively, to obtain the second image processing result corresponding to each target layer. Specifically, this includes: Based on the preset layer order, select the layer to be processed from all target layers and designate it as the first layer; The first layer is pushed onto the stack for storage. This operation is used to save the graphics state of the rendering context corresponding to the first layer, and also to isolate the first layer into a preset state stack. Based on the image rendering requirements, determine the layer drawing items for the first layer. The layer drawing items include the parameter setting details for multiple second layer parameters. Based on the layer drawing requirements, perform parameter setting operations on all second-layer parameters to set their values; all second-layer parameters include shadow parameters, transparency, and perspective transformation parameters; Based on the first image processing result and all the parameters of the second layer, perform image drawing operations on the first layer to obtain the drawn second layer, and add the second layer to the second image processing result; In addition, the third layer is designated as the new first layer. The third layer is the layer that is adjacent to the first layer among all target layers and whose layer order is after the first layer.

[0104] In this optional embodiment, the shadow parameters include shadow color, the relative offset between the shadow to be rendered and the image, and shadow blur; the perspective transformation parameters include a three-dimensional transformation matrix and its corresponding perspective parameters; the perspective parameters are used to adjust the perspective intensity of the image to which the three-dimensional transformation matrix is ​​applied. In addition, all target layers include at least one bottom-level layer and one top-level layer; the parameter value corresponding to each second layer parameter of the top-level layer is 0; the bottom-level layer needs to set at least one second layer parameter; and the first layer belongs to the bottom-level layer.

[0105] In this optional embodiment, the second image processing module 304 performs a stack storage operation, a layer parameter setting operation based on the first image processing result, and an image drawing operation on all target layers to be processed in layer order, respectively, to obtain the second image processing result corresponding to each target layer. Specifically, this method further includes: Before determining the third layer as the new first layer, perform a pop operation on the second layer to remove the second layer from the state stack; Perform a parameter reset operation on all second-layer parameters to obtain the parameter reset results for all second-layer parameters; Determine if the number of layers in the target layer, excluding the first layer, is 0. If the result is yes, confirm that the drawing operation for all target layers is complete. If the judgment result is negative, the target layer that is adjacent to the first layer and follows the first layer is determined as the third layer according to the layer order, and the operation corresponding to determining the third layer as the new first layer is triggered.

[0106] As can be seen, in this optional embodiment, the rendering states of each layer are isolated by push / pop operations, avoiding state pollution between layers and improving the independence and accuracy of the rendering results of each layer; after each layer completes rendering, parameters can be reset in a timely manner, realizing the timely removal of parameter residues and effectively avoiding interference with subsequent layers; and through the built-in layer recursion and quantity judgment logic, closed-loop sequential rendering of multiple layers is realized, improving the reliability and intelligence of the rendering execution process.

[0107] In another optional embodiment, the image loading module 301 asynchronously loads the target image matching the image rendering requirements according to a preset process, specifically including: Receive the image URL corresponding to the image rendering requirements; A query operation is performed on the local cache based on the image URL to obtain the query results for the image URL; when the query results indicate that the first image resource corresponding to the image URL exists in the local cache, the first image resource is read to obtain the target image; When the query result indicates that there is no image resource corresponding to the image URL in the local cache, a network request is initiated, and a second image resource corresponding to the image URL is downloaded asynchronously according to the network request, so as to obtain the asynchronous download result for the image URL; When the asynchronous download result indicates that the second image resource corresponding to the image URL has been successfully downloaded, an image decoding operation is performed on the second image resource to obtain the target image; When the asynchronous download result indicates that the second image resource corresponding to the image URL was not successfully downloaded, the preset placeholder image or default icon is set as the target image, and a prompt message indicating the download failure is output.

[0108] As can be seen, in this optional embodiment, a three-level image loading mechanism is constructed, which prioritizes caching, asynchronous loading, and failure degradation: the local caching priority strategy avoids redundant network requests, realizes instant image loading, and reduces bandwidth and power consumption; the asynchronous download and decoding mechanism moves time-consuming operations off the main thread, eliminating the negative impact of the image loading process on the interface response performance; and in the case of image download failure, automatic degradation processing and output prompt information can be performed to ensure that the rendering task can still be executed completely in the case of resource shortage, which is conducive to improving the overall stability of image loading.

[0109] Example 4 Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of the electronic device disclosed in an embodiment of the present invention. Figure 4 As shown, the electronic device has an application installed; the electronic device is communicatively connected to a network attached storage device; the electronic device accesses the network attached storage device through the application; The electronic device integrates a 3D contour shadow intelligent rendering device for multi-layer textures as described in any of the embodiments of the present invention, and is used to perform some or all of the steps in the 3D contour shadow intelligent rendering method for multi-layer textures as described in any of the embodiments of the present invention, or the embodiments of the present invention. Furthermore, the electronic device is also used to perform image rendering and display operations on the target composite image after receiving the target composite image transmitted by the main thread, and to display the image rendering and display image corresponding to the target composite image on the display interface of the electronic device.

[0110] Example 5 Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a 3D contour shadow intelligent rendering system with multi-layer textures disclosed in an embodiment of the present invention. Figure 5 As shown, the system includes a 3D contour shadow intelligent rendering device for multi-layer textures as described in any one of Embodiment 3 of the present invention, and a network-attached storage device communicatively connected to the 3D contour shadow intelligent rendering device for multi-layer textures; wherein, the 3D contour shadow intelligent rendering device for multi-layer textures intelligently manages and processes the image data stored in the network-attached storage device according to the 3D contour shadow intelligent rendering method for multi-layer textures as described in Embodiment 1 or Embodiment 2 of the present invention, in order to respond to the detected image rendering requirements; or, like Figure 4 As shown, the system includes an electronic device as described in Embodiment 4 of the present invention, and a network-attached storage device communicatively connected to the electronic device; wherein, the electronic device intelligently manages and processes the image data stored in the network-attached storage device according to the 3D contour shadow intelligent rendering method of multi-layer texture as described in either Embodiment 1 or Embodiment 2 of the present invention, in order to respond to the detected image rendering requirements.

[0111] The device / system embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0112] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0113] Finally, it should be noted that the above embodiments are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for intelligent rendering of 3D contour shadows with multi-layer textures, characterized in that, The method is applied to an electronic device with an application installed, and the electronic device is communicatively connected to a network-attached storage device (NAT). The electronic device accesses the NAT through the application. The method includes: When an image rendering requirement is detected, a target image matching the image rendering requirement is asynchronously loaded according to a preset process, and task scheduling operation, off-screen context creation operation, and layer parameter configuration operation are performed according to the image rendering requirement to obtain a first image processing result for the image rendering requirement; the first image processing result is used to provide reference data for subsequent rendering operations of the target image; Determine whether there is at least one layer to be drawn. When it is determined that there is at least one layer to be drawn, perform stack storage operation, layer parameter setting operation based on the first image processing result, and image drawing operation on all target layers to be processed in the order of the layers to obtain the second image processing result corresponding to each target layer. When it is determined that there are no more layers to be drawn, a target composite image is generated for the target image based on all the second image processing results, and the target composite image is passed to the main thread. The main thread then performs image rendering and display operations on the target composite image to display the target composite image on the display interface of the electronic device.

2. The intelligent rendering method for 3D contour shadows of multi-layer textures according to claim 1, characterized in that, The step of performing task scheduling, off-screen context creation, and layer parameter configuration operations according to the image rendering requirements to obtain a first image processing result for the image rendering requirements includes: Identify all target image processing tasks that respond to the image rendering request, and schedule the target image processing tasks to a global background concurrent queue to schedule the target image processing tasks from the main thread to a background thread; An off-screen rendering context with the same image size as the target image is created, and the off-screen rendering context is set outside the display interface of the electronic device; the off-screen rendering context includes a blank canvas; Determine all first layer parameters for the blank canvas, and perform parameter initialization operations on all first layer parameters to obtain initialization results for all first layer parameters; The off-screen rendering context and the initialization result are determined as the first image processing result for the image rendering requirements.

3. The intelligent rendering method for 3D contour shadows of multi-layer textures according to claim 2, characterized in that, The blank canvas is used to draw layers; the first layer parameters include at least one of the following: total number of layers, shadow color, shadow offset, shadow blur, transparency attenuation coefficient, perspective intensity, and translation increment; The process of determining all target image processing tasks in response to the image rendering request includes: Determine multiple image processing tasks from the main thread to respond to the image rendering request; Determine the expected task time for each of the image processing tasks; Select all target image processing tasks whose expected task time exceeds a preset time threshold from all the image processing tasks.

4. The intelligent rendering method for 3D contour shadows of multi-layer textures according to any one of claims 1-3, characterized in that, The process of performing stack storage operations, layer parameter setting operations based on the first image processing result, and image drawing operations on all target layers to be processed in layer order to obtain a second image processing result corresponding to each target layer includes: Based on the preset layer order, select the layer to be processed from all target layers and designate it as the first layer; The first layer is pushed onto the stack for storage. The push operation is used to save the graphics state of the rendering context corresponding to the first layer and to isolate the first layer to a preset state stack. Based on the image rendering requirements, determine the layer drawing items for the first layer, which include parameter setting details for multiple second layer parameters; Based on the layer drawing requirements, perform parameter setting operations on all second layer parameters to set the parameter values ​​of the second layer parameters; all second layer parameters include shadow parameters, transparency, and perspective transformation parameters; Based on the first image processing result and all the parameters of the second layer, perform an image drawing operation on the first layer to obtain the drawn second layer, which is used as the second image processing result. In addition, the third layer is determined as the new first layer, wherein the third layer is the layer that is adjacent to the first layer among all the target layers and whose layer order is after the first layer.

5. The intelligent rendering method for 3D contour shadows of multi-layer textures according to claim 4, characterized in that, Before determining the third layer as the new first layer, the method further includes: Perform a pop operation on the second layer to remove the second layer from the state stack; Perform a parameter reset operation on all parameters of the second layer to obtain the parameter reset result for all parameters of the second layer; Determine whether the number of layers of the target layer other than the first layer is 0. If the determination result is yes, determine that the drawing operation for all the target layers is completed. If the determination result is negative, according to the layer order, the target layer that is adjacent to the first layer and after the first layer is determined as the third layer, and the operation of determining the third layer as the new first layer is triggered.

6. The intelligent rendering method for 3D contour shadows of multi-layer textures according to claim 4 or 5, characterized in that, The shadow parameters include shadow color, relative offset between the shadow to be rendered and the image, and shadow blur; the perspective transformation parameters include a three-dimensional transformation matrix and its corresponding perspective parameters; the perspective parameters are used to adjust the perspective intensity of the image to which the three-dimensional transformation matrix is ​​applied; Furthermore, all of the target layers include at least one bottom-level class layer and one top-level class layer; The parameter value corresponding to each second layer parameter of the top-level class layer is 0; the bottom-level class layer needs to set at least one second layer parameter; and the first layer belongs to the bottom-level class layer.

7. The intelligent rendering method for 3D contour shadows of multi-layer textures according to claim 1, 2, 3, or 5, characterized in that, The asynchronous loading of the target image matching the image rendering requirements according to a preset process includes: Receive the image URL corresponding to the image rendering requirement; A query operation is performed on the local cache based on the image URL to obtain a query result for the image URL; when the query result indicates that a first image resource corresponding to the image URL exists in the local cache, the first image resource is read to obtain the target image; When the query result indicates that there is no image resource corresponding to the image URL in the local cache, a network request is initiated, and a second image resource corresponding to the image URL is asynchronously downloaded according to the network request, so as to obtain an asynchronous download result for the image URL; When the asynchronous download result indicates that the second image resource corresponding to the image URL has been successfully downloaded, an image decoding operation is performed on the second image resource to obtain the target image; When the asynchronous download result indicates that the second image resource corresponding to the image URL has not been successfully downloaded, a preset placeholder image or default icon is determined as the target image, and a prompt message indicating download failure is output.

8. A 3D contour shadow intelligent rendering device with multi-layer textures, characterized in that, The device is used in an electronic device with an application installed, and the electronic device is communicatively connected to a network-attached storage device (NAT), the electronic device accessing the NAT through the application, the device comprising: The image loading module is used to asynchronously load the target image that matches the image rendering requirement according to a preset process when an image rendering requirement is detected. The first image processing module is used to perform task scheduling operations, off-screen context creation operations, and layer parameter configuration operations according to the image rendering requirements, so as to obtain a first image processing result for the image rendering requirements; the first image processing result is used to provide reference data for subsequent rendering operations of the target image; The judgment module is used to determine whether there is at least one layer to be drawn. The second image processing module is used to perform a stack storage operation, a layer parameter setting operation based on the first image processing result, and an image drawing operation on all target layers to be processed in the order of the layers when the judgment module determines that there is at least one layer to be drawn, so as to obtain a second image processing result corresponding to each target layer. An image generation module is used to generate a target composite image for the target image based on all the second image processing results when the judgment module determines that there is no layer to be drawn. The display module is used to pass the target composite image to the main thread, and the main thread performs image rendering and display operations on the target composite image to display the target composite image on the display interface of the electronic device.

9. An electronic device, characterized in that, The electronic device has an application installed; the electronic device is communicatively connected to a network attached storage device; the electronic device accesses the network attached storage device through the application. The electronic device integrates the 3D contour shadow intelligent rendering device for multi-layer textures as described in claim 8, and is used to execute the 3D contour shadow intelligent rendering method for multi-layer textures as described in any one of claims 1-7. The electronic device is also used to perform the image rendering and display operation on the target composite image after receiving the target composite image transmitted by the main thread, and to display the image rendering and display image corresponding to the target composite image on the display interface of the electronic device.

10. A 3D contour shadow intelligent rendering system with multi-layer textures, characterized in that, The system includes a 3D contour shadow intelligent rendering device for multi-layer textures as described in claim 8, and a network-attached storage device communicatively connected to the 3D contour shadow intelligent rendering device for multi-layer textures; wherein, the 3D contour shadow intelligent rendering device for multi-layer textures intelligently manages and processes the image data stored in the network-attached storage device according to the 3D contour shadow intelligent rendering method for multi-layer textures as described in any one of claims 1-7, in order to respond to detected image rendering requirements; or, The system includes the electronic device as described in claim 9, and a network-attached storage device communicatively connected to the electronic device; wherein the electronic device intelligently manages and processes the image data stored in the network-attached storage device according to the 3D contour shadow intelligent rendering method of multi-layer texture as described in any one of claims 1-7, in order to respond to detected image rendering requirements.