Stylized stroke rendering method and device, electronic equipment and storage medium

By acquiring model vertex information and generating multi-layer texture coordinates, and sampling brush texture fusion processing, the problem of insufficient realism in brush-style outlining effects was solved, achieving delicate outlining effects and enhancing the game's artistic expression and immersion.

CN121259079APending Publication Date: 2026-01-02NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511150619.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Existing technologies struggle to capture the nuances of brushstrokes and textural variations when achieving brush-style outlines, resulting in a lack of realism, especially in games with a traditional Chinese ink painting style, which negatively impacts the player's visual experience.

Method used

By acquiring the vertex information of the model, including world space vertex normals and vertex color information, the camera vector is converted to tangent space and offset, multi-layer texture coordinates are generated, brush textures are sampled and stroke information is fused to achieve dynamic changes in stroke thickness and depth.

Benefits of technology

It achieves a multi-layered outlining effect with a brush-like texture, enhancing the game's artistic expression and the richness of its stylized rendering, thereby improving the game's visual style and immersive experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121259079A_ABST
    Figure CN121259079A_ABST
Patent Text Reader

Abstract

The invention provides a stylized stroke rendering method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring vertex information of a model; reconstructing a camera vector of the world space based on the vertex information; generating a first layer of texture coordinates based on a first dot product result of the reconstructed camera vector and a world space vertex normal; generating a second layer of texture coordinates based on a second dot product result of the world space vertex normal and the light direction; according to the first-layer texture coordinates and the second-layer texture coordinates, corresponding brush chartlets are sampled, and first-layer stroking information and second-layer stroking information are obtained; and carrying out fusion processing on the first layer of stroking information and the second layer of stroking information to generate a stroking rendering effect of the model. Through the method provided by the invention, the thickness and depth dynamic change of the model stroking is realized, and the artistic expressive force of the model is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of gaming, and in particular to a stylized outlining rendering method, apparatus, electronic device, and storage medium. Background Technology

[0002] Stylized rendering in games uses specific rendering techniques to achieve a unique artistic style, creating a gaming experience different from traditional realistic visuals. Among related technologies, achieving a brush-style outline effect typically involves drawing weight information on vertex colors to control the thickness of the outline. However, this method can only represent simple variations in outline thickness and struggles to capture the rich characteristics of brushstrokes, such as varying pressure and texture. Especially in games with a traditional Chinese ink painting style, a lack of realistic outline effects directly impacts the player's visual experience. Summary of the Invention

[0003] The purpose of this disclosure is to provide a stylized outlining rendering method, apparatus, electronic device, and storage medium to achieve a multi-layered outlining effect with a brush-like texture, thereby enhancing the stylized expressiveness of games.

[0004] In a first aspect, this disclosure provides a stylized stroke rendering method, comprising: acquiring vertex information of the model, the vertex information including world space vertex normals and vertex color information; converting the camera vector in world space to tangent space, offsetting the converted camera vector based on the vertex color information, and converting the offset camera vector back to world space to obtain a reconstructed camera vector; generating a first layer of texture coordinates based on the first dot product result of the reconstructed camera vector and the world space vertex normals; generating a second layer of texture coordinates based on the second dot product result of the world space vertex normals and the light direction; sampling the corresponding brush maps according to the first layer of texture coordinates and the second layer of texture coordinates respectively to obtain the first layer of stroke information and the second layer of stroke information; and fusing the first layer of stroke information and the second layer of stroke information to generate the stroke rendering effect of the model.

[0005] Secondly, this disclosure provides a stylized stroke rendering apparatus, comprising: an acquisition module for acquiring vertex information of a model, the vertex information including world space vertex normals and vertex color information; a transformation module for transforming a camera vector in world space to tangent space, offsetting the transformed camera vector based on the vertex color information, and transforming the offset camera vector back to world space to obtain a reconstructed camera vector; a generation module for generating a first layer of texture coordinates based on the first dot product result of the reconstructed camera vector and the world space vertex normals; the generation module is also used to generate a second layer of texture coordinates based on the second dot product result of the world space vertex normals and the light direction; a sampling module for sampling corresponding brush maps according to the first layer of texture coordinates and the second layer of texture coordinates respectively to obtain first layer of stroke information and second layer of stroke information; and a fusion module for fusing the first layer of stroke information and the second layer of stroke information to generate a stroke rendering effect of the model.

[0006] Thirdly, this disclosure provides an electronic device including a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to perform the steps in the stylized outline rendering method described in any of the preceding claims.

[0007] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to perform steps in the stylized outlining rendering method described in any of the preceding claims.

[0008] This disclosure provides a stylized stroke rendering method, apparatus, electronic device, and storage medium. The method acquires vertex information of a model, including world space vertex normals and vertex color information. It transforms the camera vector from world space to tangent space, offsets the transformed camera vector based on the vertex color information, and then transforms the offset camera vector back to world space to obtain a reconstructed camera vector. Based on the first dot product of the reconstructed camera vector and the world space vertex normals, a first layer of texture coordinates is generated. Based on the second dot product of the world space vertex normals and the light direction, a second layer of texture coordinates is generated. The corresponding brush maps are sampled according to the first and second layer texture coordinates to obtain first and second layer stroke information. The first and second layer stroke information are then fused to generate the stroke rendering effect of the model. Through the method provided in this embodiment, by reconstructing the camera matrix and segmenting UV information to sample multiple layers of brush maps, dynamic changes in the thickness and depth of the model's strokes are achieved, giving the stroke brushes a textured feel, thereby enhancing the artistic expression and richness of stylized rendering in the game. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0010] Figure 1 This is a cloud interaction system architecture diagram according to an exemplary embodiment of the present disclosure; Figure 2 This is a schematic diagram of a stylized outline rendering method provided in an embodiment of the present disclosure; Figure 3 This is a schematic diagram illustrating the model display effect obtained based on the dot product of camera vectors and vertex normals, as provided in an embodiment of this disclosure. Figure 4 The first brush texture provided for this embodiment of the disclosure; Figure 5 This is a schematic diagram of the first layer outline effect provided in an embodiment of the present disclosure; Figure 6 The second brush texture provided in this embodiment of the disclosure; Figure 7 This is a schematic diagram of the second layer outline effect provided in an embodiment of the present disclosure; Figure 8 This is a schematic diagram of the fused outline effect provided in an embodiment of the present disclosure; Figure 9 This is a schematic diagram of the structure of a stylized outline rendering device provided in an embodiment of the present disclosure; Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0011] The technical solutions of this disclosure will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0012] It should be noted that the information (including but not limited to user input information, such as information entered by the user into input boxes), data (including but not limited to data used for analysis, stored data, and displayed data, such as context code, all code of the current project, the service pressure corresponding to operations performed on all code of the current project, and the code development status of the current project), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, the context code, operations performed on all code of the current project, the corresponding service pressure, and the code development status involved in this application were all obtained with full authorization.

[0013] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] It should also be noted that the various trigger events disclosed in this manual can be preset, and different trigger events can trigger the execution of different functions.

[0015] A stylized stroke rendering method in one embodiment of this disclosure can run on a terminal device or a server. The terminal device can be a local terminal device. When the stylized stroke rendering method runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and client devices. Figure 1 The figure shows a cloud interaction system architecture diagram provided in this disclosure. As shown, the cloud interaction system may include: a client device 10 and a server 20, wherein the client device 10 can be connected to the server 20 via a network 30.

[0016] The stylized outline rendering method in one embodiment of this disclosure can run on a terminal device or a server. The terminal device can be a local terminal device, such as a touch device or a non-touch device. When the stylized outline rendering method runs on a server, the method can be implemented and executed based on a cloud interaction system, which includes a server and client devices.

[0017] In an optional implementation, cloud gaming can run within the cloud interaction system. Cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of interactive methods in the game are completed on the cloud gaming server. The client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission capabilities close to the user, such as a mobile terminal, television, computer, or PDA; however, the terminal device for information processing is the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game interface and other data, returns it to the client device through the network, and finally, the client device decodes and outputs the game interface.

[0018] In an optional implementation, the terminal device can be a local terminal device that stores the game program and is used to present the game interface. The local terminal device is used to interact with the player through the game interface; that is, it typically downloads, installs, and runs the game program via an electronic device. The local terminal device can provide the game interface to the player in various ways, such as rendering it on a terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen and a processor. The display screen is used to present the game interface, which includes game scene visuals, and the processor is used to run the game, generate the game interface, and control the display of the game interface on the display screen.

[0019] This embodiment provides a stylized outline rendering method. Figure 2 This is a flowchart of a stylized outline rendering method according to an embodiment of the present disclosure, such as... Figure 2 As shown, the process includes the following steps: Step S210: Obtain the vertex information of the model, which includes world space vertex normals and vertex color information; Step S220: Convert the camera vector in world space to tangent space, offset the converted camera vector based on vertex color information, and convert the offset camera vector back to world space to obtain the reconstructed camera vector. Step S230: Based on the first dot product result of the reconstructed camera vector and the world space vertex normal, generate the first layer of texture coordinates; Step S240: Generate the second layer of texture coordinates based on the second dot product of the world space vertex normal and the light direction; Step S250: Sample the corresponding brush textures according to the first layer texture coordinates and the second layer texture coordinates respectively to obtain the first layer stroke information and the second layer stroke information; Step S260: The first layer of outline information and the second layer of outline information are fused together to generate the outline rendering effect of the model.

[0020] The method provided in this embodiment enables the creation of brushstroke-like outline effects in traditional Chinese ink painting style rendering. This method reconstructs the camera vector and generates multi-layered texture coordinates based on the dot product result. After sampling and blending brush textures, the outline effect exhibits variations in thickness and depth, along with rich texture. This processing method achieves a more artistic visual effect, enhances game richness, provides a unique art style for game visuals, and solves the technical challenge of achieving brushstroke-style outline rendering in the computer field.

[0021] The steps described above are explained in detail below.

[0022] In step S210, the vertex information of the model is obtained, including world space vertex normals and vertex color information.

[0023] Specifically, before performing stylized stroke rendering, the system needs to obtain the vertex information of the model, including world space vertex normals and vertex color information. This information is the basic data for subsequent stroke rendering calculations.

[0024] In this context, the world space vertex normal can be a vector representing the perpendicular direction of a point on the model's surface in the world coordinate system. World space vertex normals are commonly used to calculate lighting effects and surface orientation, and play a crucial role in determining the stroke position and intensity during stroke rendering.

[0025] Secondly, the world space vertex normal usually determines the orientation of the model surface and its relative position with respect to the viewpoint. This information directly affects the position and intensity calculation of the stroke.

[0026] In an alternative implementation, world space vertex normals can be pre-calculated using the model's geometry before rendering, and this normal data can be stored in a vertex buffer for use by the rendering pipeline. For example, when a 3D model file (such as OBJ or FBX format) is imported into a game engine, the system automatically calculates the normal vector for each vertex and converts it to the world space coordinate system, preparing for subsequent stroke effect calculations.

[0027] In one alternative implementation, world space vertex normals can be dynamically updated during real-time rendering based on model deformation to adapt to character animation or scene changes. For example, when a character in the game performs an action, its skeletal animation causes changes in the position of model vertices. At this time, the system will recalculate the normal information of the affected vertices to ensure that the outline effect changes naturally with the character's movements, maintaining visual consistency.

[0028] In an alternative implementation, world space vertex normals can be enhanced with detail using normal mapping technology, providing richer surface details while maintaining a low-poly model. For example, on a Chinese-style architectural model with finely sculpted textures, normal mapping can simulate the unevenness of brick and stone textures, allowing the outline effect to more accurately depict the texture details of the building surface and enhance the overall artistic expression.

[0029] Vertex color information, which can be color data stored in the model's vertex attributes, is used to control the characteristics and variations of the stroke. Vertex color information controls the changes in the stroke effect by influencing the offset of the camera vector.

[0030] Secondly, vertex color information usually plays a role in controlling local changes in the stroke effect. By adjusting the vertex color of different areas, precise control over the thickness and strength of the stroke can be achieved.

[0031] In an alternative implementation, vertex color information can be manually drawn by artists in modeling software to precisely control the outlining effect of different parts of the model. For example, on a character model, artists can set specific vertex color values ​​for the outline of the character's face to make the outlining of these areas more delicate and precise, while using different vertex color values ​​for secondary parts such as clothing to make the outlining effect more rugged, thereby achieving an artistic effect that highlights the key areas.

[0032] In an alternative implementation, vertex color information can be automatically generated based on the geometric features of the model using procedural methods, such as edge detection algorithms or curvature analysis. For example, the system can automatically analyze the curvature variations of the model surface, setting higher vertex color values ​​in areas with greater curvature (such as sharp corners or wrinkles) to make the outlines in these areas more prominent, while setting lower vertex color values ​​in smooth transition areas to create a layered outline effect.

[0033] In step S220, the camera vector in world space is converted to tangent space, the converted camera vector is offset based on vertex color information, and the offset camera vector is converted back to world space to obtain the reconstructed camera vector.

[0034] Specifically, this step involves the spatial transformation and reconstruction of the camera vector, which is a key step in achieving the stylized outline effect.

[0035] The world space camera vector is a normalized vector pointing from the rendering point to the camera position, representing the viewing direction. The world space camera vector is fundamental to achieving view-dependent outlining effects.

[0036] Secondly, the world space camera vector usually plays a role in determining the relationship between the viewpoint and the object surface, which directly affects the visibility and intensity of the outline under different viewpoints.

[0037] In an alternative implementation, the world space camera vector can be obtained by calculating and normalizing the difference between the camera position and the vertex position, ensuring that the outline effect transitions naturally with changes in viewpoint. For example, in a game scene, when the player controls the camera to rotate around a Chinese-style pavilion model, the system calculates the vector between each rendered vertex and the camera in real time, so that the outline effect can smoothly transition with changes in viewpoint, maintain the visibility of the model's edges, and create a coherent ink-wash style outline.

[0038] In an alternative implementation, the world space camera vector can be artistically adjusted to meet specific effect requirements, such as slight offset or rotation, to create specific stylized effects. For example, in a dreamlike scene, a subtle undulation effect can be applied to the camera vector to give the outline a slightly trembling effect, enhancing the hand-drawn feel and artistic expression, simulating the natural trembling of brushstrokes in traditional ink painting.

[0039] Tangent space can be a local coordinate system based on vertex tangents, secondary tangents, and normals, used for precise surface detail processing. Tangent space transformation allows vertex color information to more accurately control the stroke effect.

[0040] Secondly, tangent space typically provides a localized processing environment, facilitating fine-grained texture and effect control in localized areas of the model surface.

[0041] In an optional implementation, the tangent space can be automatically generated using the UV coordinate information of the model, ensuring a consistent stroke effect across models with varying levels of subdivision. For example, when processing a model of a traditional Chinese building, the system calculates the tangent and secondary tangent of each vertex based on the model's UV mapping relationship, forming a complete tangent space transformation matrix. This ensures that the stroke effect remains in the correct position and direction regardless of how the model is deformed or animated.

[0042] In an alternative implementation, the tangent space can be customized in specific areas of the model to achieve special artistic effects. For example, for an ancient-style longsword model, a special tangent space direction can be set on the blade to make the outline extend along the direction of the blade, enhancing the sharpness; while different tangent space settings are used on parts such as the hilt to make the outline present an effect more suitable for decorative textures.

[0043] Offset processing involves modifying the direction or size of a vector based on vertex color information to create stylized stroke effects. Offset processing controls the position and shape of the stroke by changing the direction of the camera vector.

[0044] Secondly, offset processing often serves to adjust the stroke effect according to artistic needs, allowing artists to make precise controls through vertex colors.

[0045] In an alternative implementation, the offset processing can utilize different channels of the vertex color to control the amount of offset in different directions, achieving complex stroke shape control. For example, the R channel of the vertex color can be used to control the offset in the X direction, the G channel to control the offset in the Y direction, and the B channel to control the overall offset intensity, allowing artists to precisely design different stroke characteristics for each model area, such as adding an outward offset to the hair tips of a character model to create a flowing ink line effect.

[0046] In a specific application, for a Chinese-style character model, the system first calculates the normalized vector from each vertex to the camera, and then transforms these vectors from world space to tangent space using a matrix composed of the model's tangents, bitangents, and normals. In tangent space, the system adjusts the camera vectors based on vertex color information (e.g., the R channel controls the horizontal offset, and the G channel controls the vertical offset), resulting in a stronger outline effect in areas where the character's clothing is flowing. Finally, the modified vectors are transformed back to world space using an inverse matrix to obtain the reconstructed camera vectors, preparing for subsequent calculations.

[0047] In step S230, the first layer of texture coordinates is generated based on the first dot product result of the reconstructed camera vector and the world space vertex normal.

[0048] Specifically, this step determines the relationship between the model surface and the viewpoint by calculating the vector dot product, and maps the result to the coordinates of the texture sampling.

[0049] The dot product result can be the cosine of the angle between the two vectors, representing the similarity between the two directions, and is used to determine the position and intensity of the stroke. Regions with a dot product result close to 0 are usually contour edges, suitable for stroke processing.

[0050] Secondly, the dot product result usually represents the relationship between the surface orientation and the viewing angle, which directly determines the position and intensity of the stroke.

[0051] In an alternative implementation, the dot product result can be processed by a custom mathematical function to adjust the sharpness and transition of the stroke. For example, an exponential or quadratic function can be applied to the dot product result to make the stroke sharper at the edges and smoother in the transition areas, thereby creating a natural effect similar to the alternation of wet and dry brushstrokes in traditional ink painting.

[0052] The first layer of texture coordinates can be the UV coordinates used to sample the brush texture, generated from the dot product result through mathematical transformation. The first layer of texture coordinates is mainly responsible for controlling the basic outline effect of the model.

[0053] Secondly, the coordinates of the first layer of texture usually determine the sampling position of the brush map, which determines how the stroke texture is applied to the model surface.

[0054] In an alternative implementation, the first layer texture coordinates can be generated through multi-level mathematical transformations, such as first performing difference calculations and then exponentiation, to obtain an ideal nonlinear distribution.

[0055] In an alternative implementation, the first layer of texture coordinates can be mixed with small amounts of noise or perturbation to break the perfectly regular outline effect and increase the hand-drawn feel. For example, low-frequency noise textures can be mixed into the texture coordinate calculation to make the outline lines exhibit slightly irregular variations, simulating the natural diffusion effect of a traditional brush on rice paper and enhancing artistic expression.

[0056] In a specific application, the system calculates the dot product of the reconstructed camera vector and the normal of each vertex, obtaining a result ranging from -1 to 1. Then, formula 1 minus the dot product is applied, and the result is squared to obtain the first layer of texture coordinates with a non-linear distribution. This processing results in larger texture coordinate values ​​at the edges of the model contour (regions where the dot product is close to 0), and smaller texture coordinate values ​​in the region facing the camera (regions where the dot product is close to 1), thus creating a noticeable outlining effect at the model contour.

[0057] In step S240, the second layer of texture coordinates is generated based on the second dot product of the world space vertex normal and the light direction.

[0058] Specifically, this step utilizes lighting information to enhance the outline effect, making the outline affected not only by the viewing angle but also by the direction of the light.

[0059] The light direction can be a normalized vector pointing to the main light source in the scene, used to calculate the relationship between the lighting and the model surface. The dot product of the light direction and the normal determines the light intensity, used to generate lighting-related stroke effects.

[0060] Secondly, the direction of the light usually determines the lighting effect and shadow distribution, and can be used to enhance the outline effect at the junction of light and shadow in outline rendering.

[0061] In an alternative implementation, the light direction can be a statically preset fixed direction, providing a stable and consistent outlining effect for the scene. For example, in a Chinese-style interior scene, the light direction can be set to simulate the "upper left light source" commonly used in traditional painting, so that the outlining effect of all objects follows the same lighting logic, creating a unified and harmonious visual style.

[0062] In one alternative implementation, the direction of the light can be dynamically changed, altering over time or during game events to add a sense of dynamism to the scene. For example, in a scene depicting the process from sunrise to sunset, the direction of the light changes with the position of the sun, causing the outlines of objects to dynamically change over time, enhancing the sense of time flow and the artistic expression of light and shadow variations in the scene.

[0063] The second layer of texture coordinates can be the UV coordinates used to sample another brush map, generated by processing the dot product of the normal and the light direction. The second layer of texture coordinates is mainly responsible for adding lighting-related stroke details.

[0064] Secondly, the second layer of texture coordinates usually has the function of adjusting the stroke effect according to the lighting conditions, so that the stroke can reflect the light and shadow relationship of the object.

[0065] In an alternative implementation, the second layer texture coordinates can be processed by a smooth step function to handle the dot product result, creating a sharp outline of light and dark boundaries.

[0066] In an alternative implementation, the second-layer texture coordinates can control the width and softness of the lighting-related strokes by adjusting the threshold range of the smoothstep function. For example, the start and end thresholds of the smoothstep function can be adjusted according to different scene atmosphere requirements, using a wider transition range (e.g., 0 to 0.7) in soft scenes to produce a soft, gradual stroke, while using a narrower transition range (e.g., 0.3 to 0.5) in dramatic scenes to produce a sharp, distinct stroke effect.

[0067] In step S250, the corresponding brush maps are sampled according to the first layer texture coordinates and the second layer texture coordinates to obtain the first layer stroke information and the second layer stroke information.

[0068] Specifically, this step uses previously generated texture coordinates to sample from a preset brush map to obtain artistic stroke texture data.

[0069] Brush maps, in particular, are pre-created 2D images containing the texture features of brush strokes, used to provide an artistic feel to the outlines. Brush maps are a key visual element in achieving brush-style outline effects.

[0070] Secondly, brush textures often provide an artistic brushstroke texture, giving computer-generated outlines the characteristics of hand-drawn brushstrokes.

[0071] In one alternative implementation, brush textures can be created by scanning real brushstrokes on rice paper to achieve a natural texture closest to traditional ink painting. For example, a professional traditional Chinese painting artist can be invited to create a series of brushstroke samples on rice paper using brushes of different thicknesses and wetness. These samples are then scanned with high precision and digitally processed to create brush textures suitable for real-time rendering, preserving the texture and ink color variations produced by the interaction between the real brush and the paper.

[0072] In an optional implementation, the brush texture can contain a variety of brush strokes with different styles, which can be dynamically selected or blended during rendering to achieve rich and varied stroke styles. For example, the system can prepare brush textures with different characteristics such as dry brush, wet brush, dark ink, and light ink, and select them during rendering based on the semantic information or material properties of the model. For example, a dry brush with sharp strokes can be used for rigid objects, while a wet brush with soft strokes can be used for soft objects, enhancing expressiveness and diversity.

[0073] The first and second texture coordinates can be used to sample different brush textures.

[0074] The stroke information can be color or transparency data sampled from the brush texture, used to represent the artistic stroke effect of the model's edges. The stroke information is the visual data that is ultimately rendered on the screen.

[0075] Secondly, the outline information usually serves to provide data for the final visual presentation, directly determining the appearance quality of the rendered outline.

[0076] In an alternative implementation, the stroke information can include two dimensions: color and transparency. The gradient effect of the stroke can be achieved by adjusting the transparency channel. For example, in the outline drawing of a Chinese-style character model, the stroke information can maintain high opacity at the edges and gradually become transparent towards the inside, creating a natural transition effect like ink wash painting, avoiding the computer-generated feel of hard edges.

[0077] In a specific application, the system samples from the first brush map using the first layer of texture coordinates (UV1) to obtain basic stroke information representing the model's outline; simultaneously, it samples from the second brush map using the second layer of texture coordinates (UV2) to obtain auxiliary stroke information representing light and shadow relationships. These two brush maps have different brush stroke characteristics: the first tends towards a uniform and delicate line texture, suitable for representing the model's basic outline; the second has more pronounced variations in tone, suitable for representing the stroke effects in areas of light and shadow transition. Through this dual-layer sampling mechanism, the system can obtain richer and more artistic stroke data.

[0078] In step S160, the first layer of outline information and the second layer of outline information are fused together to generate the outline rendering effect of the model.

[0079] Specifically, this step artistically combines the two layers of stroke information generated earlier to form the final stylized stroke effect.

[0080] The fusion process involves combining multiple layers of outline information through mathematical operations to obtain the final outline with the best visual effect. Fusion processing is a key step in adjusting the final outline's visual appearance.

[0081] Secondly, fusion processing usually serves to unify stroke data from different sources into a coherent visual effect, ensuring the artistic consistency of the final rendering result.

[0082] In an alternative implementation, the fusion process can achieve a basic layering effect through simple addition or multiplication operations. For example, the system can directly add the first layer of outline information (viewpoint-based contours) to the second layer of outline information (light and shadow boundaries based on illumination), resulting in a stronger outline effect in areas that are both contours and light and shadow boundaries, thus enhancing the visual structure of the model.

[0083] In an alternative implementation, the blending process can use more complex blending modes, such as screen blending and overlay blending, to achieve specific artistic effects. For example, for a scene that needs to express the effect of ink wash painting, the Soft Light blending mode can be used to blend two layers of outline information, resulting in a more natural overlay effect in the overlapping areas and avoiding the oversaturation problem that may result from simple addition. The outline rendering effect is the stylized outline effect that is finally displayed on the screen, and it is the visual output of the entire rendering process. The outline rendering effect is the final visual presentation directly to the user.

[0084] In an alternative implementation, the stroke rendering effect can be intelligently blended with the model's original materials to prevent the stroke from completely covering the original details. For example, the system can use transparency interpolation between the model's original texture and the stroke effect to make the stroke blend more naturally into the model's surface, preserving the texture details of the original texture while adding an artistic ink-wash style.

[0085] In a specific application, the camera vector in world space is first converted into the camera vector in tangent space based on the following formula one, and then the result is converted back to world space according to the following formula two.

[0086] Formula 1: Vt = Vw * Mw-t; where Vt represents the tangent space camera vector, Vw represents the world space camera vector, and Mw-t represents the transformation matrix from world space to tangent space.

[0087] Formula 2: Vw'=(Vt+Mv)* Mt-w; where Mt-w represents the transformation matrix from tangent space to world space, Mv represents the vertex color information of the model, and Vw' is the reconstructed camera vector.

[0088] After obtaining the camera vector Vw' in the reconstructed world space, the reconstructed Vw' is multiplied by the vertex normals of the world space to obtain the dot product result. The specific calculation is shown in Formula 3 below. The rendering effect based on the dot product result is as follows. Figure 3 As shown.

[0089] Formula 3: NoV=dot(Nw, Vw'); where Nw represents the model vertex normal in world space, dot represents the dot product operation, and NoV is the result of the dot product.

[0090] To make the strokes concentrate at the edge of the viewpoint and gradually decay inwards, creating a line effect similar to the traditional Chinese line drawing technique, the dot product result NoV can be converted into texture coordinates (first texture coordinates UV1) through multiple mathematical transformations. For example, difference calculation can be performed first, followed by a power operation to obtain the ideal non-linear distribution. The specific calculation is shown in Formula 4 below.

[0091] Formula 4: UV1=pow((1.0-NoV),2); where pow is the exponentiation operation.

[0092] The first texture coordinates UV1 are obtained and used as the UV sampling input information for the first layer. The texture is sampled to obtain the stroke information for the first layer. The first brush texture (e.g., based on the first texture coordinates UV1) can be applied to the first texture map. Figure 4 Sampling is performed (as shown), specifically based on Formula 5, to obtain the first layer of outline effect, as shown. Figure 5 As shown.

[0093] Formula 5: outline1=Sampler2D(brush1,UV1); where outline1 represents the first layer of outline result and brush1 represents the first layer of brush texture.

[0094] Furthermore, based on Formula 6, the vertex normals of world space are multiplied by the light direction, and the result is used as the input information for the second layer of UVs. Specifically, the second texture coordinates UV2 are calculated based on Formula 7, and the second brush texture is sampled based on the second texture coordinates UV2. See Formula 8 for details. The second brush texture is as follows: Figure 6 As shown, the second layer of outline effect is obtained, such as... Figure 7 As shown.

[0095] Formula 6: NoL=dot(Nw,Lw); where Lw represents the direction of the light in world space; Formula 7: UV2 = smoothstep(0, 0.5, saturate(1-NoL)); Formula 8: outline2 = Sampler2D(brush2, UV2). Where brush2 represents the second brush texture, and outline2 represents the second layer of stroke result.

[0096] Finally, based on Formula Nine, the first and second layer stroke results are added together, and then the difference is processed. This achieves stroke effects with varying thickness and depth, while also possessing the texture of a brush stroke, such as... Figure 8 As shown.

[0097] Formula 9: outline=lerp(col,float4(0,0,0,0),outline1+outline2); where outline is the outline information, that is, the blended outline, col represents the sampling information of the original material of the model, and float4 indicates the preset outline color.

[0098] In summary, the system first adds the first layer of stroke information (view-based contour stroke) to the second layer of stroke information (lighting-based shading stroke) to obtain a comprehensive stroke intensity map. Then, the system uses this intensity map to interpolate between the model's original material and a preset stroke color (usually pure black or dark brown), so that areas with high stroke intensity are displayed in the stroke color, while areas with low stroke intensity retain the original material appearance. This processing method allows the model to retain its original material details while achieving an artistic, stylized stroke effect, creating a visual style close to traditional Chinese ink painting.

[0099] In a stylized outlining rendering method provided in one embodiment of this application, a first layer of texture coordinates is generated based on the first dot product result of the reconstructed camera vector and the world space vertex normal, including: Step S2301: Calculate the first dot product between the reconstructed camera vector and the world space vertex normal; Step S2302: Perform mathematical transformation on the first dot product value to obtain the first layer texture coordinates.

[0100] The method provided in this embodiment enables the conversion of directional information in three-dimensional space into two-dimensional texture coordinates by calculating the dot product of the reconstructed camera vector and the vertex normal in world space, and then performing mathematical transformation on the result. This allows for the dynamic generation of texture coordinates based on changes in viewpoint, achieving dynamic adjustment of the outlining effect with changes in viewpoint. This enhances the expressiveness and artistry of the game screen, while avoiding the problem of requiring additional computing resources in traditional outlining techniques. It also optimizes game rendering performance and provides players with a more natural and smooth gaming experience, enhancing the game's immersion and visual appeal.

[0101] In step S2301, the first dot product of the reconstructed camera vector and the world space vertex normal is calculated.

[0102] Specifically, in this step, the reconstructed camera vector is first multiplied by the world space vertex normal of the model to obtain the first dot product value representing the relationship between the two vectors.

[0103] The reconstructed camera vector can be the world-space camera vector after being processed based on vertex color information offset. The reconstructed camera vector usually describes the viewing direction and is used to determine the positional relationship of the observer relative to the model surface.

[0104] In one alternative implementation, reconstructing the camera vector involves converting the camera vector in world space to tangent space, offsetting it based on vertex color information, and then converting it back to world space to obtain a 3D vector. For example, during game rendering, the camera's position vector in the world coordinate system can be subtracted from the vertex position vector to obtain a direction vector pointing to the camera. This vector is then converted from world space to tangent space, offset using the RGB channel values ​​of the vertex colors, and finally converted back to world space to form the reconstructed camera vector.

[0105] In step S2302, the first dot product value is mathematically transformed to obtain the first layer texture coordinates.

[0106] Specifically, in this step, the first dot product value calculated in the previous step is subjected to a series of mathematical transformations to generate the first layer of texture coordinates suitable for texture sampling.

[0107] Mathematical transformation processing can be a mathematical operation that performs nonlinear transformations on dot products. Mathematical transformation processing typically converts directional relationships in three-dimensional space into two-dimensional texture coordinates.

[0108] In a stylized outline rendering method provided in one embodiment of this application, the first dot product is mathematically transformed to obtain the first layer texture coordinates, including: Calculate the first difference between unit 1 and the first dot product value; The first difference is subjected to a power operation to obtain the texture coordinates of the first layer.

[0109] The method provided in this embodiment enables the rendering system to obtain texture coordinates that can represent the characteristics of a brushstroke style through simple and efficient mathematical transformations. This technique achieves the gradation and transition of the outline effect through the conversion of dot product values ​​and exponentiation operations, thereby enhancing the visual artistic expression, strengthening the consistency of the art style of the game or application, allowing users to obtain a more realistic and natural brushstroke effect, improving the interactive experience, enriching the artistic expression of the game, and solving the technical problem of achieving specific style rendering in computer graphics.

[0110] For the step of "calculating the first difference between unit 1 and the first point product value" Specifically, this step involves obtaining the first dot product value, and then subtracting that dot product value from 1 to obtain the difference result representing the degree of edge.

[0111] In an alternative implementation, when calculating the first difference, the absolute value of the first dot product can be subtracted from 1.0 to ensure a more pronounced outlining effect in the edge region. For example, for a 3D character model, when calculating the facial contour, if the dot product of the normal of a vertex and the reconstructed camera vector is 0.98, then the first difference is 1 - 0.98 = 0.02, indicating that this is not an edge region; while when calculating the side profile, if the dot product is 0.1, then the first difference is 1 - 0.1 = 0.9, indicating that this is an edge region that needs to be emphasized.

[0112] In an alternative implementation, the first difference can be further adjusted by a set threshold to control the width and intensity of the stroke effect. For example, a threshold ranging from 0 to 0.3 can be set. When the first difference is less than the threshold, it is considered a non-edge region and the difference is set to 0; when it is greater than the threshold, the original value is retained. This allows the stroke effect to be more focused on the true edge region of the model.

[0113] For the step of "performing a power operation on the first difference to obtain the texture coordinates of the first layer", Specifically, this step involves exponentially calculating the difference obtained in the first step to make the edge effect sharper or smoother, thus obtaining the texture coordinates used for sampling the brush map.

[0114] Among them, exponentiation can be a mathematical calculation process that raises the first difference to a specific power. Exponentiation often has the effect of adjusting the numerical distribution curve, which can strengthen or weaken the edge transition effect.

[0115] In an alternative implementation, the exponentiation can be performed by squaring the first difference, i.e., multiplying the first difference by itself. This process makes large differences (close to 1) change little, while small differences (close to 0) become smaller, thus creating a sharper stroke edge. For example, if the first difference is 0.9, squaring it becomes 0.81, which is not a significant change; but if the first difference is 0.3, squaring it becomes 0.09, a substantial reduction. This non-linear transformation helps create a clear stroke boundary.

[0116] In an alternative implementation, the exponent of the exponentiation operation can be an adjustable parameter, such as pow(first difference, n), where n can be adjusted between 1 and 5. Larger n values ​​produce sharper stroke edges, while smaller n values ​​produce a smoother transition. For example, when n=1, it is equivalent to a linear mapping; when n=2, it produces a square mapping; and when n=4, it makes the edges sharper and the transition steeper.

[0117] In a stylized outline rendering method provided in one embodiment of this application, the step of generating a second layer of texture coordinates based on the second dot product of the world space vertex normal and the light direction includes: Step S2401: Calculate the second dot product of the world space vertex normal and the light direction; Step S2402: Calculate the second difference between unit 1 and the second dot product value, and perform saturation processing on the second difference; Step S2403: The result after saturation processing is processed using a smoothing step function to obtain the second layer texture coordinates.

[0118] The method provided in this embodiment enables the generation of a second layer of texture coordinates with varying lighting effects during stylized stroke rendering. This is achieved by processing the dot product of the world space vertex normals and the light direction. The corresponding brush texture is then sampled to obtain the second layer of stroke information. This technique, by introducing the lighting direction factor, enriches the stroke's variation effect, allowing the stroke to exhibit a texture variation similar to the depth of a brushstroke in areas of changing lighting, thus enhancing the artistic expression of the game visuals.

[0119] In step S2401, the second dot product of the world space vertex normal and the light direction is calculated.

[0120] Specifically, this step involves performing a dot product operation on the world space vertex normal and the light direction vectors to obtain a second dot product value, which reflects the cosine of the angle between the model surface normal and the lighting direction.

[0121] In step S2402, the second difference between unit 1 and the second dot product value is calculated, and the second difference is subjected to saturation processing.

[0122] Specifically, this step first calculates the difference between the constant 1 and the second dot product value to obtain the second difference value. Then, this difference value is subjected to saturation processing, that is, it is restricted to the range of 0 to 1 to ensure the numerical stability of subsequent processing.

[0123] The second difference can be a mathematical calculation result, representing the difference between the cosine of the angle between the lighting direction and the normal direction and 1. The second difference can convert the dot product result into a numerical range suitable for the stroke effect.

[0124] Secondly, the second difference usually has the function of mapping the dot product result to the stroke intensity, which can produce a stronger stroke effect on the backlit side and enhance the sense of outline.

[0125] Saturation processing involves mathematical operations that limit values ​​to the range of 0 to 1, ensuring the validity of parameters for subsequent texture sampling. Saturation processing prevents rendering errors caused by outliers and guarantees the stability of the stroke effect.

[0126] In an alternative implementation, saturation processing can be achieved using the `clamp` function, which limits the input value to a specified minimum and maximum value, a common method for range constraint in graphics programming. For example, when processing the second difference, the `saturate(value)` or `clamp(value, 0.0, 1.0)` function can be used to limit it to between 0 and 1. This ensures that even under extreme lighting conditions (such as when the light source is directly opposite or away from the normal direction), the generated texture coordinates remain within a valid range, avoiding texture sampling errors or visual anomalies.

[0127] In step S2403, the result after saturation processing is processed using a smoothing step function to obtain the second layer texture coordinates.

[0128] Specifically, this step uses the smoothstep function to further process the saturation-processed result, generating a second layer of texture coordinates for sampling the brush map. The smoothstep function can achieve a smooth transition within a specified range, making the stroke effect more natural.

[0129] The smooth step function is a mathematical function that creates a smooth transition within a specified range, used to create soft boundary transition effects. It can transform hard boundaries into soft gradients, making the stroke effect more natural and aesthetically pleasing.

[0130] In an alternative implementation, the parameters of the smooth step function can be dynamically adjusted. By changing the values ​​of the start and end points, the range and position of the transition region can be controlled to adapt to different artistic style requirements. For example, when rendering a detailed model that requires fine outlining, the parameters of the smooth step function can be set to smoothstep(0.1, 0.4, value). This will create a narrower transition region between 0.1 and 0.4, producing a sharper outlining effect. For a model that requires softer outlining, smoothstep(0, 0.5, value) can be used to create a wider transition region, making the outlining effect softer.

[0131] In a stylized outline rendering method provided in one embodiment of this application, the step of fusing the first layer of outline information and the second layer of outline information includes: Step S2601: Add the first layer of stroke information to the second layer of stroke information to obtain the composite stroke information; Step S2602: Based on the synthesized outline information, interpolation is performed between the original texture information of the model and the preset outline color value.

[0132] The above plan will be explained in detail below.

[0133] In step S2601, the first layer of outline information is added to the second layer of outline information to obtain the composite outline information.

[0134] Specifically, the first and second layers of outline information calculated from different angles and directions are superimposed. By simply adding them together, the two layers of outline information with different characteristics are merged to form composite outline information.

[0135] In step S1020, based on the synthesized outline information, interpolation is performed between the original texture information of the model and the preset outline color value.

[0136] Specifically, a linear interpolation function is used, with the synthesized stroke information as the interpolation factor, to mix the original texture color of the model with the preset stroke color, thereby adding a stylized stroke effect while preserving the original texture details of the model.

[0137] The original texture information of a model can include visual information such as the color and texture of the model's surface. The original texture information of a model typically serves to represent the model's basic appearance and material properties.

[0138] In one alternative implementation, the model's original texture information may include a combination of various texture information such as diffuse texture, normal texture, and specular texture, which together determine the basic appearance of the model without outlining.

[0139] In an alternative implementation, the model's original texture information can be preprocessed using artistic stylization to make it closer to the expressive style of ink painting, such as reducing color saturation or increasing ink blot effects, thereby making it more consistent with the outlining style.

[0140] The preset stroke color value can be a numerical value used to represent the stroke effect. The preset stroke color value usually serves to define the visual appearance and artistic style of the stroke.

[0141] In an optional implementation, the preset outline color value can be a pure black or near-black dark tone, simulating the effect of traditional Chinese ink painting, making the overall style closer to traditional Chinese painting. For example, in a mobile game with an ink painting style, the character outline uses pure black with 80% transparency as the preset outline color. When interpolated and mixed with the original texture, the resulting effect retains the basic shape and color of the character while adding a layer of elegant ink-colored edges, making the character look as if it has stepped out of an ancient painting, greatly enhancing the game's artistic expression and cultural connotation.

[0142] In an alternative implementation, the preset stroke color can be transparent. The stroke is blended with the original texture by adjusting the transparency rather than the color itself, making the final effect more natural and controllable.

[0143] In this embodiment of the application, the brush texture is a texture with brush brush texture features.

[0144] In one embodiment of this application, a stylized outline rendering method is provided, which further includes: Step S310: Receive stroke rendering parameters, including at least one of stroke thickness coefficient, light and dark contrast, and brush texture intensity; In step S320, during the process of generating the first layer texture coordinates and the second layer texture coordinates, the first layer texture coordinates and the second layer texture coordinates are adjusted based on the stroke rendering parameters.

[0145] The method provided in this implementation allows users to adjust the thickness, depth, and texture intensity of the stroke effect in real time according to their needs, thereby obtaining a richer and more diverse range of brush-style strokes. This parametric control method not only enhances the interactive experience but also strengthens the expressive power of the art style in game scenes or applications, providing a flexible and precise control method for rendering traditional Chinese ink painting.

[0146] The above plan will be explained in detail below.

[0147] In step S310, stroke rendering parameters are received, including at least one of stroke thickness coefficient, light and dark contrast, and brush texture intensity.

[0148] Specifically, the system receives stroke rendering parameters set by the user through interface interaction or program calls. These parameters are used to finely adjust the visual effects of stylized strokes.

[0149] Among them, the stroke rendering parameters can be parameter values ​​that the user can interactively input on the graphical interface. Stroke rendering parameters refer to numerical variables that control various characteristics of the stroke rendering effect.

[0150] In one alternative implementation, the stroke thickness coefficient is a floating-point value used to control the width of the stroke line. The larger the coefficient value, the thicker the stroke effect; the smaller the coefficient value, the thinner the stroke effect.

[0151] In an optional implementation, the contrast parameter is used to control the degree of transition between light and dark areas in the stroke effect. The higher the parameter value, the stronger the contrast between light and dark areas of the stroke; the lower the parameter value, the smoother the transition between light and dark areas of the stroke.

[0152] In an optional implementation, the brush texture intensity parameter is used to control the prominence of the brush stroke texture in the stroke. The higher the parameter value, the more obvious the brush texture in the stroke; the lower the parameter value, the smoother the brush texture in the stroke.

[0153] In a specific application, the rendering system provides a parameter adjustment panel with three slider controls, corresponding to stroke thickness (range 0.1-3.0), contrast (range 0.0-2.0), and brush texture intensity (range 0.0-1.0). Users can observe the changes in effect caused by parameter adjustments in real time in the scene preview window. When a satisfactory stroke effect is achieved, the current parameter configuration can be saved, and the system will pass these parameter values ​​to the rendering pipeline for subsequent stroke calculations.

[0154] In step S1020, during the process of generating the first layer texture coordinates and the second layer texture coordinates, the first layer texture coordinates and the second layer texture coordinates are adjusted based on the stroke rendering parameters.

[0155] Specifically, during the process of calculating and generating texture coordinates, the system applies the received stroke rendering parameters to the calculation formula of texture coordinates, thereby modifying the final generated coordinate values.

[0156] Texture coordinate adjustment refers to the calculation process of modifying the UV coordinate values ​​used to sample the brush texture based on parameters. Texture coordinates are a coordinate system used to locate pixel positions in a two-dimensional image space.

[0157] In an optional implementation, the adjustment of the first layer texture coordinates based on the stroke thickness coefficient is achieved by introducing this coefficient as an adjustment factor in the exponentiation operation during the mathematical transformation process of calculating the first dot product value, so that the stroke range expands as the coefficient increases. The adjustment of the first layer texture coordinates can be achieved through parameter changes caused by click operations, swipe operations, long press operations, and / or other operations. For example, when the user adjusts the stroke thickness coefficient from 1.0 to 2.0 through a swipe operation, the system will substitute this coefficient value into the formula "UV1 = pow((1.0-NoV), 2 * reciprocal of the thickness coefficient)". When the thickness coefficient increases, the exponentiation decreases, making the edge transition area wider and the stroke effect thicker.

[0158] In an optional implementation, the adjustment of the second-layer texture coordinates based on the contrast parameter is achieved by modifying the difference between the starting and ending values ​​in the smoothstep function. Increasing or decreasing this difference controls the width of the transition area, thereby affecting the contrast. The adjustment of the second-layer texture coordinates can be achieved through parameter changes caused by click, swipe, long press, and / or other operations. For example, when a user selects a high-contrast preset by clicking, the system applies the contrast parameter value to the formula "UV2 = smoothstep(0, 0.5 * contrast parameter, saturate(1-NoL))". When the contrast parameter value is less than 1, the transition area narrows, and the light and dark boundaries of the stroke become sharper.

[0159] In an optional implementation, the brush texture intensity parameter is adjusted by incorporating it as a weighting factor during the final synthesis of stroke information, thereby adjusting the contribution of the brush texture to the final stroke effect. The brush texture intensity can be adjusted through parameter changes caused by clicks, swipes, long presses, and / or other operations. For example, when a user enters a brush texture intensity value of 0.8 in the input box, the system applies the formula "outline = lerp(col, float4(0,0,0,0), (outline1 + outline2) * texture intensity parameter)" during the stroke information synthesis stage. Increasing this parameter will make the texture features in the brush texture more prominent in the final rendering result.

[0160] Based on the above method embodiments, this disclosure also provides a stylized outline rendering apparatus, see [link to relevant documentation]. Figure 9 The device includes the following modules: The acquisition module 901 is used to acquire the vertex information of the model, which includes world space vertex normals and vertex color information; The conversion module 902 is used to convert the camera vector in world space to tangent space, offset the converted camera vector based on vertex color information, and convert the offset camera vector back to world space to obtain the reconstructed camera vector. The generation module 903 is used to generate the first layer of texture coordinates based on the first dot product result of the reconstructed camera vector and the world space vertex normal. The generation module 903 is also used to generate the second layer of texture coordinates based on the second dot product result of the world space vertex normal and the light direction; The sampling module 904 is used to sample the corresponding brush textures according to the first layer texture coordinates and the second layer texture coordinates respectively, so as to obtain the first layer stroke information and the second layer stroke information. The fusion module 905 is used to fuse the first layer of outline information and the second layer of outline information to generate the outline rendering effect of the model.

[0161] The aforementioned device acquires vertex information of the model, including world space vertex normals and vertex color information; transforms the camera vector from world space to tangent space; offsets the transformed camera vector based on the vertex color information; and transforms the offset camera vector back to world space to obtain a reconstructed camera vector; generates a first layer of texture coordinates based on the first dot product of the reconstructed camera vector and the world space vertex normals; generates a second layer of texture coordinates based on the second dot product of the world space vertex normals and the light direction; samples the corresponding brush maps according to the first and second layer texture coordinates to obtain first and second layer stroke information; and fuses the first and second layer stroke information to generate the model's stroke rendering effect. Through the device provided in this embodiment, the technique of reconstructing the camera matrix and segmenting UV information to sample multiple layers of brush maps enables dynamic changes in the thickness and depth of the model's strokes, giving the stroke brushes texture and thus enhancing the game's artistic expression and the richness of its stylized rendering.

[0162] The stylized outline rendering apparatus provided in this disclosure has the same implementation principle and technical effect as the aforementioned method embodiments. For the sake of brevity, any parts of the stylized outline rendering apparatus not mentioned in the embodiments can be referred to the corresponding content in the aforementioned stylized outline rendering method embodiments.

[0163] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0164] This disclosure also provides an electronic device, such as... Figure 10 The diagram shows the structure of the electronic device, which includes a processor 111 and a memory 110. The memory 110 stores computer-executable instructions that can be executed by the processor 111. The processor 111 executes the computer-executable instructions to implement the following stylized outline rendering method steps: Obtain the vertex information of the model, which includes world space vertex normals and vertex color information; The camera vector in world space is transformed to tangent space, the transformed camera vector is offset based on vertex color information, and the offset camera vector is transformed back to world space to obtain the reconstructed camera vector. Based on the first dot product of the reconstructed camera vector and the world space vertex normal, the first layer of texture coordinates is generated. The second layer of texture coordinates is generated based on the second dot product of the world space vertex normal and the light direction. Based on the first layer texture coordinates and the second layer texture coordinates, sample the corresponding brush textures to obtain the first layer stroke information and the second layer stroke information; The first and second layer outline information are merged to generate the outline rendering effect of the model.

[0165] Optionally, based on the first dot product of the reconstructed camera vector and the world space vertex normal, the first layer of texture coordinates is generated, including: Calculate the first dot product between the reconstructed camera vector and the world space vertex normal; The first dot product is mathematically transformed to obtain the first layer texture coordinates.

[0166] Optionally, the first dot product value is mathematically transformed to obtain the first layer texture coordinates, including: Calculate the first difference between unit 1 and the first dot product value; The first difference is exponentially calculated to obtain the coordinates of the first layer of texture.

[0167] Optionally, based on the second dot product of the world space vertex normal and the light direction, a second layer of texture coordinates is generated, including: Calculate the second dot product of the world space vertex normal and the light direction; Calculate the second difference between unit 1 and the second dot product value, and perform saturation processing on the second difference; The results of saturation processing are processed using a smoothing step function to obtain the coordinates of the second layer of texture.

[0168] Optionally, the first layer of stroke information and the second layer of stroke information are merged, including: The first layer of stroke information is added to the second layer of stroke information to obtain the composite stroke information; Based on the synthesized outline information, interpolation is performed between the original texture information of the model and the preset outline color.

[0169] Optionally, the default stroke color is transparent.

[0170] Optionally, the brush map is a map with brush texture features.

[0171] Optionally, the method further includes: Receive stroke rendering parameters, including at least one of stroke thickness coefficient, light and dark contrast and brush texture intensity; During the generation of the first and second layer texture coordinates, the first and second layer texture coordinates are adjusted based on the stroke rendering parameters.

[0172] exist Figure 10 In the illustrated embodiment, the electronic device further includes a bus 112 and a communication interface 113, wherein the processor 111, the communication interface 113, and the memory 110 are connected via the bus 112.

[0173] The memory 110 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 113 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 112 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 112 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0174] The processor 111 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 111 or by instructions in software form. The processor 111 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this disclosure can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory. The processor 111 reads the information in the memory and, in conjunction with its hardware, completes the steps of the stylized outline rendering method described in the aforementioned embodiment.

[0175] This disclosure also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement a stylized outline rendering method, which specifically includes: Obtain the vertex information of the model, which includes world space vertex normals and vertex color information; The camera vector in world space is transformed to tangent space, the transformed camera vector is offset based on vertex color information, and the offset camera vector is transformed back to world space to obtain the reconstructed camera vector. Based on the first dot product of the reconstructed camera vector and the world space vertex normal, the first layer of texture coordinates is generated. The second layer of texture coordinates is generated based on the second dot product of the world space vertex normal and the light direction. Based on the first layer texture coordinates and the second layer texture coordinates, sample the corresponding brush textures to obtain the first layer stroke information and the second layer stroke information; The first and second layer outline information are merged to generate the outline rendering effect of the model.

[0176] Optionally, based on the first dot product of the reconstructed camera vector and the world space vertex normal, the first layer of texture coordinates is generated, including: Calculate the first dot product between the reconstructed camera vector and the world space vertex normal; The first dot product is mathematically transformed to obtain the first layer texture coordinates.

[0177] Optionally, the first dot product value is mathematically transformed to obtain the first layer texture coordinates, including: Calculate the first difference between unit 1 and the first dot product value; The first difference is exponentially calculated to obtain the coordinates of the first layer of texture.

[0178] Optionally, based on the second dot product of the world space vertex normal and the light direction, a second layer of texture coordinates is generated, including: Calculate the second dot product of the world space vertex normal and the light direction; Calculate the second difference between unit 1 and the second dot product value, and perform saturation processing on the second difference; The results of saturation processing are processed using a smoothing step function to obtain the coordinates of the second layer of texture.

[0179] Optionally, the first layer of stroke information and the second layer of stroke information are merged, including: The first layer of stroke information is added to the second layer of stroke information to obtain the composite stroke information; Based on the synthesized outline information, interpolation is performed between the original texture information of the model and the preset outline color.

[0180] Optionally, the default stroke color is transparent.

[0181] Optionally, the brush map is a map with brush texture features.

[0182] Optionally, the method further includes: Receive stroke rendering parameters, including at least one of stroke thickness coefficient, light and dark contrast and brush texture intensity; During the generation of the first and second layer texture coordinates, the first and second layer texture coordinates are adjusted based on the stroke rendering parameters.

[0183] The computer program products of the stylized stroke rendering method, apparatus and electronic device provided in the embodiments of this disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0184] Unless otherwise specifically stated, the relative steps, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0185] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0186] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0187] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A stylized outline rendering method, characterized in that, include: Obtain the vertex information of the model, which includes world space vertex normals and vertex color information; The camera vector in world space is converted to tangent space, the converted camera vector is offset based on the vertex color information, and the offset camera vector is converted back to world space to obtain the reconstructed camera vector. Based on the first dot product of the reconstructed camera vector and the world space vertex normal, the first layer of texture coordinates is generated; Based on the second dot product of the world space vertex normal and the light direction, the second layer of texture coordinates is generated; Based on the first layer texture coordinates and the second layer texture coordinates, sample the corresponding brush textures to obtain the first layer stroke information and the second layer stroke information; The first layer of outline information and the second layer of outline information are fused together to generate the outline rendering effect of the model.

2. The stylized outline rendering method according to claim 1, characterized in that, The process of generating the first layer of texture coordinates based on the first dot product of the reconstructed camera vector and the world space vertex normal includes: Calculate the first dot product between the reconstructed camera vector and the world space vertex normal; The first dot product is mathematically transformed to obtain the texture coordinates of the first layer.

3. The method according to claim 2, characterized in that, The step of performing a mathematical transformation on the first dot product to obtain the first layer texture coordinates includes: Calculate the first difference between unit 1 and the first dot product value; The first difference is subjected to a power operation to obtain the texture coordinates of the first layer.

4. The stylized outline rendering method according to claim 1, characterized in that, The generation of the second layer of texture coordinates based on the second dot product result of the world space vertex normal and the light direction includes: Calculate the second dot product of the world space vertex normal and the light direction; Calculate the second difference between unit 1 and the second dot product value, and perform saturation processing on the second difference; The results of saturation processing are processed using a smoothing step function to obtain the coordinates of the second layer texture.

5. The stylized outline rendering method according to claim 1, characterized in that, The process of fusing the first layer of outline information and the second layer of outline information includes: The first layer of outline information is added to the second layer of outline information to obtain the composite outline information; Based on the synthesized outline information, interpolation is performed between the original texture information of the model and the preset outline color.

6. The stylized outline rendering method according to claim 5, characterized in that, The preset outline color is transparent.

7. The stylized outline rendering method according to claim 1, characterized in that, The brush texture is a texture with brush brush texture characteristics.

8. The stylized outline rendering method according to claim 1, characterized in that, The method further includes: Receive stroke rendering parameters, the parameters including at least one of stroke thickness coefficient, light and dark contrast and brush texture intensity; During the generation of the first layer texture coordinates and the second layer texture coordinates, the first layer texture coordinates and the second layer texture coordinates are adjusted based on the stroke rendering parameters.

9. A stylized outline rendering device, characterized in that, include: The acquisition module is used to acquire the vertex information of the model, which includes world space vertex normals and vertex color information; The conversion module is used to convert the camera vector in world space to tangent space, offset the converted camera vector based on the vertex color information, and convert the offset camera vector back to world space to obtain the reconstructed camera vector. The generation module is used to generate the first layer of texture coordinates based on the first dot product result of the reconstructed camera vector and the world space vertex normal; The generation module is also used to generate a second layer of texture coordinates based on the second dot product result of the world space vertex normal and the light direction; The sampling module is used to sample the corresponding brush textures according to the first layer texture coordinates and the second layer texture coordinates respectively, so as to obtain the first layer stroke information and the second layer stroke information. The fusion module is used to fuse the first layer of outline information and the second layer of outline information to generate the outline rendering effect of the model.

10. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Model rendering method and device

    CN112070873A

  • Rendering optimization method and system for stroking effect, electronic device and storage medium

    CN112270726A

  • Virtual character hair rendering method and device, electronic equipment and storage medium

    CN115082607A

  • Image processing method and device and electronic equipment

    CN118262025A

  • Graphic processing method and apparatus, computer device, and storage medium

    WO2023098344A1