A method, system and computer device for generating procedural materials
Patent Information
- Application Number
- CN202611176192.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-20
AI Technical Summary
[0008]针对现有技术存在的程序化材质生成过程中可执行性与外观保真度难以兼顾以及迭代优化效率低的问题,本申请通过一种程序化材质的生成方法、系统及计算机设备,基于结构化材质描述语言构建类型化内存图,并结合内外双循环解耦的自进化架构,实现了高保真、可执行且低开销的程序化材质自动生成
本申请提供的技术方案,通过引入结构化材质描述语言与类型化内存图作为可操作接口,将原本黑盒的代码生成过程转化为白盒的图操作过程,使得系统能够在不依赖渲染引擎执行的情况下进行静态结构校验,并在运行时聚合错误信息以支持最小化局部修复,从而从根本上解决了生成结果语法非法或不可执行的问题,同时相比直接生成长脚本显著降低了上下文令牌开销。在此基础上,本申请构建了内外双循环解耦的自进化架构,内循环利用轻量级材质评估模型驱动高频参数扰动搜索,快速逼近局部最优外观;外循环利用语义评估模型进行低频结构评判与重写,纠正材质机理偏差。这种分层优化策略避免了将所有优化压力都置于昂贵的大模型之上,在保证生成材质具备高分辨率无关性、可编辑性及视觉保真度的同时,大幅提升了生成成功率与迭代效率,使其能够适应真实生产环境中对高质量程序化资产的自动化制作需求。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the fields of 3D digital asset creation and artificial intelligence technology, specifically to a method, system, and computer device for generating procedural materials. Background Technology
[0002] In 3D digital asset creation, materials are the core element determining the optical response of an object's surface. They enable predictable rendering results, support relighting, facilitate reuse, and allow for targeted editing by artists, making them widely used in games, film and television production, visual simulation, and digital content creation. In actual production workflows, material creation is not a one-time texture compositing task, but an iterative appearance development process: artists evaluate candidate materials on the target model, modify the underlying structure of the material when the shading mechanism is inappropriate, adjust the exposed parameters when the appearance is close, and compare different solutions under relevant lighting and artistic guidance. As the scale and diversity of 3D asset libraries grow, the industry increasingly needs AI-assisted material creation systems that can integrate into this iterative cycle, producing materials that are visually believable, editable, executable, and modifiable.
[0003] Significant progress has been made in learning-based material generation methods in recent years, which can be summarized into two technical routes.
[0004] Route 1 is texture-based material generation. This route represents the material appearance as a fixed set of dense textures, namely physically based rendering textures (including fixed channel maps of base color, metallicity, roughness, normals, and transparency arranged in pixels). One approach utilizes a pre-trained 2D diffusion model prior to recover the 3D appearance through projection, including fractional distillation-based optimization, progressive multi-view patching, and cross-view synchronous denoising. Recently, it has been extended to roughness, metallicity, and normal channels. Another approach trains a feedforward generator on the native 3D representation to avoid multi-view operations during testing, including UV mapping representation, mesh surface representation, structured sparse voxel latent variable representation, and native 3D texture field representation. Both approaches represent the appearance as a fixed, dense texture tuple, which has the following inherent limitations: For properties such as subsurface scattering, self-illumination, transmission, and layered response, the supervised data required for training is sparse and inconsistent, and simply increasing the number of texture channels is ineffective; Many complex materials rely on shader-level mechanisms such as procedural changes, coordinate-dependent effects, layered bidirectional scattering distribution functions, and editable parameters, while fixed textures basically hide these mechanisms and cannot expose them to user editing; Raster textures do not have the resolution independence and parameter editability of procedural representation, making them unsuitable for iterative refinement by artists.
[0005] Route two is procedural material generation. This route represents materials as editable, resolution-independent shader graphs (a type of directed computation graph where nodes represent operations such as texture composition, spatial modulation, and optical response, and edges represent data flow), and treats the generation of shader graphs as a learning-based procedural composition problem. Procedural materials express appearance through shader graphs, explicitly exposing shader-level mechanisms such as emissivity, subsurface scattering, transmission, layered reflection, and procedural variations. However, to automatically generate a valid and visually correct shader graph, the system must simultaneously consider four interdependent aspects: discrete graph topology (which nodes, how they are connected), continuous shader parameters (such as roughness, color gradients, noise scale, bump intensity, and transmittance values), executable validity (the generated program must run without errors in the renderer), and visual fidelity (the rendered result must be similar to the target reference graph). Several schemes have been proposed in the procedural route. Some schemes optimize continuous parameters on a fixed shader graph through differentiable rendering, but only adjust the parameters without changing the graph structure. Some approaches use deep learning networks to directly generate shader graph structures (i.e., node and connection topology) under textual or image cues, but lack validation and correction of the generated results. Other approaches use visual language models to output procedural node scripts for the rendering engine and refine parameters, or employ compact material representations and refine the results using a search-based approach. Still others, based on existing materials, use visual language models to repeatedly propose free-form edits to the rendering engine's native script interface, guided by a vision-based evaluator; however, these approaches focus on material editing rather than generating from scratch. These approaches collectively demonstrate the potential of procedural shader graph synthesis, but the candidate rendering results they generate are typically only used for parameter selection, rather than modifying the graph structure through an explicit fix-validate loop.
[0006] The aforementioned existing technologies have the following drawbacks. First, for procedural single-prediction schemes, generation is treated as a single prediction or a one-time search, lacking the ability to process its own output in a closed loop. Consequently, the results may fall into one of the following four failure scenarios: illegal syntax (the generated program cannot be compiled or executed), executable but visually poor (it runs successfully but the rendered appearance is far from the target), structural error (the wrong shader mechanism was selected, for example, making a transparent material opaque diffuse), or reasonable structure but unoptimized parameters (the correct mechanism was selected, but the values were not adjusted accurately, and the appearance still does not meet the requirements). Second, for iterative schemes based on the rendering engine's native script interface for free-form editing, the interface overhead is enormous: generating a single material requires approximately 60 to 130 calls to the visual language model, and the success rate of each call is only about 70%. This free-form editing cannot perform static verification of the program before generation, and it consumes a large amount of computation and lexical budget due to repeatedly feeding the lengthy script back to the model. Furthermore, as a general-purpose scripting language, native scripts allow arbitrary control flow, side effects, and application programming interface (API) calls, making static validation difficult and constraining the model's output space within the range of legal shader graph operations. Moreover, their APIs frequently change between versions, making direct generation prone to errors. Third, for schemes that directly output procedural node scripts using visual language models, the training data distribution is narrow, making it difficult to generalize to real-world image inputs and limiting their applicability in practical reference graph-driven scenarios. Fourth, all the aforementioned procedural schemes lack a structured intermediate representation that supports both static validation and reduces API overhead and lexical consumption, making it difficult to efficiently coordinate generation, validation, repair, and optimization on a unified data foundation.
[0007] Therefore, those skilled in the art urgently need a programmatic material generation scheme that can autonomously complete parameter optimization and structural modification while ensuring program executability and has low iteration overhead. Summary of the Invention
[0008] To address the issues of difficulty in balancing executability and appearance fidelity in the existing procedural material generation process, as well as the low efficiency of iterative optimization, this application proposes a procedural material generation method, system, and computer device. Based on a structured material description language, a typed memory graph is constructed, and combined with a self-evolving architecture with decoupled inner and outer double loops, achieving high-fidelity, executable, and low-overhead automatic generation of procedural materials.
[0009] To achieve the above objectives, this application adopts the following technical solution: In a first aspect, this application provides a method for generating procedural materials, comprising the following steps: The process involves: acquiring reference information for the target material; generating an initial material description program based on a structured material description language; parsing the initial material description program into a typed memory graph, which includes nodes, connections, and parameters; performing executability verification on the typed memory graph; if verification fails, patching the typed memory graph based on error diagnosis information until verification passes; after successful verification, performing inner loop parameter tuning: perturbing the parameters in the typed memory graph to generate candidate parameters; evaluating the rendering results of the candidate parameters based on a lightweight material evaluation model; updating the parameters based on the evaluation results to obtain the tuned material description program; and performing outer loop structure rewriting: judging the rendering results before and after tuning based on a semantic evaluation model; if the judgment result does not meet preset conditions, generating feedback information and triggering a rewriting of the topology of the typed memory graph, returning to the step of generating the initial material description program, until the preset conditions are met or a preset iteration limit is reached, and outputting the target procedural material.
[0010] The above scheme transforms the unstructured generation task into a structured operation based on a typed memory graph, enabling the system to perform deterministic executability verification and local repair of the generated material description, thereby ensuring the legitimacy of the generation results. At the same time, through the decoupled design of inner loop parameter tuning and outer loop structure rewriting, a lightweight model is used to handle high-frequency numerical searches, and a semantic model is used to handle low-frequency structural evolution. While ensuring that the material appearance gradually approaches the reference target, the scheme significantly reduces the calling frequency and computational overhead of the large model, achieving self-evolving closed-loop generation.
[0011] As one implementation, the local patching repair of the typed memory graph based on error diagnosis information includes: locating the minimum set of damaged nodes in the typed memory graph based on the error diagnosis information; generating an alternative description fragment for the minimum set of damaged nodes; parsing the alternative description fragment into a repair subgraph; merging the repair subgraph into the typed memory graph; and automatically restoring bridging connections that remain valid after repair. This preferred solution, by performing minimal editing at the memory graph level, only replaces the damaged parts and retains unaffected bridging connections, avoiding the regeneration of the entire graph due to local errors, maximizing the preservation of the continuity of the original design, and further reducing context consumption during the repair process.
[0012] As one implementation, the executability verification of the typed memory graph includes: a first-stage verification: performing a static check on the syntax and topology of the typed memory graph; and a second-stage verification: in response to the passing of the static check, converting the typed memory graph into executable code for the target rendering engine and running it, with no abnormal execution as the pass signal, and aggregating the abnormal information during execution into the error diagnosis information. This preferred solution employs a two-stage verification mechanism, first intercepting structural errors through static checks, and then capturing engine-specific constraint conflicts through runtime verification, ensuring that the material description program entering the optimization stage has definite executability, while aggregating scattered error information into a unified diagnostic report, improving the targeting and efficiency of subsequent repairs.
[0013] As one implementation, the inner loop parameter tuning includes: selecting a subset of key parameters from the parameters of the typed memory graph; applying typed perturbations to the subset of key parameters to generate candidate parameters; scoring the rendering results of the candidate parameters based on the lightweight material evaluation model; accepting or rejecting the candidate parameters based on the score changes; and maintaining historically optimal parameter settings. This preferred solution, by intelligently filtering key parameters and combining them with the high-frequency scoring of the lightweight evaluation model, narrows the search space to the dimension with the greatest impact on appearance, avoiding blind searching of all parameters, and enabling rapid convergence to a better parameter configuration within a limited number of steps.
[0014] As one implementation, applying a typed perturbation to the subset of key parameters includes: for scalar parameters, performing a scaling perturbation in logarithmic space to make upward and downward shifts symmetrical in logarithmic space; for color parameters, independently resampling hue, saturation, and lightness within a preset perturbation radius of the current value in the HSV color space; for Boolean parameters, performing state flipping according to a preset probability; wherein, all generated candidate parameters are clipped to the valid value range of the corresponding node before rendering. This preferred scheme designs differentiated perturbation strategies for the physical meaning of different data types, making parameter search more consistent with the distribution law of material properties, and preventing invalid rendering through valid range clipping, thereby improving the effectiveness and stability of parameter tuning.
[0015] As one implementation, the outer loop structure rewriting includes: based on the semantic evaluation model, comparing and judging the unoptimized rendering result and the optimized rendering result of the current round with the reference information to obtain corresponding scores; retaining the rendering result with the higher score as the output of the current round; if the score of the rendering result with the higher score does not reach the preset passing threshold, generating the feedback information in free text form, and sending the feedback information back to trigger a structural-level rewriting of the topology of the typed memory graph. This preferred solution clarifies that the triggering condition of the outer loop is the failure of the semantic-level evaluation, rather than a simple numerical error, so that the system only initiates expensive structural reconstruction when there is a deviation in the material mechanism itself, achieving an effective separation between correctness repair and appearance evolution.
[0016] In one implementation, the rendering results are obtained by constructing a standard rendering set, which includes: a tiled planar view for evaluating the texture details and graininess of the material; a bright sphere view for evaluating the material's color, base albedo, and overall surface features; and a dark sphere view for evaluating the material's specular highlights, reflectivity, roughness, and emissivity. This preferred approach, through a multi-dimensional standard view set, decouples the entanglement between lighting and material properties, providing a comprehensive and controlled observation basis for the evaluation model and improving the accuracy of appearance similarity judgment.
[0017] As one implementation, the structured material description language includes: a node block, starting with a node identifier and node type, followed by an attribute line for setting node attributes and an input line for setting default values for input sockets; a link line, used to declare directed data flow connections from the output socket of the source node to the input socket of the target node; obtaining reference information for the target material includes: calling a generative model to complete missing input modalities, generating a tilable texture map for materials rich in discrete patterns, and combining the tilable texture map with the structured material description language to form a hybrid material representation. This preferred solution defines a compact and typed intermediate representation that supports static parsing and verification while significantly reducing text length; simultaneously, through a hybrid material representation strategy, it balances the editability of procedural generation with the expression requirements of complex patterns.
[0018] Secondly, this application also provides a procedural material generation system, comprising: a generation and parsing module, used to obtain reference information of the target material, generate an initial material description program based on a structured material description language, and parse the initial material description program into a typed memory graph, the typed memory graph including nodes, connection relationships, and parameters; a verification and repair module, used to perform executable verification on the typed memory graph, and if the verification fails, to perform local patch repair on the typed memory graph based on error diagnosis information until the verification passes; and an inner loop optimization module, used to perform inner loop parameter optimization after the verification passes. The system applies perturbations to the parameters in the typed memory graph to generate candidate parameters. The rendering results of these candidate parameters are evaluated using a lightweight material evaluation model. The parameters are updated based on the evaluation results to obtain the optimized material description program. The outer loop rewriting module performs outer loop structure rewriting: it evaluates the rendering results before and after optimization using a semantic evaluation model. If the evaluation result does not meet preset conditions, feedback information is generated, triggering a rewriting of the topology of the typed memory graph. The system then returns to the operation of generating the initial material description program until the preset conditions are met or a preset iteration limit is reached, outputting the target procedural material. Through the collaborative work of various functional modules, this system achieves a self-evolving generation process corresponding to the method embodiment, facilitating deployment and integration in software products or cloud services.
[0019] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the programmed material generation methods provided in the first aspect above.
[0020] The beneficial effects of this application include: The technical solution provided in this application transforms the original black-box code generation process into a white-box graph operation process by introducing a structured material description language and a typed memory graph as operable interfaces. This allows the system to perform static structure verification without relying on the rendering engine and aggregate error information at runtime to support minimal local repair, thus fundamentally solving the problem of illegal or unexecutable syntax in the generated results. Furthermore, it significantly reduces context token overhead compared to directly generating long scripts. Based on this, this application constructs a self-evolving architecture with decoupled inner and outer loops. The inner loop uses a lightweight material evaluation model to drive high-frequency parameter perturbation search, quickly approximating the local optimum appearance; the outer loop uses a semantic evaluation model to perform low-frequency structure evaluation and rewriting, correcting material mechanism deviations. This layered optimization strategy avoids placing all optimization pressure on expensive large models. While ensuring that the generated materials possess high-resolution independence, editability, and visual fidelity, it significantly improves the generation success rate and iteration efficiency, enabling it to adapt to the automated production needs of high-quality procedural assets in real-world production environments. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the overall process of the programmed material generation method according to an embodiment of this application; Figure 2 This is a diagram illustrating the procedural material generation effect of an embodiment of this application; Figure 3 This is a schematic diagram of the parameter tuning process in an embodiment of this application; Figure 4 This is a flowchart illustrating the construction of training data for the material scorer according to an embodiment of this application. Figure 5 This is a comparison diagram of the generation results of the embodiments of this application and the prior art; Figure 6 This is a qualitative ablation effect diagram of the application scenario and material scorer training strategy of this application embodiment; Figure 7 This is a failure case analysis diagram of an embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0024] Terminology Explanation: Procedural material: A material described using a programmable node graph (rather than a fixed pixel map), which is resolution-independent and editable.
[0025] Shader graph: A directed computation graph in which nodes represent operations such as texture composition, spatial modulation, and optical response, and edges represent data flow.
[0026] Domain-Specific Language (DSL): A language specifically designed by this invention for concisely and declaratively describing shader graphs.
[0027] Visual-Language Model (VLM): A large model that can understand both images and text simultaneously.
[0028] Large Language Model (LLM): A large model for processing text.
[0029] Physically-Based Rendering Maps (PBR maps): These include maps with fixed channels for base color, metallicity, roughness, and normals.
[0030] An agent is a software module that can autonomously execute a "reasoning-action-observation" cycle.
[0031] BPY (Blender Python): The native Python scripting interface for the 3D software Blender.
[0032] Reference image (denoted as) ): Target material image provided by the user or synthesized by this invention.
[0033] Bounding box (denoted as ): Define the rectangular coordinates of the area where the target material is located on the reference image.
[0034] Detailed textual description of the target material.
[0035] Optional, tileable raster texture map.
[0036] : DSL program text generated by the designer.
[0037] : A typed memory graph obtained from DSL parsing, where A collection of shader nodes. A set of directed links. This is a set of adjustable point parameters.
[0038] A unified error diagnosis report obtained from the aggregation during the verification phase.
[0039] A set of parameters The three-view rendering sets corresponding to the materials are a tiled plane, a bright sphere, and a dark sphere.
[0040] The historically optimal parameter settings that have appeared during the inner loop parameter tuning process.
[0041] Example 1 like Figure 1 As shown, this embodiment provides a method for generating procedural materials. The core of this method is a self-evolving closed-loop pipeline of "generation—execution—inspection—repair / tuning—evaluation—rewriting," executed collaboratively by six functional modules: an enhancer, used to normalize heterogeneous user input into a unified material specification; a designer, used to generate shader graph programs based on a structured material description language; a repairer, used to perform local patch repairs on graphs that failed verification; an inspector, used to select a subset of key appearance parameters from all adjustable parameters; a material scorer (i.e., a lightweight material evaluation model), used to quickly score and sort the rendering results of candidate parameters in the inner loop; and an evaluator (i.e., a semantic evaluation model), used to perform semantic-level evaluation and feedback on the tuning results in the outer loop. The overall process consists of an outer loop and an inner loop nested within it. The outer loop is driven by the evaluator for structural-level rewriting, executing at most K_out rounds, with a default K_out=3. The inner loop consists of randomized hill-climbing parameter tuning sorted by the material scorer, executing K_in=50 steps per round by default.
[0042] Specifically, the method includes the following steps.
[0043] Step S100: Obtain reference information for the target material, generate an initial material description program based on the structured material description language, and parse the initial material description program into a typed memory graph, which includes nodes, connection relationships, and parameters.
[0044] Specifically, the reference information that the user can provide includes any combination of the following: a text prompt, a reference image, and a bounding box of the target region. The enhancer normalizes the above heterogeneous inputs into a unified material specification, which includes three parts: a detailed material description, a reference image with a bounding box, and an optional tiling texture map. The enhancer completes missing modalities according to the following rules: When the user only provides textual prompts without visual context, the enhancer calls an image generation model to synthesize a reference image that can visually instantiate the textual description, thus providing a visual anchor for downstream semantic evaluation; when the user only provides an image without textual descriptions or region specifications, the enhancer performs content understanding and target localization on the image, automatically generating detailed material description text and bounding box coordinates to eliminate ambiguity in multi-material scenarios; when the user provides multiple inputs simultaneously, missing items are completed as needed, and provided items are directly used; for materials rich in discrete patterns (such as wallpaper, complex carpet patterns, etc., which are mainly discrete, manually designed patterns and difficult to express purely with procedural noise), the enhancer additionally calls an image generation model to generate a tiling raster texture map, and then the procedural shader graph continues to model other appearance factors (such as roughness, metallicity, displacement, optical response) based on this texture map to form a hybrid material representation. After reading the unified specifications, the designer generates an initial shader graph program expressed in a structured material description language. This structured material description language is a compact description language specifically designed for describing shader graphs. Unlike general-purpose programming scripts (such as Blender Python), it only contains compact constructs that declare node attributes and connections. The program is then parsed into a typed memory graph G=(V, E, Θ), where V is the set of shader nodes, E is the set of directed links, and Θ is the set of adjustable point parameters. This intermediate representation explicitly stores three types of entity objects: shader nodes, links, and parameters, enabling subsequent deterministic verification, automatic discovery of adjustable parameters by the inspector, and local graph repair by the repairer. This typed memory graph, as a white-box, operable intermediate representation, not only carries the material's topology and numerical state but also provides a structured data foundation for subsequent modules, thus avoiding the parsing difficulties and context overhead problems caused by directly processing unstructured code.
[0045] Step S200: Perform executable verification on the typed memory graph. If the verification fails, perform local patch repair on the typed memory graph based on the error diagnosis information until the verification passes.
[0046] Specifically, executability verification is divided into two phases. The first phase is deterministic verification, performed directly on the typed memory graph. It checks for syntax validity, duplicate node identifiers, broken link endpoints (links pointing to non-existent nodes or sockets), and dangling nodes (isolated nodes without outgoing edges and contributing nothing to the final material). This phase catches structural errors before the graph is converted into rendering engine code, limiting the model's responsibility to semantic-level graph construction. The second phase is runtime verification. It emits the graph from the first phase into rendering engine executable code and actually executes it within the rendering engine. "Execution without exceptions" serves as the pass signal, checking rendering engine-specific constraints (such as socket type compatibility and valid node combinations). The execution process uses an exception handling mechanism to wrap each node creation and link creation operation, and aggregates all failures into a unified diagnostic report. If there are no errors in either phase, the process is considered passable, proceeding to step S300; if errors exist, the repair process begins. During repair, instead of regenerating the entire graph, the original program along with the diagnostic report is sent to the repairer. The repairer locates the minimum set of damaged nodes, generates replacement descriptive fragments, and applies patches to the memory graph instance: erroneous nodes are removed from the graph, the replacement fragments are parsed, the repaired subgraph is merged into the existing graph, and bridge connections that remain valid after repair are automatically restored. After repair, the process returns to re-verify until it passes. It should be understood that this repair is triggered by a "correctness verification failure," aiming to solve the problem of whether the program "can run." This is fundamentally different from the subsequent structural rewriting triggered by appearance evaluation; the former focuses on restoring syntactic and runtime compliance, while the latter focuses on the evolution of visual semantics.
[0047] Step S300: After verification, perform inner loop parameter tuning: apply perturbation to the parameters in the typed memory graph to generate candidate parameters, evaluate the rendering results of the candidate parameters based on the lightweight material evaluation model, update the parameters according to the evaluation results, and obtain the tuned material description program.
[0048] Specifically, the inner loop parameter tuning is a numerical optimization process performed under the premise of a fixed graph topology. The inspector reads the reference graph, the currently untuned render, and the structured material description language text, selecting at most K (default K=5) subsets of key appearance parameters from all adjustable parameters for optimization, thus narrowing the search space to those parameters most likely causing the current appearance mismatch. Subsequently, typed perturbation kernels are repeatedly applied to this subset to generate candidate parameters. A material scorer quickly scores and ranks each candidate's three-view render (including tiled planar view, bright sphere view, and dark sphere view). Improved parameters are accepted, while deteriorating candidates are accepted with a probability p_accept=0.05 to escape shallow local optima; historical optimal parameter settings are maintained independently throughout the process. A total of K_in steps (default 50 steps) are executed, outputting the optimal parameters for this round. This stage only changes the parameter values without altering the graph's connectivity. Through intensive numerical search, the material appearance approximates the reference target locally, solving the problem of insufficient accuracy in directly predicting continuous parameters in large models.
[0049] Step S400, execute outer loop structure rewriting: evaluate the rendering results before and after optimization based on the semantic evaluation model. If the evaluation result does not meet the preset conditions, generate feedback information and trigger the rewriting of the topology of the typed memory graph. Return to the step of generating the initial material description program until the preset conditions are met or the preset iteration limit is reached, and output the target procedural material.
[0050] Specifically, the evaluator scores the unoptimized and optimized render sets relative to the reference image in this round, and provides free text feedback to the higher-scoring set, retaining it as the result for this round. If the highest score in this round exceeds the preset pass threshold (default τ_pass=0.8), the process terminates and returns to the selected material. Otherwise, the feedback is sent back to the designer, triggering a structural rewrite of the entire shader graph (returning to step S100) and entering the next round of the outer loop. The outer loop executes a maximum of K_out rounds (default 3 rounds); if it still fails to pass after reaching the upper limit, it returns to the historical best result. It should be noted that the trigger condition for the outer loop is "semantic evaluation not meeting the standard," which forms a clear functional hierarchy with the local repair triggered by "verification failure" in step S200: local repair is responsible for the minimum executability, while structural rewrite is responsible for the upper limit of visual fidelity. The two work together, enabling the system to quickly correct low-level errors and autonomously explore new solutions when encountering structural bottlenecks.
[0051] Through the above steps, this embodiment transforms programmatic material generation from a single prediction into a self-evolving closed-loop process. The key design of this closed loop lies in separating "local appearance search" from "semantic-level structural revision"—the inner loop uses a fast material scorer to perform extensive parameter-level numerical searches, while the outer loop uses a judge to perform a small amount of high-level semantic judgment and structural rewriting; simultaneously, "correctness repair" from "appearance evolution"—the repairer only performs minimal edits to restore executability, while the judge-driven rewriting reconstructs the graph topology when the material mechanism itself is flawed. The typed memory graph, as a unified data foundation, supports seamless integration of verification, repair, and dual-loop optimization, significantly improving appearance fidelity and generation success rate while ensuring the executable nature of the generated results.
[0052] Example 2 In this embodiment, the executability verification process for the typed memory graph is further refined into two progressive stages to ensure that the material description program entering the subsequent tuning process has definite executability. The motivation for setting up two-stage verification is that the runtime behavior of the rendering engine is relatively "lenient" and can mask errors in the graph.
[0053] Specifically, two typical problems exist: First, duplicate node identifiers are silently renamed by the rendering engine by automatically adding suffixes (e.g., ".001"), which is not visible at the structured material description language level, causing subsequent links to potentially point to the wrong nodes. Second, dangling nodes without outgoing edges and that do not contribute to the final material are still allowed to remain in the graph, misleading the model into believing they participate in the final output. Therefore, relying solely on runtime execution is insufficient to fully detect structural defects; a static check phase must be added before execution.
[0054] Specifically, the first stage of verification involves static checks of syntax and topology performed directly on the typed memory graph. The goal of this stage is to quickly intercept deterministic structural errors without relying on an external rendering engine. The system checks for syntax validity, duplicate node identifiers, broken endpoints (links pointing to non-existent nodes or sockets), and topological validity issues such as dangling nodes. By pre-emptively eliminating these structural defects at the memory graph level, obviously illegal code is avoided from being passed to the rendering engine, limiting the model's responsibility to semantic-level graph construction and significantly reducing unnecessary computational overhead. It should be understood that the specific items checked in the static check can be expanded or tailored according to the characteristics of the target rendering engine, as long as it can identify topological integrity issues in the graph without executing code.
[0055] In response to the static check passing, the system enters the second stage of verification, which involves converting the typed memory graph into the target rendering engine's executable code and running it. The pass signal is the absence of any abnormal execution, and the abnormal information during the execution process is aggregated into error diagnosis information.
[0056] Specifically, rendering engines often have many implicit constraints that cannot be known through static analysis, such as specific socket type compatibility rules and restrictions on the legality of node combinations. Therefore, verification must be performed through actual operation. In this stage, the system emits the memory graph as script code executable in the target rendering engine and uses an exception handling mechanism to wrap the creation and linking operations of each node. When any exception occurs during execution, the system does not immediately terminate or only report a single error; instead, it aggregates all captured exception information into a unified error diagnosis message. The advantage of this aggregation mechanism is that it provides a complete error context for subsequent repair modules, allowing the repair modules to locate and resolve multiple related problems at once, avoiding the inefficient loop of "fixing one error and then re-running to find the next error" in traditional methods. Only when there are no exceptions in both stages of verification is the typed memory graph considered verified and then enters the inner loop parameter tuning stage.
[0057] When verification fails, this embodiment adopts a strategy of partially patching the typed memory graph based on error diagnosis information, rather than discarding the entire graph and regenerating it.
[0058] Specifically, the repair process first locates the set of minimally damaged nodes in the typed memory graph based on error diagnosis information. Here, the "set of minimally damaged nodes" refers to the directly related nodes that caused the verification failure and their necessary dependencies, excluding other functional and unaffected parts of the graph. By precisely defining the scope of the damage, the system can preserve as many correct parts of the original design as possible, which is crucial for maintaining the continuity of the generation process and the design intent.
[0059] After locating the smallest set of damaged nodes, the system generates an alternative description fragment for that set. Specifically, this alternative description fragment is a compact code block written in a structured material description language, covering only the damaged parts. The generation model infers the correct node configuration or connection method based on the specific error type and context in the error diagnosis information and outputs the corresponding description fragment. Subsequently, the system parses the alternative description fragment into a repair subgraph and merges the repair subgraph into the typed memory graph, while automatically restoring the bridging connections that remain valid after repair. Here, "bridging connections" refer to links that connect to damaged nodes at one end and undamaged nodes at the other. In traditional whole-graph regeneration schemes, these connections are often lost when the old graph is discarded, requiring the newly generated graph to rebuild all connections, which not only increases the generation difficulty but also easily introduces new errors. In the local patch repair mechanism of this application, when removing damaged nodes and merging the repair subgraph, the system automatically detects and reattaches these still valid bridging connections, thus achieving seamless graph repair. Figure 1 As shown in the Execution & Repair section, this repair mechanism forms a correctness guarantee sub-loop independent of appearance optimization. By adopting patch-based repair instead of full graph regeneration, this application not only significantly reduces the context token consumption required for each repair, but more importantly, it preserves the unbroken design logic in the original shader graph. This allows the system to gradually approach an executable state based on accumulated results, significantly improving generation efficiency and success rate. It should be noted that the local patch repair path in this embodiment is only reserved for correctness errors, such as syntax errors, illegal links, runtime errors, etc. Appearance-level failures (cases identified by the evaluator where the graph can be executed but the visual effect is incorrect) do not go through the repairer, but are handled by the designer through full graph structured material description language rewriting (see the outer loop structure rewriting in embodiment 4 for details). This design decouples "correctness repair" from "appearance evolution": the repairer only makes minimal edits to restore executable correctness; while the evaluator-driven revision can reconsider the topology of the entire graph when the material mechanism itself is incorrect.
[0060] Example 3 In this embodiment, the specific implementation method of inner loop parameter tuning is described in detail. As one implementation method, the process of performing inner loop parameter tuning includes: selecting a subset of key parameters from the parameters of the typed memory graph; applying typed perturbations to the subset of key parameters to generate candidate parameters; scoring the rendering results of the candidate parameters based on the lightweight material evaluation model, accepting or rejecting candidate parameters according to the changes in scores, and maintaining the historical optimal parameter settings.
[0061] Specifically, inner loop parameter tuning is a numerical optimization process performed on a continuous parameter space while keeping the topology of the typed memory graph fixed. Unlike the outer loop, which focuses on the semantic correctness of the graph structure, the inner loop focuses on finding the optimal parameter configuration under a given shader mechanism to make the rendered appearance approximate the reference target. Since the number of parameters in the procedural material node graph can be large and coupled, blindly searching the entire space for all parameters would not only result in extremely slow convergence but also easily get bogged down in noise interference from irrelevant dimensions. Therefore, this embodiment first uses a parameter selection mechanism (e.g., executed by the inspector module) to determine a subset of key parameters. This mechanism comprehensively analyzes reference information, the current untuned rendering results, and the textual semantics of the structured material description language to identify those parameters that contribute the most to the current appearance mismatch (such as noise node parameters controlling texture scale, roughness parameters controlling surface gloss, etc.), thereby dynamically shrinking the search space to the dimension with the greatest optimization potential. This selective tuning strategy significantly improves search efficiency, enabling rapid improvement of material appearance within a limited number of iterations.
[0062] After identifying the subset of key parameters to be optimized, the system applies typed perturbations to generate candidate parameters. This "typed perturbation" is a key feature that distinguishes this application from general black-box optimization algorithms. Because procedural material parameters have clear physical meanings and data types, using a uniform linear perturbation strategy often does not conform to the distribution patterns of material properties. For example, for scalar parameters controlling texture density, their effective value range may span several orders of magnitude. Fixed-step perturbations in linear space can lead to insignificant changes in large numerical regions and excessive changes in small numerical regions. Therefore, this application designs differentiated perturbation kernels for parameters of different data types, making parameter search more consistent with physical intuition and rendering rules.
[0063] Specifically, applying band-type perturbations to a subset of key parameters includes the following strategies. The first strategy, for scalar parameters, involves a scaling perturbation in logarithmic space such that the up and down shifts are symmetrical in logarithmic space. For a given scalar parameter value… Its new value after perturbation Through formula The calculation yielded, where It follows a uniform distribution random variables, The hyperparameter used to control the disturbance amplitude is set to a default value. Therefore, the effective scaling factor roughly covers [0.1x, 10x], with equal probabilities on both sides. This logarithmic uniform scaling ensures that the relative rate of change of the parameter is controlled and symmetrical regardless of its current order of magnitude. When the absolute value of the parameter is close to zero (e.g., ...), When the logarithmic space perturbation is numerically unstable, it degenerates into an additive perturbation. ,in obey For tuple scalars (such as 3D vectors), all components are jointly perturbed using the same strategy to maintain perturbation consistency. The second strategy targets color parameters, independently resampling hue, saturation, and lightness within a preset perturbation radius of their current values in the HSV color space, and then cropping them to the [0, 1] interval. The hue perturbation radius is set to a default value. The saturation and brightness perturbation radii are set to 0 by default. Transparency is not affected by the perturbation. Compared to the RGB color space, the HSV color space decouples the hue and brightness attributes of a color, making color adjustments more consistent with human visual perception. The third strategy targets Boolean parameters, performing state flips according to preset probabilities, with a default flip probability of 0. Since Boolean parameters represent discrete on / off states (such as whether anisotropy is enabled, whether normals are inverted, etc.), continuous numerical interpolation is not possible; different state combinations can only be explored through probability flipping. Furthermore, all generated candidate parameters are pruned to the valid value range of the corresponding node before rendering to prevent rendering anomalies or undefined behavior caused by parameter out-of-bounds errors, ensuring the stability of the high-frequency iteration of the inner loop.
[0064] like Figure 3 The diagram illustrates the process of inner loop parameter tuning. During tuning, a lightweight material evaluation model quickly scores the rendering results of each candidate parameter. This model is specially trained to provide ranking signals aligned with human preferences with inference latency far lower than that of large semantic models, thus supporting the high-frequency evaluation needs of hundreds or even thousands of times in the inner loop. Based on the score changes, the system adopts a random hill-climbing strategy to decide whether to accept or reject candidate parameters: if the score of a candidate parameter is higher than the current state, it is accepted unconditionally; if the score of a candidate parameter is lower than the current state, the system still accepts the worse solution with a small probability (e.g., 5%). This "accepting worse solutions" strategy is not an algorithmic defect, but rather to give the search process the ability to escape shallow local optima and avoid premature convergence to suboptimal solutions. At the same time, the system independently maintains a historical set of optimal parameter settings throughout the tuning process, ensuring that the final output is always the best result observed in the search trajectory. Regarding the construction of the material scorer, the inner loop search requires a fast appearance evaluator that can rank hundreds of rendering candidates in each tuning. To this end, this application trains a material scorer to approximate human preferences for candidate materials. The material scorer takes as input a bounded reference map region and a three-view rendering set of candidate materials (including a tiled planar view, a bright sphere view, and a dark sphere view), and outputs a scalar compatibility score.
[0065] Specifically, the scorer first receives a reference image with bounding box coordinates (normalized to a preset grid) according to the localization format, then receives the three-view renderings of the candidates, and finally directly uses the native scalar correlation output of the reorderer as the compatibility score. Regarding the base model and fine-tuning method, the scorer uses a visual language reordering model as the base (e.g., an 8 billion-parameter visual language reordering model) and fine-tunes it using a low-rank adaptation method. The low-rank adaptation has a rank r=8 and a scaling factor α=32, applied to all linear layers of the language backbone; the visual encoder is frozen and does not participate in training. Training uses a hybrid precision and attention acceleration technique, with each training reference paired with one positive sample and three negative samples. The training objective uses a list-based softmax cross-entropy loss: candidates for the same reference are organized into a list, where positive samples are the preferred samples for that reference, and negative samples are the contrast samples. The loss function ensures that positive samples receive a higher compatibility score relative to all negative samples. Training employs a two-stage curriculum, first establishing coarse-grained discrimination capability, and then specializing in fine-grained discrimination. Figure 4 The diagram illustrates the construction process of the material scorer training data. The first stage (synthesizing a proxy preference list and establishing coarse-grained inter-class distinctions): A large-scale proxy preference list is constructed on a unified library of approximately 13,800 materials through cross-modal retrieval. The construction method is as follows: For each part of a multi-part object, a visual language model is used to generate a text description of the target region. This description is embedded into a multimodal representation space (embedding dimension D=3072) and matched against the standard rendering embeddings of each material in the library. The nearest match is assigned to the part, and the object is rendered in a random scene to form a reference map. Positive proxy samples are sampled from the L nearest neighbors (L=10) of the anchor point's embeddings, while negative samples are randomly and uniformly drawn from the entire library. This results in a low-cost training list of 57,826 items and a validation list of 6,586 items. The extensive library coverage exposes the scorer to a large number of material categories, facilitating generalization to open reference maps and adapting to standard rendering formats and activating bounding box localization. This stage involves one training epoch with a learning rate of 1×10⁻¹⁰. -4The second stage (manually compiling a list of hard negative samples for fine-grained differentiation): To provide hard negative samples with direct human supervision, references are rendered on the rendering engine primitives (cubes, spheres, tori, etc.) in several random scenes, intentionally decoupled from object semantics to cover long-tail materials (such as the surface of the sun, ice). Each candidate list is generated by applying the same typed perturbation kernel to the anchor material parameters as the inner loop—small perturbations yield positive samples, and large perturbations yield negative samples. Therefore, candidates must be distinguished by physical effects (such as glossiness, translucency) rather than categories. The generated list is manually reviewed, discarding samples with ambiguous order or those that are perceptually difficult to distinguish. Manual annotation follows a four-step principle: First, verify the reference image's regularity (target object visible and appropriate lighting); second, verify whether positive samples can reasonably represent the same material as the reference, intentionally retaining positive samples that are not pixel-wise consistent as perturbation-based data augmentation; third, for each positive-negative sample pair, verify whether humans can confidently judge that the positive sample is visually closer to the reference than the negative sample, discarding pairs that cannot be clearly distinguished; fourth, automatically remove nearly duplicate negative samples to prevent redundancy. This stage contributes 1007 training lists and 248 evaluation lists, continuing training from the checkpoint of the first stage, with the learning rate reduced to 5×10. -6 The final deployment checkpoints are selected based on the minimum cross-entropy on the reserved manually curated evaluation set. In terms of inference efficiency, scoring only requires one forward propagation for each candidate, without decoding. On a single graphics processing unit, the scorer runs at approximately 4.4 candidates per second (median latency 203 milliseconds), sufficient to support the high-frequency evaluation requirements of the inner loop. Actual tuning time is primarily driven by candidate rendering; therefore, the scorer is fast enough to handle the sorting signal in the inner loop for random parameter searching. It should be understood that inner loop parameter tuning only changes the values of parameters in the typed memory graph, without altering the connections between nodes or the graph's topology. This fine-grained numerical search and the semantic rewriting at the structural level in the outer loop complement each other, forming an indispensable optimization hierarchy in the self-evolving closed loop.
[0066] Example 4 In this embodiment, the specific implementation method of rewriting the outer loop structure and the evaluation system supporting this process are described in detail. As one implementation method, performing the outer loop structure rewriting includes: based on a semantic evaluation model, comparing and evaluating the unoptimized rendering result and the optimized rendering result of the current round with reference information to obtain corresponding scores; retaining the rendering result with the higher score as the output of the current round; if the score of the rendering result with the higher score does not reach the preset passing threshold, generating feedback information in the form of free text and sending the feedback information back to trigger a structural-level rewriting of the topology of the typed memory graph.
[0067] Specifically, the outer loop structure rewriting is the core link responsible for semantic-level evolution in the self-evolutionary closed loop of this application. It differs fundamentally from the inner loop parameter tuning described in Example 3 in terms of optimization objects, driving models, and triggering conditions. The inner loop only adjusts continuous parameters under a fixed graph topology, driven by a lightweight material evaluation model for high-frequency numerical search; while the outer loop targets the node connection relationships and shader mechanisms of the graph itself, driven by a semantic evaluation model (e.g., a visual language model) with stronger semantic understanding and reasoning capabilities for low-frequency structural reconstruction. During the evaluation process, the system simultaneously obtains the untuned rendering result before entering the inner loop in the current round and the tuned rendering result after the inner loop ends, and compares and scores them with reference information. This dual-result comparison mechanism reflects the optimization strategy in the self-evolutionary process: if the tuned appearance deteriorates due to getting stuck in local optima or parameter overfitting, the system can still retain the untuned version as the benchmark for this round to prevent degradation of the generated quality. Only when the higher of the two scores still fails to reach the preset pass threshold (e.g., default τ_pass=0.8) is it determined that the current graph structure itself cannot meet the expression requirements of the target material (e.g., missing subsurface scattering nodes or selecting the wrong blending mode). At this time, the semantic evaluation model will generate feedback information in the form of free text containing specific modification suggestions. This feedback information is different from abstract scalar scores; it can describe the specific defects of the current material in physical mechanism or visual style in natural language and transmit it back to the generation module as a contextual guide for the next round of regenerating the initial material description program, thereby realizing the targeted rewriting of the typed memory graph topology. It should be understood that the preset pass threshold can be dynamically configured according to the requirements of the generation quality in the actual application scenario, and the structural rewriting is a reconstruction of the overall or large-scale topology of the graph. This forms a functional layer with the partial patch repair for syntax or runtime errors in Example 2. The former solves the problem of "whether it looks like the target material" and the latter solves the problem of "whether it can run".
[0068] To support the accurate evaluation of the aforementioned semantic evaluation model, this application constructs a standardized rendering evaluation system. As one implementation method, the rendering results are obtained by constructing a standard rendering set, which includes: a tiled planar view for evaluating the texture details and granular characteristics of materials; a bright sphere view for evaluating the color, basic albedo, and overall surface characteristics of materials; and a dark sphere view for evaluating the specular highlights, reflectivity, roughness, and emissivity of materials.
[0069] Specifically, this multi-view design aims to solve the "lighting-material entanglement" problem prevalent in the field of 3D material generation. In real-world reference images, the intrinsic properties of materials are often tightly coupled with external factors such as ambient lighting, shadows, and reflections. A rendering from a single viewpoint or under a single lighting condition cannot comprehensively and accurately reflect all the optical properties of a material. Therefore, this application decouples the complex material evaluation task into multiple independent observation dimensions by constructing a controlled standard rendering set. The tiling planar view, by attaching the material to the plane facing the camera and using uniform lighting, eliminates the interference of curvature and complex lighting, allowing the evaluation model to focus on observing the repetitive patterns, graininess, and microscopic details of the texture. The bright sphere view renders the sphere under standard white light, primarily used to capture the material's base color (Albedo), diffuse intensity, and overall surface texture, serving as a key basis for determining whether the material category matches. The dark sphere view illuminates the same sphere against a dark background with strong directional lighting, suppressing diffuse components to highlight optical features easily masked under normal lighting, such as specular highlights, Fresnel reflection, roughness response, and self-emission. These three views together constitute an orthogonal observation space, enabling the semantic evaluation model to independently and accurately evaluate the various physical properties of the material while eliminating lighting confusion. It should be understood that although this embodiment lists three standard views, in other embodiments, the standard rendering set can be extended according to the specific type of the target material. For example, a transmission view can be added for transparent or refractive materials, and a multi-angle rotation view can be added for anisotropic materials. As long as it can decouple the influence of material properties and the external environment through controlled rendering conditions, it falls within the protection scope of this application.
[0070] Through the collaborative work of the aforementioned outer loop structure rewriting mechanism and standard rendering evaluation system, this embodiment achieves a leap from numerical optimization to semantic evolution. The inner loop rapidly approximates the optimal solution within the local parameter space, providing the outer loop with a finely tuned candidate baseline. The outer loop, on the other hand, operates at a higher semantic level, rigorously examining this baseline using a multi-dimensional standard rendering set, and driving graph topology reconstruction through free text feedback when structural bottlenecks are discovered. This layered and progressive optimization strategy avoids placing all optimization pressure on expensive large models and overcomes the limitation that simple numerical search cannot correct underlying mechanism errors, ensuring that the final generated procedural materials are not only accurate in parameters but also highly faithful to the reference target in terms of physical structure and visual semantics.
[0071] Example 5 In this embodiment, the construction and input unification strategy of the structured material description language are described in detail. As one implementation, the structured material description language includes: a node block, which begins with a node identifier and node type, followed by an attribute line for setting node attributes and an input line for setting default values for input sockets; and a link line, used to declare directed data flow connections from the output socket of a source node to the input socket of a target node.
[0072] Specifically, this structured material description language is designed as a declarative and compact description language. Its syntax only includes the two basic constructs mentioned above, aiming to describe the topology and parameter states of shader graphs in a compact and typed manner. Specifically, a node block begins with a header line formatted as "node" followed by the node identifier and node type; this is followed by several attribute lines (formatted as "prop" followed by key-value pairs, used to set node attributes such as operating mode) and input lines (formatted as "in" followed by the name and default value, used to set the default value for an input socket). Link lines are formatted as "link" followed by the source node output socket, an arrow symbol, and the target node input socket, indicating a directed data flow connection. To further constrain generation and suppress model illusions about interfaces (i.e., fabricating non-existent socket names or default values), a curated node signature reference is included in each generation and repair hint, listing the 52 supported core shader node types and their typed input / output sockets and dynamic rules (e.g., a math node conditionally adds or removes sockets under specific operation modes). Node blocks define a unique identifier and type in the header, followed by attribute and input lines that configure the node's static configuration items and dynamic input values, respectively. This block structure allows the parser to deterministically construct node objects line by line without maintaining a complex global symbol table or performing control flow analysis. Link lines employ an intuitive source-to-target mapping syntax, explicitly declaring the data flow direction and avoiding the nested function calls or callback hell common in general programming languages. This allows the connectivity of the graph structure to be statically extracted and verified. It should be understood that although this embodiment describes a specific text format, in other embodiments, as long as the language can be deterministically parsed into a typed memory graph containing nodes, connections, and parameters, and supports subsequent static verification and local repair operations, its specific keywords, delimiters, or line formats can be equivalently replaced without departing from the scope of this application.
[0073] Based on the aforementioned structured material description language, the system parses it into a typed memory graph containing nodes, connections, and parameters.
[0074] Specifically, this parsing process is not a simple text reading, but rather instantiates the declarative text into an in-memory object graph structure. Each node block is mapped to a node object carrying type information, each link line is mapped to a directed edge object connecting two node objects, and attribute lines and numerical or enumerated values in the input lines are bound to adjustable parameters of the node objects. This explicit typed in-memory graph serves as the unified data foundation for the entire self-evolutionary closed loop, allowing subsequent verification modules to directly traverse the graph structure to check topological validity, repair modules to accurately locate and replace damaged subgraph objects, and tuning modules to automatically discover and modify exposed parameter objects through reflection, without repeatedly performing regular expression matching or recompiling the original text. An intuitive baseline approach is to have the visual language model directly output the rendering engine's native scripting language (such as Blender Python or other general-purpose scripts), as native scripts are the native interface of the rendering engine's shader system. However, free-form native scripts are unsuitable as a representation for agent-based material generation for four reasons: First, they lack structured operation handles; free scripts provide almost no structured entry points for checking parameters, verifying graph topology, or applying local repairs. Second, they are difficult to constrain to legal operations; as general-purpose scripting languages, native scripts allow arbitrary control flow, side effects, and dependent version application interface calls, making static validation difficult and constraining the model's output space within the range of legal shader graph operations. Third, the lexicon is verbose; the boilerplate code of native scripts significantly increases lexicon overhead, especially when the graph needs to be repeatedly back-passed to the model in multiple revisions. Fourth, the application interface is volatile; the application interface of native scripts frequently changes between different versions, making direct generation prone to errors. In contrast, using the structured material description language of this application as the operable interface has significant technical advantages. This description language strictly constrains the generation space within the range of legal shader graph operations and naturally supports deterministic validation. In terms of efficiency, actual tests show that the average length of a structured material description language program is 1 / 19.0 of an equivalent native script with exception handling and error reporting (i.e., about 19 times shorter than the native script). This significantly reduces the context and feedback lexical overhead in downstream calls. Furthermore, the typed memory graph provides a standardized graph editing interface, making minimal patch repair possible, while the native script lacks structured operation handles, making local repairs extremely difficult. It is important to emphasize that this application positions the structured material description language as an "operable interface," rather than a completely new material representation or a replacement for existing representations. It exposes shader graphs in a compact, typed, executable, and inspectable form, enabling agents to verify, edit, and repair graphs within a closed loop.
[0075] In the stage of acquiring reference information for the target material, this application also designs a unified input strategy to address the diversity and incompleteness of user input. As one implementation method, acquiring reference information for the target material includes: calling a generative model to complete missing input modalities, generating tilable texture maps for materials rich in discrete patterns, and combining the tilable texture maps with a structured material description language to form a hybrid material representation.
[0076] Specifically, when a user provides only textual prompts without visual references, the system calls an image generation model to synthesize a reference image that can instantiate the textual description, thus providing a visual anchor for downstream semantic evaluation. When a user provides only an image without textual descriptions or region specifications, the system performs content understanding and target localization on the image, automatically generating detailed material description text and bounding box coordinates to eliminate ambiguity in multi-material scenarios. In particular, for materials containing complex artificial motifs or high-frequency discrete patterns (such as wallpaper patterns, carpet patterns, logo prints, etc.), relying solely on procedural noise or mathematical functions often fails to accurately reproduce their details, and forced encoding leads to extreme expansion and uneditability of the node graph. To address this, this embodiment introduces a hybrid material representation mechanism: after the system identifies such material features, it generates or retrieves an additional tiling raster texture map as the base pattern layer. Subsequently, the procedural node graph constructed using a structured material description language is only responsible for superimposing physical and optical properties such as roughness variation, metallic response, normal concavity / convexity, and transmissive gloss onto this texture map. This hybrid representation strategy of "procedural graph + tiled texture graph" retains the editability advantages of procedural materials in terms of lighting response, parameter adjustment and resolution independence, while taking advantage of the efficiency of raster textures in expressing high-frequency visual details. It effectively solves the limitations of a single representation method in dealing with complex real-world materials and expands the applicability of the technical solution of this application to diverse material generation tasks.
[0077] Example 6 like Figure 1 As shown, this embodiment provides a programmatic material generation system. This system employs a modular architecture to achieve a self-evolving closed-loop material generation process. Specifically, the system includes a generation and parsing module, a verification and repair module, an inner loop optimization module, and an outer loop rewriting module.
[0078] The generation and parsing module is used to obtain reference information of the target material, generate an initial material description program based on the structured material description language, and parse the initial material description program into a typed memory graph, which includes nodes, connections and parameters.
[0079] Specifically, this module serves as the system's data entry point and foundation. It normalizes heterogeneous reference information (such as text, images, or mixed inputs) provided by users into a unified specification and uses a generative model to produce an initial program that conforms to the structured material description language specification. Subsequently, this module instantiates the text-based program into an in-memory object graph structure—a typed in-memory graph—using a deterministic parser. This explicit typed representation not only carries the material's topology and numerical state but also provides a standardized operation interface for downstream modules. This allows subsequent verification, repair, and optimization to be performed on structured data, avoiding the overhead and uncertainty of repeatedly parsing unstructured text. It should be understood that this module can also integrate enhancer functionality to automatically complete missing input modalities or generate tiling texture maps for materials rich in discrete patterns to form hybrid material representations, thereby expanding the system's applicability.
[0080] The verification and repair module is used to perform executable verification on the typed memory graph. If the verification fails, the typed memory graph is patched and repaired based on the error diagnosis information until the verification passes.
[0081] Specifically, this module acts as a gatekeeper for system correctness, ensuring that material description programs flowing into subsequent optimization stages have deterministic executability in the target rendering engine. Internally, it includes two-stage verification logic: first, static checks of syntax and topology are performed at the memory graph level to intercept structural errors; second, the graph that passes the static check is converted into executable code for the target rendering engine and run, aggregating runtime exceptions into unified error diagnosis information. When an error is detected, this module does not discard the entire graph, but instead locates the set of smallest damaged nodes, generates alternative description fragments and merges them into the original graph, while automatically restoring bridge connections where endpoints remain valid. This local patching repair mechanism preserves the original design intent to the greatest extent and reduces the context consumption of the repair process. It is important to emphasize that this module only focuses on the correctness and legality of the program and does not involve judging the appearance quality, thus forming a clear functional separation from the tuning module responsible for appearance optimization.
[0082] The inner loop tuning module is used to perform inner loop parameter tuning after verification: it applies perturbation to the parameters in the typed memory graph to generate candidate parameters, evaluates the rendering results of the candidate parameters based on the lightweight material evaluation model, updates the parameters according to the evaluation results, and obtains the tuned material description program.
[0083] Specifically, this module is the system's numerical optimization engine, focusing on finding the optimal parameter configuration within a fixed graph topology. It receives a valid, typed memory graph from the verification and repair module, selects a subset of key parameters, applies typed perturbations (such as logarithmic space scaling, HSV color perturbations, etc.), and uses a lightweight material evaluation model to quickly score the rendering results for each candidate parameter. Due to the low latency of this evaluation model, it can support hundreds of high-frequency iterations in the inner loop, enabling the system to quickly approach the local optimum appearance within a limited time. Throughout the tuning process, this module only modifies the parameter values without altering the connections between nodes, thus ensuring the stability and controllability of the optimization process. After tuning, this module passes the material description program carrying the optimal parameters to the outer loop rewriting module for higher-level review.
[0084] The outer loop rewrite module is used to rewrite the outer loop structure: it evaluates the rendering results before and after optimization based on the semantic evaluation model. If the evaluation result does not meet the preset conditions, it generates feedback information and triggers the rewriting of the topology of the typed memory graph. It then returns to execute the operation of generating the initial material description program until the preset conditions are met or the preset iteration limit is reached, and outputs the target procedural material.
[0085] Specifically, this module acts as the system's semantic evolution controller, responsible for addressing structural defects that the inner loop cannot handle. It utilizes a semantic evaluation model with strong semantic understanding capabilities (such as a visual language model) to compare and evaluate the rendering results before and after inner loop optimization with reference information. If the highest score does not reach the preset passing threshold, it indicates a mechanistic deviation in the current graph structure. This module then generates free-text feedback information containing specific modification suggestions and sends it back to the generation and parsing module, triggering a structural-level rewrite of the entire typed memory graph topology. This cross-module feedback loop forms the core of the self-evolutionary closed loop, enabling the system to autonomously explore new structural solution spaces when parameter optimization reaches a bottleneck. It should be understood that outer loop rewriting reconstructs the overall or large-scale topology of the graph, fundamentally different from local patch repair in the verification and repair module in terms of triggering conditions and operational granularity. The two work together to ensure the bottom line of correctness and the upper limit of appearance quality in the generation process, respectively.
[0086] From the perspective of data flow in the system architecture, the typed memory graph, as the core data carrier, is transmitted unidirectionally between the verification and repair module and the inner loop optimization module, ensuring that only valid graphs can enter the numerical optimization stage. Feedback information forms a reverse feedback path between the outer loop rewriting module and the generation and parsing module, driving the structural evolution of the system. This modular, decoupled design not only allows each component to be upgraded and replaced independently (e.g., by replacing it with a more advanced semantic evaluation model or adopting different optimization algorithms), but also facilitates the deployment of the system in various forms. For example, the system can run as a standalone desktop software product, be packaged as a cloud service for remote invocation, or be integrated as a plugin into existing 3D content creation toolchains. As long as it contains the above four core modules and their interaction logic, it falls within the protection scope of this application. Through the above modular architecture, this embodiment decomposes the complex procedural material generation task into subsystems with clearly defined functions and interfaces, ensuring both the feasibility of the technical solution and providing solid support for intellectual property protection on the product side.
[0087] Example 7 This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the method for generating programmed materials as described in any of the foregoing embodiments.
[0088] Specifically, the computer device is the physical entity that carries and runs the technical solution of this application. The processor can be a central processing unit, a graphics processing unit, a digital signal processor, a field-programmable gate array (FPGA), or other application-specific integrated circuits (ASICs), or a combination of such processors. Considering that this application involves a large number of rendering operations and model inference tasks, in a preferred embodiment, the processor includes at least one graphics processing unit, utilizing its parallel computing capabilities to accelerate the batch rendering of candidate parameters and the scoring calculation of lightweight material evaluation models during the inner loop parameter tuning process, thereby shortening the time consumed per iteration. The memory can include high-speed random access memory and non-volatile memory, such as one or more disk storage devices, flash memory devices, or other solid-state storage devices. The computer program stored in the memory contains instruction code that implements logic such as generation and parsing, verification and repair, inner loop tuning, and outer loop rewriting. When the processor reads and executes these instructions from the memory, it constructs the self-evolving closed-loop system described in the foregoing embodiments at the hardware level, transforming the abstract method flow into concrete machine behavior.
[0089] It should be understood that the specific product form of this computer device is not limited to a single type. For example, it can be a local high-performance graphics workstation for professionals to directly access in 3D content creation tools; it can also be a server cluster deployed in a cloud data center, providing material generation services to remote terminals via a network interface; or it can be a plug-in host environment embedded in existing 3D engines or design software. Regardless of the deployment form, as long as it is internally configured with a processor and memory combination capable of executing the methods of this application, it falls under the object of protection of this application.
[0090] Furthermore, this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for generating programmed materials described in any of the foregoing embodiments. The computer-readable storage medium may be a tangible, non-transient medium, including but not limited to a USB flash drive, portable hard drive, read-only optical disc, magnetic tape, or cloud storage object.
[0091] Example 8 To more clearly illustrate the feasibility and superiority of the technical solution of this application in practical applications, this embodiment provides a comprehensive application scenario and verifies the effectiveness of the technical features described in the foregoing embodiments by combining comparative experiments and ablation tests. It should be understood that the following examples are only used to explain the technical concept of this application and are not intended to limit the scope of protection of this application.
[0092] As an example implementation scenario, the method of this application can be used for the automatic generation of translucent jade materials. This material possesses multiple optical properties: it includes microscopic texture details on the surface, relies on internal subsurface scattering effects to present a warm, smooth feel, and exhibits non-uniform, procedural color variations. Such materials are difficult to fully represent using simple fixed-channel texture maps; however, editable, high-fidelity rendering can be achieved using a procedural node graph that includes subsurface scattering nodes, noise texture nodes, and blend shaders. For example... Figure 2 As shown, this example illustrates that the method of this application can generate programmed materials with complex optical effects such as subsurface scattering.
[0093] For example, the system can receive a jade reference image and text prompts, and analyze its texture and optical features through an enhancement module. For inputs rich in discrete texture features, the system can generate a tilable base texture map and construct a hybrid material representation including base color, roughness, transmittance, and subsurface scattering weights using a structured material description language. In one possible self-evolutionary path, the inner loop can use a material evaluation model to adjust the gloss and texture scale of the jade surface; the semantic evaluation model in the outer loop can generate feedback such as "increase subsurface scattering intensity and adjust absorption color" when insufficient internal transparency is detected, and trigger a topological rewriting of the typed memory graph, such as adding volumetric absorption nodes. Through the above exemplary iteration, an editable node graph and its corresponding rendering effect can be obtained. This example is used to illustrate the implementation of this method for handling materials coupled by multiple physical mechanisms, and does not limit the actual execution to using the specific feedback text or node combination described above.
[0094] To verify the advancement of the technical solution of this application compared to the prior art, multiple sets of comparative experiments were also conducted in this embodiment. For example... Figure 5 As shown, a qualitative comparison is presented between the results generated in this application and four representative baseline methods. The Retrieval method, limited by the enumeration range of the material library, can only return visually similar materials but lacking specific texture details of the reference image, making it difficult to meet the customization needs of specific reference images. While the VLM direct generation method attempts to build a node graph from scratch, the lack of structured constraints and verification / repair mechanisms often results in scripts that fail to execute due to API illusions or syntax errors. Even when they do run, their parameters are not optimized, leading to significant deviations in color saturation and surface texture from the reference image. In contrast, the materials generated in this application highly replicate the reference target in terms of texture granularity, optical response, and overall style. The fundamental reason for this difference lies in the fact that this application constrains the generation space within the legal operating domain through a structured material description language, and ensures a 100% execution success rate through two-stage verification and local patch repair. Furthermore, it utilizes an inner and outer double-loop decoupled architecture to solve optimization challenges at both the parameter accuracy and structural semantic levels. The quantitative evaluation results on 45 real-world reference images (covering sources such as AI-generated images, rendering engine material previews, and cropped real photos, with intentionally oversampled glass, self-illuminating, and semi-transparent material categories) are shown in the table below: Table 1: As shown in Table 1, among the quantitative evaluation results of the solution provided in this application and four other representative baseline methods, the human preference of this application is 37.8%, which is 16.7 percentage points higher than the 21.1% achieved by the visual language model direct generation method, which has the second highest score in this indicator. This represents a significant advantage over the other four quantitative evaluation indicators. The evaluation method for this indicator is to show the annotator the successful results of each method on the same reference image (hiding the method's identity) and ask them to select the result that "can achieve the reference appearance fastest through manual editing." Therefore, it directly reflects the practical value of this application's product as an editable starting point. Each baseline failed for different reasons, and the technical design of this application addresses each of these failures one by one. Compared to the retrieval method, this application uses a designer to synthesize a shader graph from scratch on a structured material description language, and continuously approximates the reference image through inner loop parameter optimization and outer loop structure rewriting. It is not constrained by any material library enumeration range, and the human preference reaches 37.8%, far exceeding the 16.3% of the retrieval method. Compared to the direct generation method using a visual language model, this application constrains generation to a well-typed and structured material description language, ensures executability through two-stage verification and a patch-based repairer, and uses parameter tuning by the scorer to close appearance gaps, achieving a 100% generation success rate (compared to only 77.8% for the direct generation method), with a material scorer score of 0.180 to 0.142. Compared to VLMaterial, this application targets realistic image design, replacing style loss that only applies to alignment maps with a learned material scorer, thus providing a reliable ranking signal for real reference images. The visual language model score is 5.33, with human preference at 37.8%, while VLMaterial scores only 2.61 and 4.1%, respectively. Compared to BlenderAlchemy (the strongest baseline), this application constrains generation to a well-typed and structured material description language, and delegates failures to a lightweight repairer for minimal local repair, achieving a 100% generation success rate with far fewer model calls (BlenderAlchemy is 97.8%), and outperforming human preference by 17 percentage points.
[0095] Furthermore, to verify the role of each core technical feature, this embodiment also examines the impact of the evaluator (outer loop), repairer, material scorer (inner loop), and parameter tuning module on system performance using component ablation analysis. Experimental results show that removing the evaluator has the most significant impact on generation quality; the VLM evaluation score drops from 3.79 to 3.29, and the material scorer score drops from 0.196 to 0.119. This indicates that parameter tuning alone cannot correct underlying structural defects, and structural rewriting of the outer loop is a necessary condition for achieving high-fidelity generation. After removing the repairer, although some simple materials can still be generated, the success rate drops significantly when facing complex topologies due to the inability to handle runtime errors, verifying the crucial role of the local patch repair mechanism in ensuring system robustness. Removing the material scorer or parameter tuning module results in noticeably coarser generation results in finer textures, demonstrating the indispensability of high-frequency numerical search for approximating the reference target. These ablation results conversely confirm that the "dual-loop decoupling" and "verification-repair" architecture adopted in this application is not a simple stacking of functions, but an organic whole in which each component works together and supports each other, forming a technical barrier for self-evolving material generation.
[0096] The default hyperparameters used in all experiments in this application are summarized in the following table: Table 2: Other key implementation constants include: 52 core node types; cross-modal embedding dimension D=3072; rendering set to Cycles engine, 256 samples, 512×512 resolution, with noise reduction enabled. Finally, to objectively define the application boundaries of the technical solution of this application, this embodiment also analyzes failure cases. For example... Figure 7As shown, two typical failure scenarios are illustrated. The first scenario involves the generated result being influenced by the prior knowledge of the black-box base model. Although it correctly identifies "wood" semantically, it fails to accurately reproduce the specific patterns in the reference image regarding texture direction and knot distribution. This reflects the inherent limitations of current generative models in fine-grained visual control. The second scenario involves the entanglement of lighting and material properties. When the reference image contains strong ambient light reflection or caustic effects, the system may misjudge these lighting effects as the material's own self-illumination or specular properties, causing the generated material to appear overexposed or color-shifted under standard lighting. It should be understood that the above failure cases do not negate the effectiveness of the technical solution of this application, but rather clarify its applicable conditions: This application mainly addresses how to generate executable, editable, and visually approximate procedural materials that closely resemble the target through a self-evolutionary closed loop, given reference information. The upper limit of its appearance fidelity is still limited by the capabilities of the underlying generative model and the information completeness of the reference image itself. In practical applications, it is recommended that users provide reference images with relatively uniform lighting conditions and clear material components to obtain the best generation results.
[0097] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art, within the technical scope disclosed in this application, can easily conceive of variations or substitutions based on the core concepts proposed in this application, such as adjustments to the verification and repair strategy, modifications to the parameter perturbation algorithm, replacement of the evaluation model, or reorganization of module functions. All of these should be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for generating programmed materials, characterized in that, include: Obtain reference information of the target material, generate an initial material description program based on a structured material description language, and parse the initial material description program into a typed memory graph, which includes nodes, connection relationships, and parameters; The typed memory graph is subjected to executability verification. If the verification fails, the typed memory graph is patched and repaired based on the error diagnosis information until the verification passes. After verification, the inner loop parameter tuning is performed: perturbation is applied to the parameters in the typed memory graph to generate candidate parameters, the rendering results of the candidate parameters are evaluated based on the lightweight material evaluation model, the parameters are updated according to the evaluation results, and the tuned material description program is obtained. Execute outer loop structure rewrite: Based on the semantic evaluation model, evaluate the rendering results before and after optimization. If the evaluation result does not meet the preset conditions, generate feedback information and trigger the rewriting of the topology of the typed memory graph. Return to the step of generating the initial material description program until the preset conditions are met or the preset iteration limit is reached, and output the target procedural material.
2. The method according to claim 1, characterized in that, The local patching and repair of the typed memory graph based on error diagnosis information includes: Based on the error diagnosis information, locate the set of the smallest damaged nodes in the typed memory graph; Generate an alternative descriptive fragment for the set of minimum damaged nodes; The alternative description fragment is parsed into a repair subgraph, and the repair subgraph is merged into the typed memory graph, while automatically restoring the bridging connections that remain valid after the repair.
3. The method according to claim 2, characterized in that, The executable verification of the typed memory graph includes: First-stage verification: Perform static checks on the syntax and topology of the typed memory graph; Second-stage verification: In response to the passing of the static check, the typed memory graph is converted into the target rendering engine's executable code and run. Execution without exceptions is used as a pass signal, and the exception information during the execution process is aggregated into the error diagnosis information.
4. The method according to claim 1, characterized in that, The optimization of the inner loop parameters includes: Select a subset of key parameters from the parameters of the typed memory graph; Apply a band-type perturbation to the subset of key parameters to generate candidate parameters; The rendering results of the candidate parameters are scored based on the lightweight material evaluation model. The candidate parameters are accepted or rejected based on the score changes, and the historical optimal parameter settings are maintained.
5. The method according to claim 4, characterized in that, Applying a band-type perturbation to the subset of key parameters includes: For scalar parameters, a scaling perturbation is performed in logarithmic space to make the up and down shifts symmetrical in logarithmic space. For color parameters, hue, saturation, and lightness are each independently resampled within a preset perturbation radius of the current value in the HSV color space; For Boolean parameters, the state is flipped according to a preset probability; All generated candidate parameters are cropped to the valid value range of the corresponding node before rendering.
6. The method according to claim 1, characterized in that, The rewriting of the outer loop structure includes: Based on the semantic evaluation model, the unoptimized rendering result and the optimized rendering result of the current round are compared and evaluated relative to the reference information to obtain the corresponding scores; Retain the rendering results with higher scores as the output for the current round; If the score of the higher-scoring rendering result does not reach the preset pass threshold, the feedback information in the form of free text is generated and the feedback information is sent back to trigger a structural-level rewrite of the topology of the typed memory graph.
7. The method according to claim 6, characterized in that, The rendering result is obtained by constructing a standard rendering set, which includes: Tiled planar views are used to evaluate the texture detail and grain characteristics of materials; The glossy sphere view is used to evaluate the material's color, basic albedo, and overall surface characteristics. Dark spherical view, used to evaluate the material's specular highlights, reflectivity, roughness, and emissivity.
8. The method according to claim 1, characterized in that, The structured material description language includes: A node block begins with a node identifier and node type, followed by an attribute line for setting node properties and an input line for setting default values for input sockets. The link line is used to declare a directed data flow connection from the output socket of the source node to the input socket of the target node; The process of obtaining reference information for the target material includes: calling a generation model to complete missing input modalities, generating a tilable texture map for materials rich in discrete patterns, and combining the tilable texture map with the structured material description language to form a hybrid material representation.
9. A system for generating programmed materials, characterized in that, include: The generation and parsing module is used to obtain reference information of the target material, generate an initial material description program based on the structured material description language, and parse the initial material description program into a typed memory graph, which includes nodes, connection relationships and parameters. The verification and repair module is used to perform executable verification on the typed memory graph. If the verification fails, the typed memory graph is patched and repaired based on the error diagnosis information until the verification passes. The inner loop tuning module is used to perform inner loop parameter tuning after verification: perturb the parameters in the typed memory graph to generate candidate parameters, evaluate the rendering results of the candidate parameters based on the lightweight material evaluation model, update the parameters according to the evaluation results, and obtain the tuned material description program. The outer loop rewrite module is used to perform outer loop structure rewrite: based on the semantic evaluation model, the rendering results before and after optimization are evaluated. If the evaluation result does not meet the preset conditions, feedback information is generated and the topology structure of the typed memory graph is rewritten. The operation of generating the initial material description program is returned until the preset conditions are met or the preset iteration limit is reached, and the target procedural material is output.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 8.