A method and device for generating a virtual courtyard scene, electronic equipment and storage medium

By classifying color blocks and processing asset attribute information in courtyard template files, and combining Houdini and Unity engines, we have achieved efficient and accurate generation of traditional Chinese courtyard scenes. This solves the problem of inconsistent generated results with expectations in existing technologies, and improves generation efficiency and artistic controllability.

CN122115704APending Publication Date: 2026-05-29GUANGZHOU SNAP FINGER UNIVERSE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU SNAP FINGER UNIVERSE TECH CO LTD
Filing Date
2026-01-04
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently generate 3D scenes that conform to the characteristics of traditional Chinese courtyards, especially when dealing with non-standardized, highly stylized scenes with flexible and varied component combinations. Furthermore, the lack of seamless integration between art direction and procedural generation leads to significant deviations between the generated results and expectations.

Method used

By acquiring courtyard template files, color block classification is performed, asset attribute information is assigned to each color block, and virtual courtyard scenes are generated using asset model instantiation. Color templates are used to intuitively control the layout and component relationships, and instantiation is performed using both the Houdini and Unity engines.

Benefits of technology

It achieves pixel-level precise control over the layout of courtyards and the position of components, improving generation efficiency and accuracy, reducing manual adjustments, and ensuring that the generated results meet the cultural and aesthetic requirements of traditional Chinese courtyards, avoiding the problem of excessive randomness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115704A_ABST
    Figure CN122115704A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a virtual courtyard scene generation method and device, electronic equipment and storage medium. The method comprises: obtaining a courtyard template file; the courtyard template file comprises a plurality of pre-prepared courtyard color templates; each courtyard color template comprises a color block of at least one color; the color block of each color indicates a type of scene element in the courtyard; performing color block classification processing on each courtyard color template to obtain a scene element corresponding to each color block in each courtyard color template; assigning asset attribute information to each color block in each courtyard color template based on the scene element corresponding to each color block; and determining an asset model corresponding to each color block. The present application can enable designers to perform pixel-level accurate control on the layout of the courtyard, the position and relationship of key components through the intuitiveness of the color template, thereby fundamentally avoiding the problems of excessive randomness and inconsistency between the results and expectations in the traditional programmatic generation method, and reducing manual adjustment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Internet technology, and in particular to a method, apparatus, electronic device and storage medium for generating a virtual courtyard scene. Background Technology

[0002] Against the backdrop of the rapid development of the digital content creation industry, traditional manual modeling methods are no longer sufficient to meet the growing demand for large-scale, high-quality 3D scenes, especially those rich in unique cultural elements. This is particularly evident in the creation of traditional Chinese courtyard houses, which require the accurate reproduction of traditional Chinese architectural aesthetics and spatial philosophy.

[0003] To improve creative efficiency, the industry has evolved from entirely manual to partially automated methods. Early on, generative artificial intelligence (AIGC) technology made significant progress in image generation, capable of generating aesthetically pleasing traditional Chinese-style images based on text descriptions. For example, some professional platforms can generate ink-wash style landscapes and pavilions using text prompts, demonstrating AI's potential in stylized creation. However, the results generated by these methods are mostly two-dimensional images, lacking interactive and editable three-dimensional geometric information and spatial relationships, making them difficult to directly apply to scenarios requiring three-dimensional models, such as games and virtual reality.

[0004] In the field of 3D generation, existing technologies largely rely on Building Information Modeling (BIM) or pre-built modular component libraries. For example, some patented technologies use HBIM (Historical Building Information Modeling) to digitally reconstruct ancient buildings, protecting architectural information through detailed modeling and semantic attribute separation. Other technologies aim to improve the efficiency of interior design by automatically generating renovation plans and renderings of house types using generative AI. While these technologies improve efficiency in specific areas, their adaptability to non-standardized, highly stylized scenarios with flexible and varied component combinations, such as traditional Chinese courtyard houses, remains insufficient. They often fail to effectively handle the coexistence of randomness and regularity in courtyard layouts, as well as the organic combination of numerous heterogeneous components (such as artificial mountains and vegetation of varying shapes). Furthermore, in existing processes, the connection between art direction and procedural generation is not smooth enough; the designer's intentions are difficult for the system to accurately identify and execute, leading to deviations between the generated results and expectations, requiring significant manual adjustments. Summary of the Invention

[0005] This disclosure provides a method, apparatus, electronic device, and storage medium for generating virtual courtyard scenes. The technical solution of this disclosure is as follows: According to a first aspect of the present disclosure, a method for generating a virtual courtyard scene is provided, comprising: Obtain the courtyard template file; the courtyard template file includes multiple pre-made courtyard color templates; each courtyard color template includes color blocks of at least one color; each color block indicates a type of scene element in the courtyard; The color template of each courtyard is classified into color blocks to obtain the scene elements corresponding to each color block in each courtyard color template; Assign asset attribute information to each color block in each courtyard color template based on the scene element corresponding to each color block; the asset attribute information includes scene element, referenced asset path, asset size, asset orientation or asset level; Determine the asset model corresponding to each color block; the asset model is used to respond to the courtyard generation command, and the asset attribute information is used to instantiate the asset model to generate a virtual courtyard scene.

[0006] In some possible embodiments, Each courtyard color template is processed by color block classification to obtain the scene elements corresponding to each color block in each courtyard color template, including: Determine the information corresponding to the color scene elements; the information corresponding to the color scene elements includes multiple color identifiers and the scene elements corresponding to each color identifier. Based on the color scene element correspondence information, determine the scene element corresponding to each color block in the color template of each courtyard.

[0007] In some possible embodiments, After determining the scene element corresponding to each color block in the color template of each courtyard based on the color scene element correspondence information, it also includes: Each consecutive color block in the color template of each courtyard is divided into multiple sub-color blocks corresponding to each consecutive color block; the colors of the multiple sub-color blocks after division are the same as the colors of the corresponding consecutive color blocks.

[0008] In some possible embodiments, Based on the scene elements corresponding to each color block, asset attribute information is assigned to each color block in each courtyard color template, including: Determine the scene element, asset size, asset orientation, and asset level corresponding to each color block; Once the asset model file is successfully retrieved based on the scene element, asset size, asset orientation, and asset level corresponding to each color block, the referenced asset path corresponding to each color block is determined.

[0009] In some possible embodiments, Determine the asset model corresponding to each color block, including: Generate an attribute information asset model record table; the attribute information asset model record table includes the asset attribute information and asset model corresponding to each color block.

[0010] In some possible embodiments, After determining the asset model corresponding to each color block, the following is also included: Color blocks carrying asset attribute information are imported into the rendering engine through a point cache. These blocks are then used to instantiate 3D models based on the corresponding locations of the asset attribute information in the virtual map, forming a virtual courtyard scene.

[0011] In some possible embodiments, Multiple pre-made courtyard color templates correspond to multiple courtyard levels based on different layout sizes; The asset grade includes at least one of several courtyard grades.

[0012] According to a second aspect of the present disclosure, an apparatus for generating a virtual courtyard scene is provided, comprising: The resource display module is configured to retrieve courtyard template files; the courtyard template files include multiple pre-made courtyard color templates; each courtyard color template includes color blocks of at least one color; each color block indicates a type of scene element in the courtyard; The color block processing module is configured to perform color block classification processing on each courtyard color template to obtain the scene element corresponding to each color block in each courtyard color template; The information assignment module is configured to assign asset attribute information to each color block in each courtyard color template based on the scene element corresponding to each color block; the asset attribute information includes scene element, referenced asset path, asset size, asset orientation, or asset level; The model determination module is configured to determine the asset model corresponding to each color block; the asset model is used to respond to the courtyard generation command, and the asset model is instantiated using asset attribute information to generate a virtual courtyard scene.

[0013] In some possible embodiments, The color block processing module is configured to execute: Determine the information corresponding to the color scene elements; the information corresponding to the color scene elements includes multiple color identifiers and the scene elements corresponding to each color identifier. Based on the color scene element correspondence information, determine the scene element corresponding to each color block in the color template of each courtyard.

[0014] In some possible embodiments, The device also includes a segmentation processing module configured to perform: Each consecutive color block in the color template of each courtyard is divided into multiple sub-color blocks corresponding to each consecutive color block; the colors of the multiple sub-color blocks after division are the same as the colors of the corresponding consecutive color blocks.

[0015] In some possible embodiments, The information assignment module is configured to execute: Determine the scene element, asset size, asset orientation, and asset level corresponding to each color block; Once the asset model file is successfully retrieved based on the scene element, asset size, asset orientation, and asset level corresponding to each color block, the referenced asset path corresponding to each color block is determined.

[0016] In some possible embodiments, The model determination module is configured to execute: Generate an attribute information asset model record table; the attribute information asset model record table includes the asset attribute information and asset model corresponding to each color block.

[0017] In some possible embodiments, The device also includes a cache import module, configured to execute: Color blocks carrying asset attribute information are imported into the rendering engine through a point cache. These blocks are then used to instantiate 3D models based on the corresponding locations of the asset attribute information in the virtual map, forming a virtual courtyard scene.

[0018] In some possible embodiments, Multiple pre-made courtyard color templates correspond to multiple courtyard levels based on different layout sizes; The asset grade includes at least one of several courtyard grades.

[0019] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the method as described in either the first or second aspect above.

[0020] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method of any one of the first or second aspects of the present disclosure.

[0021] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including a computer program stored in a readable storage medium, wherein at least one processor of a computer device reads from the readable storage medium and executes the computer program, causing the computer device to perform the method of any one of the first or second aspects of the present disclosure.

[0022] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects: The process involves obtaining a courtyard template file, which includes multiple pre-made courtyard color templates. Each courtyard color template contains at least one color block, with each color block indicating a type of scene element within the courtyard. The color blocks in each courtyard color template are categorized to obtain the scene element corresponding to each color block. Based on the scene element corresponding to each color block, asset attribute information is assigned to each color block in the courtyard color template. This asset attribute information includes scene elements, referenced asset paths, asset size, asset orientation, or asset level. The asset model corresponding to each color block is determined. The asset model is used to respond to courtyard generation instructions, and the asset attribute information is used to instantiate the asset model to generate a virtual courtyard scene. This embodiment of the application leverages the intuitiveness of color templates to allow designers to precisely control the courtyard layout, the position and relationship of key components at the pixel level, fundamentally avoiding the problems of excessive randomness and discrepancies between results and expectations common in traditional procedural generation methods, and reducing manual adjustments.

[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0024] 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.

[0025] Figure 1 This is a schematic diagram illustrating the application environment of a method for generating a virtual courtyard scene according to an exemplary embodiment; Figure 2 This is a flowchart illustrating a method for generating a virtual courtyard scene according to an exemplary embodiment; Figure 3 This is a schematic diagram illustrating a courtyard color template for a small residential house according to an exemplary embodiment; Figure 4 This is a schematic diagram illustrating a courtyard color template for a medium-sized residential building according to an exemplary embodiment; Figure 5 This is a flowchart illustrating a method for determining scene elements corresponding to each color block according to an exemplary embodiment; Figure 6 This is a block diagram illustrating a virtual courtyard scene generation apparatus according to an exemplary embodiment; Figure 7 This is a block diagram illustrating an electronic device for generating virtual courtyard scenes according to an exemplary embodiment. Detailed Implementation

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.

[0027] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar first objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0029] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the application environment of a method for generating a virtual courtyard scene according to an exemplary embodiment, such as... Figure 1 As shown, the application environment may include server 011 and client 012.

[0030] In some possible embodiments, server 011 may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The operating system running on the server may include, but is not limited to, Android, iOS, Linux, Windows, Unix, etc.

[0031] In some possible embodiments, the client 012 described above may include, but is not limited to, image-type clients such as smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. It may also be software running on the client, such as applications or mini-programs. Optionally, the operating system running on the client may include, but is not limited to, Android, iOS, Linux, Windows, and Unix systems.

[0032] In some possible embodiments, client 012 obtains a courtyard template file; the courtyard template file includes multiple pre-made courtyard color templates; each courtyard color template includes at least one color block; each color block indicates a type of scene element in the courtyard; each courtyard color template is processed by color block classification to obtain the scene element corresponding to each color block in each courtyard color template; based on the scene element corresponding to each color block, asset attribute information is assigned to each color block in each courtyard color template; the asset attribute information includes scene element, referenced asset path, asset size, asset orientation, or asset level; the asset model corresponding to each color block is determined; the asset model is used to respond to the courtyard generation command, and the asset attribute information is used to instantiate the asset model to generate a virtual courtyard scene. This embodiment of the application allows designers to precisely control the courtyard layout, the position and relationship of key components at the pixel level through the intuitiveness of the color templates, fundamentally avoiding the problems of excessive randomness and results that do not meet expectations common in traditional procedural generation methods, and reducing manual adjustments.

[0033] In one exemplary implementation, both the client and server databases can be node devices in the blockchain system, capable of sharing acquired and generated information with other node devices within the blockchain system, thus enabling information sharing among multiple node devices. Multiple node devices in the blockchain system can be configured with the same blockchain, which consists of multiple blocks. Adjacent blocks are related, ensuring that any data tampering in any block can be detected by the next block, thereby preventing data tampering and guaranteeing the security and reliability of the data in the blockchain.

[0034] Figure 2This is a flowchart illustrating a method for generating a virtual courtyard scene according to an exemplary embodiment. It should be noted that this specification provides the operational steps of the method as described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many steps and does not represent the only execution order. In actual system or product execution, the method can be executed sequentially according to the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown... Figure 2 As shown, this flowchart includes at least the following steps S201-S203: In step S201, a courtyard template file is obtained; the courtyard template file includes multiple pre-made courtyard color templates; each courtyard color template includes at least one color block; each color block indicates a type of scene element in the courtyard.

[0035] In this embodiment, the Houdini engine can be used to read courtyard template files, which may include multiple pre-made courtyard color templates. Optionally, this courtyard template file can be used in a virtual game to provide courtyard construction for scenes within the game. Specifically, multiple pre-made courtyard color templates can be converted from images into Prim plane models.

[0036] In some possible embodiments, the courtyard template file includes courtyard template files corresponding to various types of courtyards. Optionally, the various types of courtyards include residences, mansions, official residences, palaces, and temples.

[0037] In this embodiment, the generation of various types of courtyards follows the size rules of the basic unit, meaning each courtyard has its own size. For example, the smallest courtyard is 1*1 grid, and the largest is 4*6 grid. Each grid (1*1 grid) can be considered a square area with a side length of 2m in the virtual game. Thus, in the virtual game, the smallest courtyard is 2m*2m, and the largest is 8m*12m.

[0038] Optionally, residences can include small and medium-sized residences. Small residences are 1x1 squares in size and can include scene elements such as thatched huts and mud-brick houses. Medium-sized residences are 2x2 squares in size. Optionally, mansions are 2x3 squares in size; mansions can be considered high-class or luxurious residences and may include scene elements such as small gardens. Optionally, official residences are 2x3 squares in size. Optionally, palaces and temples are both larger than 2x3 squares.

[0039] The aforementioned residences and mansions occupy a relatively small area in the virtual game, therefore, their numbers will appear relatively more frequently. Residences and mansions in the virtual game are primarily presented with asymmetrical layouts to break the monotony of large-scale placement. The aforementioned palaces can be presented with symmetrical layouts in the virtual game. The aforementioned temples can be presented with either symmetrical or asymmetrical layouts in the virtual game. Optionally, official residences, palaces, and temples occupy a larger area in the virtual game, therefore, their numbers will appear relatively fewer. For example, a palace with a size of 4x6 squares will only appear once per map.

[0040] In this embodiment of the application, each courtyard color template includes at least one color block, and each color block indicates a type of scene element in the courtyard. For example, orange color blocks indicate scene elements such as buildings (thatched houses, adobe houses, brick houses) and walls in the courtyard; dark gray color blocks indicate scene elements such as building bases in the courtyard; gray color blocks indicate scene elements such as roads in the courtyard; light gray color blocks indicate scene elements such as paving stones in the courtyard; yellow color blocks indicate scene elements such as props (stone lanterns, woodpile, water tanks, and stone mills in the courtyard); green color blocks indicate scene elements such as trees in the courtyard; emerald green color blocks indicate scene elements such as bamboo groves in the courtyard; dark green color blocks indicate scene elements such as rocks in the courtyard; and beige color blocks indicate scene elements such as garden units in the courtyard.

[0041] Optionally, in the 1x1 grid courtyard scene elements (such as small houses), the courtyard wall can be a fence or a mud wall, or there can be no wall. The props are mainly everyday scene elements such as haystacks and living supplies.

[0042] Figure 3 This is a schematic diagram of a courtyard color template for a small dwelling according to an exemplary embodiment. It includes a variety of different small dwellings. The small dwellings may include orange color blocks indicating scene elements such as buildings and walls in the courtyard, yellow color blocks indicating scene elements such as props (stone lanterns, wood piles, water tanks and stone mills) in the courtyard, and green color blocks indicating scene elements such as trees in the courtyard.

[0043] Figure 4 This is a schematic diagram of a courtyard color template for a medium-sized dwelling according to an exemplary embodiment. It includes various different medium-sized dwellings. The medium-sized dwellings may include orange color blocks indicating scene elements such as buildings and walls in the courtyard, yellow color blocks indicating scene elements such as props (stone lanterns, wood piles, water tanks, and stone mills) in the courtyard, green color blocks indicating scene elements such as trees in the courtyard, and gray color blocks indicating scene elements such as roads in the courtyard.

[0044] Optional, courtyards of 2x2 grids or larger, with existing courtyard walls, and entrances distinguishing between accessible and inaccessible units by the "opening or closing of the door".

[0045] Optionally, embodiments of this application may also include different mansions and official residences with a size of 2*3 grids. Different mansions and official residences include orange color blocks indicating scene elements such as buildings and walls in the courtyard, yellow color blocks indicating scene elements such as props (stone lanterns, wood piles, water tanks, and stone mills) in the courtyard, green color blocks indicating scene elements such as trees in the courtyard, emerald green color blocks indicating scene elements such as bamboo forests in the courtyard, dark green color blocks indicating scene elements such as rocks in the courtyard, and gray color blocks indicating scene elements such as roads in the courtyard.

[0046] Optionally, embodiments of this application may also include different small palaces and temples with dimensions of 3*3, 3*4, or 4*3 grids. These different small palaces and temples include orange color blocks indicating scene elements such as buildings and walls in the courtyard; dark gray color blocks indicating scene elements such as building bases in the courtyard; yellow color blocks indicating scene elements such as props (stone lanterns, woodpile, water tanks, and stone mills) in the courtyard; green color blocks indicating scene elements such as trees in the courtyard; emerald green color blocks indicating scene elements such as bamboo groves in the courtyard; dark green color blocks indicating scene elements such as rocks in the courtyard; and gray color blocks indicating scene elements such as roads in the courtyard.

[0047] Optionally, embodiments of this application may also include different medium-sized palaces and temples with a size of 3*5 grids. These different medium-sized palaces and temples include orange color blocks indicating scene elements such as buildings and walls within the courtyard; dark gray color blocks indicating scene elements such as building bases within the courtyard; yellow color blocks indicating scene elements such as props (stone lanterns, woodpile, water tanks, and stone mills) within the courtyard; green color blocks indicating scene elements such as trees within the courtyard; emerald green color blocks indicating scene elements such as bamboo groves within the courtyard; dark green color blocks indicating scene elements such as rocks within the courtyard; and gray color blocks indicating scene elements such as roads within the courtyard.

[0048] Optionally, embodiments of this application may also include different large palaces and temples with dimensions of 4*5 or 4*6 grids. These different large palaces and temples include orange color blocks indicating scene elements such as buildings and walls within the courtyard; dark gray color blocks indicating scene elements such as building bases within the courtyard; yellow color blocks indicating scene elements such as props (stone lanterns, woodpile, water tanks, and stone mills) within the courtyard; green color blocks indicating scene elements such as trees within the courtyard; emerald green color blocks indicating scene elements such as bamboo groves within the courtyard; dark green color blocks indicating scene elements such as rocks within the courtyard; gray color blocks indicating scene elements such as roads within the courtyard; and beige color blocks indicating scene elements such as garden units within the courtyard.

[0049] In other words, depending on the needs of the virtual game, the courtyard template file can include various courtyard color templates for small houses, medium houses, mansions, official residences, small palaces, medium palaces, large palaces, small temples, medium temples, and large temples.

[0050] In step S203, color block classification processing is performed on each courtyard color template to obtain the scene element corresponding to each color block in each courtyard color template.

[0051] In this embodiment of the application, color block classification processing can be performed on each courtyard color template to obtain the scene element corresponding to each color block in each courtyard color template.

[0052] Figure 5 This is a flowchart illustrating a method for determining scene elements corresponding to each color block according to an exemplary embodiment, including: In step S501, the color scene element correspondence information is determined; the color scene element correspondence information includes multiple color identifiers and the scene element corresponding to each color identifier.

[0053] In some possible embodiments, color scene element correspondence information can be obtained, which may appear in the form of a color scene element lookup table, which may include multiple color identifiers and scene elements corresponding to each color identifier.

[0054] The various color markers and the corresponding scene elements for each color marker are as described above: orange blocks indicate scene elements such as buildings (thatched huts, mud houses, brick houses) and walls in the courtyard; dark gray blocks indicate scene elements such as building bases in the courtyard; gray blocks indicate scene elements such as roads in the courtyard; light gray blocks indicate scene elements such as paving stones in the courtyard; yellow blocks indicate scene elements such as props (stone lanterns, woodpile, water tank, and stone mill in the courtyard); green blocks indicate scene elements such as trees in the courtyard; emerald green blocks indicate scene elements such as bamboo groves in the courtyard; dark green blocks indicate scene elements such as rocks in the courtyard; and beige blocks indicate scene elements such as garden units in the courtyard.

[0055] In step S503, the scene element corresponding to each color block in the color template of each courtyard is determined according to the color scene element correspondence information.

[0056] In this embodiment of the application, the corresponding scene element can be determined from the color scene element corresponding information based on the color of the color block of each scene element.

[0057] In some possible embodiments, the color blocks of the courtyard color template can be segmented after color block classification. This breaks down the complex whole into "minimum operable units" that conform to rules, thus adapting to the flexibility, accuracy, and controllability of subsequent processes.

[0058] In this embodiment of the application, each consecutive color block in the color template of each courtyard can be divided to obtain multiple sub-color blocks corresponding to each consecutive color block. The colors of the multiple sub-color blocks after division are the same as the colors of the corresponding consecutive color blocks.

[0059] The following example uses roads within a courtyard. After the color block classification process described above, each color block in the courtyard's color template corresponds to a scene element, resulting in one or a few road scene elements within the entire courtyard. However, the final presentation of each road scene element in the virtual game relies on piecing together multiple standardized prefabricated road components from the asset library (such as 1m, 2m, and 4m long road segments, T-junctions, curves, etc.). Without segmentation, its size would far exceed the largest prefabricated road component in the asset library, making direct matching impossible later. After segmentation, the size of each unit can be controlled within the asset library's coverage area (e.g., segmented into 2m sections). By piecing together different units, long roads can be reconstructed, avoiding model stretching and deformation.

[0060] Secondly, even within roads, units at different locations may carry different attributes, such as size, orientation, and additional elements. For example, regarding orientation and curvature, road bends (L-shaped units) and slopes (sloping units) require independent orientation settings and can only be adjusted individually after segmentation. For additional elements, such as streetlights along a section of road, attributes can be added only to specific units after segmentation.

[0061] Furthermore, the entire scene is essentially the result of "unit splicing" (rock units, road units, tree units, etc.). If consecutive blocks of the same color are not segmented, it will disrupt the consistency of "unitization." In addition, segmentation also facilitates flexible control and precise resource allocation for symmetrical or asymmetrical approaches.

[0062] In step S205, asset attribute information is assigned to each color block in each courtyard color template based on the scene element corresponding to each color block; the asset attribute information includes scene element, referenced asset path, asset size, asset orientation, or asset level.

[0063] In this embodiment, asset attribute information can be assigned to each color block in each courtyard color template based on the scene element corresponding to each color block. After the asset attribute information is assigned, the asset attribute information includes scene element, referenced asset path, asset size, asset orientation, or asset level.

[0064] Optionally, determining the scene element corresponding to each color block involves defining the type of the color block, i.e., specifying what scene element the color block represents. Assigning asset attribute information to each color block refers to filling each scene with details. In this embodiment, different types of scene elements may have different attribute requirements, and determining the scene elements can limit which asset attribute information can be subsequently assigned.

[0065] In this embodiment, the referenced asset path indicates which asset model in the asset library should be used for this color block; the asset size indicates the size of this color block in the template, such as 1*1 grid; the asset orientation indicates the arrangement direction of the color blocks, such as whether a building is placed upright or rotated 90 degrees; and the asset level refers to the level of courtyards to which this color block can be applied.

[0066] In this embodiment, multiple pre-made courtyard color templates correspond to multiple courtyard levels based on different layout sizes, and the asset level includes at least one of the multiple courtyard levels. Optionally, after obtaining the courtyard template file, the multiple courtyard color templates can be classified according to the level division rules. For example, 1*1 and 2*2 grid courtyard color templates correspond to the first courtyard level, 2*3 grid courtyard color templates correspond to the second courtyard level, 3*3, 3*4, and 4*3 grid courtyard color templates correspond to the third courtyard level, 3*5 grid courtyard color templates correspond to the fourth courtyard level, and 4*5 and 4*6 grid courtyard color templates correspond to the fifth courtyard level. Assuming a certain color block is orange and the asset size is 2*3, its asset level is the fifth courtyard level, that is, it can be used for 4*5 and 4*6 grid courtyards.

[0067] In this embodiment of the application, the scene element, asset size, asset orientation and asset level corresponding to each color block can be determined. When the asset model file is successfully retrieved based on the scene element, asset size, asset orientation and asset level corresponding to each color block, the reference asset path corresponding to each color block is determined.

[0068] Specifically, the Houdini engine can use preset rules to assign asset size, asset orientation, and asset level to each color block based on the scene elements corresponding to each color block. In this way, asset model files can be searched based on the scene elements, asset size, asset orientation, and asset level corresponding to each color block. When the search is successful, for example, if the asset model "1*1 rock.prefab" is obtained, the reference asset path of the color block indicating the color can be returned.

[0069] In some possible implementations, the Houdini engine can read assets from the asset library corresponding to the virtual game and classify the asset models so that the asset models can be retrieved based on the asset level in the future.

[0070] In step S207, the asset model corresponding to each color block is determined; the asset model is used to respond to the courtyard generation instruction, and the asset attribute information is used to instantiate the asset model to generate a virtual courtyard scene.

[0071] In this embodiment of the application, once the scene element, asset size, asset orientation, asset level and referenced asset path corresponding to each color block are determined, an attribute information asset model record table can be generated. The attribute information asset model record table includes the asset attribute information and asset model corresponding to each color block.

[0072] In this embodiment of the application, after determining the asset model corresponding to each color block, the color block carrying asset attribute information is imported into the rendering engine through the point cache, which is used to instantiate the three-dimensional model based on the corresponding position of the asset attribute information in the virtual map to form a virtual courtyard scene.

[0073] Specifically, once the asset model corresponding to each color block is determined, the color block carrying the asset attribute information is imported into the rendering engine through a point cache. Responding to user input parameters, the type of courtyard to be generated can be determined, and then courtyard generation can be performed in the virtual game based on the determined courtyard type. For example, courtyard generation in the virtual game includes the generation of walls and gates, buildings (thatched huts, etc.), rocks, lampposts, miscellaneous props, trees, and roads.

[0074] In summary, the embodiments of this application can achieve the following effects: 1. Enhance the accuracy and artistic control of expression. This invention uses color ID templates as "design blueprints" to directly translate the artistic intentions of artists into generation rules. This method can accurately express the unique cultural semantics and aesthetic principles of traditional Chinese courtyards, such as layout concepts like axial symmetry and the interplay of solid and void, thus ensuring that the generated results far surpass general generation algorithms based on probability combinations in terms of cultural accuracy. The intuitiveness of color templates allows designers to precisely control the layout of the courtyard and the position and relationship of key components at the pixel level, fundamentally avoiding the problems of excessive randomness and discrepancies between results and expectations commonly found in traditional procedural generation methods, and achieving precise implementation of art direction.

[0075] 2. Achieve high efficiency and determinism in the generation process. Compared to algorithms like wave function collapse that require iterative calculations and backtracking, the technical approach of this invention is more efficient and direct. It replaces complex probabilistic calculations with direct matching of color recognition and asset attributes, achieving rapid and deterministic instantiation. This non-iterative characteristic ensures that the generation speed does not increase exponentially with the scale of the scene, thus efficiently handling the generation needs of large-scale traditional Chinese courtyard scenes and significantly improving the overall work efficiency from design to the final 3D scene. 3. Enhance the flexibility and compatibility of technical solutions. The attribute assignment mechanism of this invention provides great flexibility for handling non-standardized traditional Chinese style components. The system can individually adjust the size, orientation, grade, and other attributes of each generated component, thus well adapting to the organic combination needs of heterogeneous components with different forms, such as pavilions, terraces, towers, pavilions, rockeries, and vegetation. This method reduces the dependence on the standardization of components, supports more flexible and varied combination methods, and makes the generated courtyard layout both conform to certain rules and have natural and vivid diversity, avoiding the mechanical and rigid feeling brought by traditional modular assembly.

[0076] 4. Promote technology integration and production process optimization This invention constructs a cross-platform automated workflow, fully leveraging the powerful geometric node processing capabilities of the Houdini engine for preliminary data processing and rule execution, and then efficiently importing the results into the Unity engine for instantiation through point caching technology. This deep integration leverages the advantages of different professional tools, forming an end-to-end solution from initial design to final presentation, improving the synergy and productivity of the toolchain. This solution is easily integrated with existing 3D content production workflows, can be customized and extended according to different project needs, and has good application adaptability. In summary, the traditional Chinese courtyard generation tool provided by this invention, by combining intuitive color ID templates with powerful procedural generation technology, brings significant benefits in terms of cultural expression accuracy, generation efficiency, artistic controllability, technical flexibility, and workflow integration, providing an innovative solution for creating high-quality, high-efficiency 3D scenes that conform to specific cultural connotations and aesthetic requirements.

[0077] Figure 6 This is a block diagram of a device for generating a virtual courtyard scene according to an exemplary embodiment. It has the function of implementing the data processing method in the above-described method embodiment; the function can be implemented in hardware or by hardware executing corresponding software. (Refer to...) Figure 6 The device includes a resource display module 601, a color block processing module 602, an information assignment module 603, and a model determination module 604. The resource display module 601 is configured to retrieve a courtyard template file; the courtyard template file includes multiple pre-made courtyard color templates; each courtyard color template includes at least one color block; each color block indicates a type of scene element in the courtyard; The color block processing module 602 is configured to perform color block classification processing on each courtyard color template to obtain the scene element corresponding to each color block in each courtyard color template; The information assignment module 603 is configured to assign asset attribute information to each color block in each courtyard color template based on the scene element corresponding to each color block; the asset attribute information includes scene element, referenced asset path, asset size, asset orientation, or asset level; The model determination module 604 is configured to determine the asset model corresponding to each color block; the asset model is used to respond to the courtyard generation instruction, and to instantiate the asset model using asset attribute information to generate a virtual courtyard scene.

[0078] In some possible embodiments, The color block processing module is configured to execute: Determine the information corresponding to the color scene elements; the information corresponding to the color scene elements includes multiple color identifiers and the scene elements corresponding to each color identifier. Based on the color scene element correspondence information, determine the scene element corresponding to each color block in the color template of each courtyard.

[0079] In some possible embodiments, The device also includes a segmentation processing module configured to perform: Each consecutive color block in the color template of each courtyard is divided into multiple sub-color blocks corresponding to each consecutive color block; the colors of the multiple sub-color blocks after division are the same as the colors of the corresponding consecutive color blocks.

[0080] In some possible embodiments, The information assignment module is configured to execute: Determine the scene element, asset size, asset orientation, and asset level corresponding to each color block; Once the asset model file is successfully retrieved based on the scene element, asset size, asset orientation, and asset level corresponding to each color block, the referenced asset path corresponding to each color block is determined.

[0081] In some possible embodiments, The model determination module is configured to execute: Generate an attribute information asset model record table; the attribute information asset model record table includes the asset attribute information and asset model corresponding to each color block.

[0082] In some possible embodiments, The device also includes a cache import module, configured to execute: Color blocks carrying asset attribute information are imported into the rendering engine through a point cache. These blocks are then used to instantiate 3D models based on the corresponding locations of the asset attribute information in the virtual map, forming a virtual courtyard scene.

[0083] In some possible embodiments, Multiple pre-made courtyard color templates correspond to multiple courtyard levels based on different layout sizes; The asset grade includes at least one of several courtyard grades.

[0084] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0085] Figure 7This is a block diagram illustrating an apparatus 3000 for generating a virtual courtyard scene according to an exemplary embodiment. For example, apparatus 3000 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0086] Reference Figure 7 The device 3000 may include one or more of the following components: a processing component 3002, a memory 3004, a power component 3006, a multimedia component 3008, an audio component 3010, an input / output (I / O) interface 3012, a sensor component 3014, and a communication component 3016.

[0087] Processing component 3002 typically controls the overall operation of device 3000, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 3002 may include one or more processors 3020 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 3002 may include one or more modules to facilitate interaction between processing component 3002 and other components. For example, processing component 3002 may include a multimedia module to facilitate interaction between multimedia component 3008 and processing component 3002.

[0088] Memory 3004 is configured to store various image types of data to support operation of device 3000. Examples of this data include instructions for any application or method operating on device 3000, contact data, phonebook data, messages, pictures, videos, etc. Memory 3004 can be implemented by any image type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0089] Power supply component 3006 provides power to various components of device 3000. Power supply component 3006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 3000.

[0090] Multimedia component 3008 includes a screen that provides an output interface between the device 3000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 3008 includes a front-facing camera and / or a rear-facing camera. When the device 3000 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0091] Audio component 3010 is configured to output and / or input audio signals. For example, audio component 3010 includes a microphone (MIC) configured to receive external audio signals when device 3000 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 3004 or transmitted via communication component 3016. In some embodiments, audio component 3010 also includes a speaker for outputting audio signals.

[0092] I / O interface 3012 provides an interface between processing component 3002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0093] Sensor assembly 3014 includes one or more sensors for providing status assessments of various aspects of device 3000. For example, sensor assembly 3014 may detect the on / off state of device 3000, the relative positioning of components such as the display and keypad of device 3000, changes in the position of device 3000 or a component of device 3000, the presence or absence of user contact with device 3000, the orientation or acceleration / deceleration of device 3000, and temperature changes of device 3000. Sensor assembly 3014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 3014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 3014 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0094] Communication component 3016 is configured to facilitate wired or wireless communication between device 3000 and other devices. Device 3000 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 3016 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 3016 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0095] In an exemplary embodiment, the apparatus 3000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0096] Embodiments of the present invention also provide a computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method for generating a virtual courtyard scene, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the method for generating a virtual courtyard scene provided in the above-described method embodiments.

[0097] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 3004 including instructions, which can be executed by a processor 3020 of the device 3000 to perform the above-described method. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0098] Embodiments of the present invention also provide a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method of any one of the first or second aspects of the embodiments of the present disclosure.

[0099] Embodiments of the present invention also provide a computer program product comprising a computer program stored in a readable storage medium, wherein at least one processor of a computer device reads from the readable storage medium and executes the computer program, causing the computer device to perform the method of any one of the first or second aspects of the embodiments of the present disclosure.

[0100] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, the generation and parallel processing of virtual courtyard scenes are also possible or may be advantageous.

[0101] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0102] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0103] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for generating a virtual courtyard scene, characterized in that, include: Obtain a courtyard template file; the courtyard template file includes multiple pre-made courtyard color templates; each courtyard color template includes at least one color block; each color block indicates a type of scene element in the courtyard; Each courtyard color template is classified into color blocks to obtain the scene element corresponding to each color block in each courtyard color template; Based on the scene element corresponding to each color block, asset attribute information is assigned to each color block in each courtyard color template; the asset attribute information includes the scene element, the referenced asset path, the asset size, the asset orientation, or the asset level. The asset model corresponding to each color block is determined; the asset model is used to instantiate the asset model in response to the courtyard generation command, and generate a virtual courtyard scene by using the asset attribute information.

2. The method for generating a virtual courtyard scene according to claim 1, characterized in that, The step of classifying the color blocks of each courtyard color template to obtain the scene elements corresponding to each color block in each courtyard color template includes: Determine the color scene element correspondence information; the color scene element correspondence information includes multiple color identifiers and the scene element corresponding to each color identifier; The scene element corresponding to each color block in the color template of each courtyard is determined based on the color scene element correspondence information.

3. The method for generating a virtual courtyard scene according to claim 2, characterized in that, After determining the scene element corresponding to each color block in each courtyard color template based on the color scene element correspondence information, the method further includes: Each consecutive color block in the color template of each courtyard is divided into multiple sub-color blocks corresponding to each consecutive color block; the color of the multiple sub-color blocks after division is the same as the color of the corresponding consecutive color block.

4. The method for generating a virtual courtyard scene according to claim 1, characterized in that, The process of assigning asset attribute information to each color block in each courtyard color template based on the scene element corresponding to each color block includes: Determine the scene element, asset size, asset orientation, and asset level corresponding to each color block; When the asset model file is successfully retrieved based on the scene elements, asset size, asset orientation, and asset level corresponding to each color block, the referenced asset path corresponding to each color block is determined.

5. The method for generating a virtual courtyard scene according to claim 1, characterized in that, Determining the asset model corresponding to each color block includes: Generate an attribute information asset model record table; the attribute information asset model record table includes the asset attribute information and asset model corresponding to each color block.

6. The method for generating a virtual courtyard scene according to any one of claims 1-5, characterized in that, After determining the asset model corresponding to each color block, the process further includes: The color blocks carrying the asset attribute information are imported into the rendering engine through a point cache, and used to instantiate a 3D model based on the corresponding position of the asset attribute information in the virtual map to form a virtual courtyard scene.

7. The method for generating a virtual courtyard scene according to any one of claims 1-5, characterized in that, Multiple pre-made courtyard color templates correspond to multiple courtyard levels based on different layout sizes; The asset grade includes at least one of the plurality of courtyard grades.

8. A device for generating a virtual courtyard scene, characterized in that, include: The resource display module is configured to retrieve courtyard template files; the courtyard template files include multiple pre-made courtyard color templates; each courtyard color template includes at least one color block; each color block indicates a type of scene element in the courtyard; The color block processing module is configured to perform color block classification processing on each courtyard color template to obtain the scene element corresponding to each color block in each courtyard color template; The information assignment module is configured to assign asset attribute information to each color block in each courtyard color template based on the scene element corresponding to each color block; the asset attribute information includes the scene element, the referenced asset path, the asset size, the asset orientation, or the asset level. The model determination module is configured to determine the asset model corresponding to each color block; the asset model is used to instantiate the asset model using the asset attribute information in response to the courtyard generation instruction, thereby generating a virtual courtyard scene.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method for generating a virtual courtyard scene as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method for generating a virtual courtyard scene as described in any one of claims 1 to 7.

11. A computer program product, characterized in that, The computer program product includes a computer program stored in a readable storage medium, wherein at least one processor of a computer device reads from and executes the computer program, causing the device to perform the method for generating a virtual courtyard scene as described in any one of claims 1 to 7.