Gem model processing method and device, electronic equipment and computer program product
By splitting the gem model and performing view-direction related texture processing, the problems of high computational load and unstable light source in rendering gem fire effects in games were solved, achieving flexible artistic expression and low performance consumption for fire effects.
Patent Information
- Application Number
- CN202511383846.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-12-23
AI Technical Summary
In a real-time game rendering environment, simulating gem fire effects requires a huge amount of computation, and the unstable light source makes it difficult to trigger and display the fire effect stably.
The gemstone model is split into top and bottom sub-models, and textures are processed separately. The highlighting of color blocks and the addition of reflective point textures are controlled by the direction of the gaze. Color changes are combined with the glitter texture map to simulate the optical effects of gemstones.
It achieves dynamic rendering of gemstones' shimmering colors with low performance consumption, adapts to different lighting environments, meets game art requirements, and ensures smooth operation.
Smart Images

Figure CN121190649A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a method for processing gemstone models, a device for processing gemstone models, an electronic device, and a computer program product. Background Technology
[0002] Realistically replicating the fire and brilliance of gems in games has always been a significant technical challenge, resulting in the scarcity of gem elements in game design, and even when they are included, their fire and brilliance are often not realistically represented. This is mainly because the formation mechanism of fire and brilliance is extremely complex. Taking diamonds as an example, their fire and brilliance depend on the combined effects of light dispersion and total internal reflection. Diamonds have extremely high refractive index and strong dispersion. When white light enters a diamond, light of different wavelengths separates at angles due to differences in speed. These dispersed rays undergo multiple total internal reflections through multiple facets within the diamond, eventually exiting from the crown facet to form separate, shimmering colored rays of light.
[0003] Currently, achieving realistic gem fire effects in a real-time game rendering environment often requires a huge amount of computation, and the complex and ever-changing lighting conditions in game scenes make it extremely difficult to stably trigger and display fire effects.
[0004] Therefore, there is an urgent need in the field for a gem model processing method that can efficiently simulate the fire effect of gems in a real-time rendering environment and significantly reduce the amount of computation.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this disclosure is to provide a method for processing gemstone models, a device for processing gemstone models, an electronic device, and a computer program product, thereby enabling efficient simulation of gemstone fire effects and significantly reducing computational load, at least to a certain extent, in a real-time rendering environment.
[0007] According to a first aspect of this disclosure, a method for processing a gemstone model is provided, comprising: The original gem model to be processed is split into a top sub-model and a bottom sub-model. Fill the UV of the top sub-model of the gemstone with color blocks of different brightness, and control part of the color blocks to be highlighted according to a first brightness range related to the input viewing direction; Add reflective dot textures related to the input viewing direction to the base texture map of the gem's bottom sub-model, and add a gem's internal glitter texture map containing color blocks of different brightness and depth. The color of a portion of the color blocks in the internal glitter texture map of the gemstone is controlled to change according to a first brightness range related to the input viewing direction.
[0008] According to a second aspect of this disclosure, a processing apparatus for a gemstone model is provided, comprising: The gem model splitting module is used to split the original gem model to be processed into a top sub-model and a bottom sub-model. A color block highlighting control module is used to fill color blocks of different brightness on the model UV of the top sub-model of the gemstone, and control part of the color blocks to be highlighted according to a first brightness range related to the input viewing direction; The reflective texture addition module is used to add reflective point textures related to the input viewing direction on the base texture map of the bottom sub-model of the gemstone, and to add a gemstone internal glitter texture map containing color blocks of different brightness and different layer depths. A color control module for coloring color blocks in the internal glitter texture map of a gemstone according to a first brightness range related to the input viewing direction.
[0009] According to a third aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the processing method of the gemstone model described in any one of the preceding claims by executing the executable instructions.
[0010] According to a fourth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the processing method for the gemstone model as described in any of the preceding claims.
[0011] The exemplary embodiments disclosed herein can have the following beneficial effects: In the gem model processing method of this exemplary embodiment, the original gem model to be processed is split into two parts: the top sub-model and the bottom sub-model are textured separately. This effectively separates the optical effects of surface reflection and internal refraction, solving the serious performance problems of fire rendering schemes and providing more flexible and magnificent gem fire effects, which is of great significance for enhancing the artistic expression of games. The gem model processing method in this exemplary embodiment achieves, on the one hand, the presentation of separate, shimmering colored light on the gem crown and inside, which can dynamically shimmer with changes in viewing angle. Compared with physically based realistic rendering methods, it can achieve more flexible artistic effects and meet the customized artistic needs of projects. On the other hand, through non-realistic rendering technology, it can achieve gorgeous artistic effects while ensuring low performance consumption, allowing it to run smoothly on mobile devices. Furthermore, it achieves fully customizable fire intensity, unaffected by real-time lighting in the game, and can stably trigger fire effects. For darker environments such as indoors and at night, the fire intensity can be specified to achieve an artistic expression that harmonizes with the scene.
[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0014] Figure 1 A flowchart illustrating a method for processing a gemstone model according to an exemplary embodiment of this disclosure is shown. Figure 2 A schematic diagram of the disassembled original gem model according to a specific embodiment of the present disclosure is shown; Figure 3 A schematic diagram showing the material disassembly of the various parts of a gemstone according to a specific embodiment of the present disclosure is shown; Figure 4 A schematic diagram is shown illustrating the filling of color blocks of different brightness on the model UV of a gemstone top sub-model according to a specific embodiment of the present disclosure; Figure 5 A schematic flowchart illustrating the highlighting of the top color block of a gemstone according to an exemplary embodiment of this disclosure is shown; Figure 6 A schematic diagram illustrating the determination of the lightness intersection range according to a specific embodiment of the present disclosure is shown; Figure 7 A schematic diagram of the gemstone top material according to a specific embodiment of the present disclosure is shown; Figure 8 A schematic diagram of the gemstone top material according to another specific embodiment of the present disclosure is shown; Figure 9 A schematic diagram of the base material of a gemstone according to a specific embodiment of the present disclosure is shown; Figure 10 A schematic diagram showing the superimposed material effect of the gemstone base according to a specific embodiment of the present disclosure is shown; Figure 11 A schematic diagram of the center point of a model UV according to a specific embodiment of the present disclosure is shown; Figure 12 A schematic diagram of the internal glitter texture of a gemstone according to a specific embodiment of the present disclosure is shown; Figure 13 A schematic diagram illustrating the process of controlling the color change of a portion of the color block in the internal glitter texture map of a gemstone according to an exemplary embodiment of this disclosure is shown. Figure 14 A schematic diagram illustrating the effect of a gemstone model according to a specific embodiment of the present disclosure is shown; Figure 15 A block diagram of a gemstone model processing apparatus according to an exemplary embodiment of the present disclosure is shown; Figure 16 A schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present disclosure is shown. Detailed Implementation
[0015] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0016] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0017] In some related embodiments, there are the following difficulties in representing the fire of gems in the game: 1. To simulate realistic fire effects in a renderer, it is necessary to accurately calculate the multiple refractions, dispersions, and reflections of light within complex faceted structures. This involves a huge amount of computation, and even in offline renderers that pursue physical accuracy and can render single frames for long periods of time (such as V-Ray, Arnold, Renderman), it is still a computationally intensive task, and achieving high-precision simulation is very costly.
[0018] 2. The game requires millisecond-level rendering. Performing complex ray tracing and precise dispersion calculations is a computational burden that current mainstream hardware cannot handle in real time. Achieving realistic fire and color in a real-time rendering (game engine) environment presents an almost insurmountable challenge.
[0019] 3. Limitations of the BRDF (Bidirectional Reflectance Distribution Function) model. The standard PBR material model (BRDF) mainly deals with diffuse reflection and single specular reflection (usually monochromatic or simple color mixing), and cannot natively support multi-wavelength independent reflection behavior caused by dispersion.
[0020] 4. Unstable light sources. Realistic fire effects are most pronounced under direct, strong point light sources (such as spotlights or the sun). Game scenes have complex lighting (ambient light, area light sources, multiple dynamic light sources), and the character / viewpoint is constantly moving, making it extremely difficult to stably and intensely trigger and represent fire effects. Simulated light sources may be insufficient in intensity, have inappropriate direction, or change too rapidly.
[0021] To address the aforementioned problems, this exemplary implementation first provides a method for processing gemstone models. (Reference) Figure 1 As shown, the above-mentioned gemstone model processing method may include the following steps: Step S110. Split the original gem model to be processed to obtain the top sub-model and the bottom sub-model of the gem.
[0022] Step S120. Fill the UV of the top sub-model of the gem with color blocks of different brightness, and control the highlighting of some color blocks according to the first brightness range related to the input viewing direction.
[0023] Step S130. Add reflective dot textures related to the input viewing direction to the base texture map of the gem's bottom sub-model, and add a gem's internal glitter texture map containing color blocks of different brightness and depth.
[0024] Step S140. Control the color change of some color blocks in the internal glitter texture map of the gemstone according to the first brightness range related to the input viewing direction.
[0025] In the gem model processing method of this exemplary embodiment, the original gem model to be processed is split into two parts: the top sub-model and the bottom sub-model are textured separately. This effectively separates the optical effects of surface reflection and internal refraction, solving the serious performance problems of fire rendering schemes and providing more flexible and magnificent gem fire effects, which is of great significance for enhancing the artistic expression of games. The gem model processing method in this exemplary embodiment achieves, on the one hand, the presentation of separate, shimmering colored light on the gem crown and inside, which can dynamically shimmer with changes in viewing angle. Compared with physically based realistic rendering methods, it can achieve more flexible artistic effects and meet the customized artistic needs of projects. On the other hand, through non-realistic rendering technology, it can achieve gorgeous artistic effects while ensuring low performance consumption, allowing it to run smoothly on mobile devices. Furthermore, it achieves fully customizable fire intensity, unaffected by real-time lighting in the game, and can stably trigger fire effects. For darker environments such as indoors and at night, the fire intensity can be specified to achieve an artistic expression that harmonizes with the scene.
[0026] Below, in conjunction with Figures 2 to 14 The steps described above in this example implementation will be explained in more detail.
[0027] In step S110, the original gem model to be processed is split into a top sub-model and a bottom sub-model.
[0028] In this example implementation, the gemstone model can be split into two parts: the top and the bottom of the gemstone. This allows for separate surface reflection and internal refraction effects to be applied to achieve a three-dimensional effect.
[0029] In this example implementation, if a dispersion effect is required, a dispersion effect model can be added. This model is used to represent the visual effect of the dispersion halo. The model creates a visual overlay effect with the gemstone body through its spatial position, avoiding interference with the rendering of the gemstone's main material.
[0030] Figure 2 A schematic diagram of the split original gemstone model according to a specific embodiment of this disclosure is shown. The split original gemstone model includes two parts: a top sub-model and a bottom sub-model. If a dispersion effect is required, a dispersion effect sheet model can be added. To achieve sharp edges, all edges of the gemstone model can also be set as sharp edges in DCC (Digital Content Creation) software.
[0031] Figure 3 A schematic diagram showing the material breakdown of the various parts of a gemstone according to a specific embodiment of the present disclosure is shown. The ground light spot decals in the top sub-model, bottom sub-model, and dispersion effect sheet model of the gemstone can be made of different materials. The internal material in the bottom sub-model of the gemstone includes a base color, small reflective dots, and internal fire.
[0032] In step S120, color blocks of different brightness are filled on the model UV of the top sub-model of the gemstone, and some color blocks are highlighted according to the first brightness range related to the input viewing direction.
[0033] In this example implementation, the model UV of the top sub-model is divided into multiple color blocks of different brightness. When the viewing angle changes, the viewing direction vector drives the brightness threshold range to change, so that the color blocks that match the reflection path of the current viewing angle are activated and highlighted, forming a dynamic flashing effect.
[0034] Figure 4 This diagram illustrates filling the UV coordinates of a gemstone top sub-model with color blocks of varying brightness according to a specific embodiment of this disclosure. From right to left, the diagram shows the gemstone top sub-model, the model UV coordinates, and the glitter texture. The gemstone top sub-model requires a glitter texture. This glitter texture is created by filling the UV coordinates of the gemstone top model with black and white blocks of varying brightness. First, the model UV coordinates are obtained based on the gemstone top sub-model in the right diagram. Then, each area of the model UV coordinates is filled with black and white blocks of varying brightness to obtain the texture shown in the left diagram.
[0035] In this example implementation, as Figure 5 As shown, highlighting certain color blocks based on a first brightness range related to the input viewing direction can specifically include the following steps: Step S510. Obtain the gaze direction vector corresponding to the input gaze direction, and determine the first brightness threshold and the second brightness threshold based on the gaze direction vector, wherein the first brightness threshold is less than the second brightness threshold.
[0036] The gaze direction vector refers to the spatial direction parameter calculated by aligning the camera direction with the gem model perpendicularly. It is used to establish a dynamic relationship between the viewing angle and the brightness threshold. The first and second brightness thresholds are the boundary values of the brightness range dynamically adjusted based on the gaze direction, used to determine the brightness filtering range for highlight display.
[0037] In this example implementation, a dynamic correspondence between viewpoint parameters and brightness thresholds is established by converting the viewing angle into a mathematical vector. When the viewing angle changes, corresponding brightness interval boundary values are calculated and generated, forming a highlight filtering range that dynamically changes with the viewing angle.
[0038] Step S520. Based on the first condition judgment node, determine the first color block whose brightness value is greater than or equal to the first brightness threshold, and based on the second condition judgment node, determine the second color block whose brightness value is less than or equal to the second brightness threshold.
[0039] Conditional decision nodes are logical operation units in the graphics rendering pipeline. They can be implemented using branch decision structures in shaders and are used to perform filtering operations on the brightness values of color blocks.
[0040] Figure 6 A schematic diagram illustrating the determination of the lightness intersection range according to a specific embodiment of this disclosure is shown. Two IF (conditional statement) nodes can be used when determining the lightness intersection range. The function of one of the IF nodes is to retain lightness values greater than or equal to B-. The color block will be smaller than B- The first part is assigned a brightness value of 0, resulting in an image where some areas are black and only a few color blocks match the color of A. The second IF node does the opposite, preserving images with brightness values less than or equal to B+. For the color blocks, assign a brightness value of 0 to the portion greater than B.
[0041] Step S530. Based on the intersection of the first color block and the second color block, obtain the color blocks within the first brightness range, and control the color blocks within the first brightness range to be highlighted.
[0042] Intersection operation refers to performing a logical AND operation on two filtering results, which can be implemented using pixel-level multiplication operations to accurately locate color block regions that simultaneously meet two threshold conditions.
[0043] In this example implementation, a dynamic correlation mechanism between brightness range and viewing direction replaces traditional ray path calculation, and discretized control of texture elements achieves fire color variations across continuous viewing angles. By establishing a dynamic mapping relationship between the viewing angle vector and dual thresholds, combined with dual condition judgments and intersection operations, the effect of continuous and smooth changes in the highlight area with the viewing angle is achieved. This solution effectively controls the GPU's computational load while ensuring visual expressiveness, avoiding screen stuttering caused by complex calculations.
[0044] In this example implementation, the vertical orientation vector corresponding to the original gem model can be obtained, and a first orientation vector can be obtained based on the camera orientation vector and the vertical orientation vector; the first orientation vector is normalized to obtain the viewing orientation vector corresponding to the input viewing direction.
[0045] The vertical orientation vector is the direction vector in the model coordinate system that is perpendicular to the plane of the gem's crown, used to characterize the spatial orientation of the gem model. The camera orientation vector is the direction vector in the scene coordinate system that points from the observer's viewpoint to the center of the model. It can be calculated by the difference between the camera position and the coordinates of the model's center point, and is used to reflect dynamic changes in viewpoint.
[0046] Figure 7 This is a schematic diagram of the material at the top of the gemstone. The core logic of this material is to filter by brightness range, highlighting color blocks within a certain brightness range each time. For example, assuming the brightness value of the largest color block in the center of the glitter texture is 0.85, when highlighting color blocks within the brightness range of 0.8 to 0.9, these color blocks are used as a mask, setting their self-illumination value to 10, while the rest are set to 0. This results in the central color block shining, while the rest remain unlit, as shown in the diagram. Figure 8 As shown.
[0047] In this example implementation, by establishing a connection mechanism between the model coordinate system and the observation coordinate system, the structural characteristics of the gemstone itself and the dynamic viewing angle parameters are vector-superimposed to generate a composite direction vector. This vector contains both the inherent spatial attributes of the model and incorporates real-time viewing angle change data, forming a synthetic direction parameter with physical meaning. This dual mechanism of composite vector space and normalization processing effectively solves the problem of parameter jumps caused by coordinate system switching under dynamic viewing angles, ensuring that the fire triggering area and the observation direction maintain precise correspondence.
[0048] Continue to refer to Figure 1 As shown, in step S130, reflective dot textures related to the input viewing direction are added to the base texture map of the gem's bottom sub-model, and a gem's internal glitter texture map containing color blocks of different brightness and depth is added.
[0049] In this example implementation, reflective dot texture refers to a highlight pattern with direction-sensitive characteristics, used to generate a dynamically moving light spot effect. Flake texture map refers to a set of discrete color patches containing multiple layers of depth information, used to construct a multi-layered light refraction visual effect.
[0050] Figure 9 A schematic diagram of the base material of a gemstone according to a specific embodiment of the present disclosure is shown. Figure 10 A schematic diagram of the overlay of a gemstone's base material effect is shown according to a specific embodiment of this disclosure. The internal material effect of the gemstone's base is divided into three parts: base color, small reflective points, and internal fire. The base color is a basic diamond texture map, input through the Basecolor channel. The self-illumination channel is the result of overlaying the small reflective points with the internal fire. This material only uses the base color and the self-illumination channel.
[0051] In this example implementation, the texture rotation angle can be determined based on the input viewing direction, and the reflective point texture can be displayed on the base texture map of the gem bottom sub-model based on the center point of the model UV and the texture rotation angle.
[0052] Texture rotation angle refers to the rotation angle parameter of the reflective point texture in the model's UV space. This angle parameter is used to align the display direction of the reflective point texture with the viewing angle. The center point of the model's UV refers to the coordinate position corresponding to the geometric center of the gem's bottom sub-model in the UV unfolded diagram. This center point serves as the rotation reference point for the reflective point texture, ensuring that texture transformations revolve around the geometry of the gem's bottom.
[0053] Figure 11 A schematic diagram of the center point of a model UV according to a specific embodiment of the present disclosure is shown, illustrating the location of the center point (0.5, 0.5) of the model UV.
[0054] Specifically, a rotation angle parameter reflecting changes in the viewing angle is generated by inputting the viewing direction vector. This rotation angle is mapped to the UV space and drives the reflective point texture to rotate around the UV center point, ensuring that the distribution direction of the reflective points always dynamically matches the current viewing angle. During real-time rendering, the rotation angle of the reflective point texture is continuously updated according to changes in the viewing angle, avoiding deviations in the texture display direction from physical optical laws due to viewing angle shifts. Based on this solution, the problem of dynamic distortion of the fire effect caused by the mismatch between the reflective point texture at the bottom of the gemstone and the viewing angle is solved. It enables the reflective point texture to automatically adjust its display direction with changes in the viewing angle, maintaining consistency between the fire effect and the real optical reflection path during dynamic observation, while avoiding performance losses caused by complex ray tracing calculations.
[0055] In this example implementation, the UV mapping of the gemstone's bottom sub-model can also be distorted based on the black-and-white desaturated base texture map; and the output of the reflective point texture can be enhanced with contrast through the fast contrast node.
[0056] Black and white desaturated base texture maps refer to converting color texture maps into grayscale images that retain only luminance information. By removing hue and saturation information, color distortion caused by subsequent UV distortion operations is avoided.
[0057] For the output of the rotated node, a black-and-white desaturated diamond texture map (the same map as the base color) can be added to slightly distort the UVs. This setting makes the reflective points slightly distorted during rotation due to the influence of the base color diamond texture, allowing you to feel the distortion caused by the facets of the diamond, resulting in a more realistic effect. Finally, further contrast enhancement is applied to the final output of the small reflective points to make their edges sharper.
[0058] Specifically, in the UV distortion stage of the model, the base texture map after black and white desaturation serves as a reference for UV coordinate offset. The amount of UV coordinate displacement is controlled by grayscale values to simulate the bending effect of light paths caused by internal refraction of a gemstone. This processing ensures that the reflective point texture undergoes optically compliant deformation when the viewing angle changes, avoiding texture stretching distortion caused by mechanical displacement. In the contrast enhancement stage, the fast contrast node performs dynamic range optimization on the UV-distorted reflective point texture. By compressing the brightness distribution in the midtone areas, the brightness values in the highlight core areas are shifted towards the white end, while maintaining the black purity in the shadow areas, thus forming sharper light spot edges and clearer light-dark transitions. By eliminating color interference through UV distortion of the grayscale reference, combined with the dynamic contrast enhancement mechanism, the viewing angle responsive optimization of the reflective point texture is achieved while ensuring color accuracy.
[0059] In this example embodiment, the size of the color block in the internal glitter texture map of the gemstone is proportional to the distance between the color block and the center of the internal glitter texture map of the gemstone, and the brightness value of the color block is inversely proportional to the depth of the color block in the internal glitter texture map of the gemstone.
[0060] Figure 12 A schematic diagram of the internal glitter texture of a gemstone according to a specific embodiment of the present disclosure is shown. This glitter texture is specially designed to create a sense of depth, with smaller glitter particles closer to the center and larger particles closer to the edges. Furthermore, the bottom glitter particles are darker, while the top glitter particles are brighter.
[0061] In this example implementation, a glitter texture with a sense of spatial hierarchy can be generated in a mobile hardware environment simply by texture sampling and channel calculation. The brightness attenuation mechanism effectively simulates the propagation loss of light in the medium, so that the internal structure of the gemstone presents a natural optical depth effect without the need for physical simulation, significantly reducing the computational load of real-time rendering.
[0062] Continue to refer to Figure 1 As shown, in step S140, the color of some color blocks in the internal glitter texture map of the gemstone is controlled to change according to a first brightness range related to the input viewing direction.
[0063] In this example implementation, the bottom sub-model forms a refracted light spot with a sense of depth on the base map by superimposing reflective dot textures and multi-layer glitter textures. Changes in the viewing direction trigger color shifts in color blocks at different depth layers, producing a spectral separation phenomenon similar to dispersion.
[0064] In this example implementation, as Figure 13 As shown, the color of certain color blocks in the internal glitter texture map of the gemstone is controlled to change according to a first brightness range related to the input viewing direction. Specifically, this may include the following steps: Step S1310. Determine the color blocks within the first brightness range based on the input viewing direction, and color the color blocks within the first brightness range using a glitter coloring diagram.
[0065] The first brightness range refers to the brightness interval dynamically determined according to the direction of the view. The glitter color map refers to a texture map containing a preset color distribution, which is used to give the glitter area basic color characteristics.
[0066] Step S1320. Perform hue shift processing on the stained color block through the hue shift node, wherein the hue shift parameter of the hue shift node is related to the input viewing direction.
[0067] A hue offset node is a shader node whose hue parameter can be adjusted to dynamically change the hue value of a glitter color.
[0068] Specifically, during real-time rendering, the viewing direction vector is continuously acquired and input into the brightness determination module. When the viewing direction changes, the system automatically updates the upper and lower thresholds of the first brightness range, filtering out glitter color blocks within that brightness range. The selected color blocks are first given a basic coloring using a glitter tint map, which can predefine the color tendencies of different areas. Subsequently, the hue offset node calculates the offset angle based on the current viewing direction, causing the same glitter area to exhibit a gradual hue change under different viewing angles.
[0069] In this example implementation, the original gem model and the dispersion effect piece model can be combined; wherein, the dispersion effect piece model is located at the bottom of the original gem model, and the dispersion effect piece model contains a dispersion halo map, which is input through a self-illuminating channel.
[0070] The dispersion halo map uses a radially gradient color texture, which can be tiled onto the surface of the dispersion effect model via UV mapping. The self-illuminating channel refers to the output channel in the material shader that is independent of lighting calculations; this channel allows direct control of the brightness parameters of the dispersion halo map. This method bypasses the reflectivity calculation step in traditional lighting models, eliminating the need for complex ray tracing.
[0071] During rendering, the self-illuminating channel directly reads the RGB values of the dispersive halo map and dynamically adjusts the channel intensity coefficient based on the viewing angle. When the viewing angle changes, the halo color shift drives the texture sampling coordinate shift through vector calculation, producing a dynamic effect of spectral separation. Therefore, the rendering of the dispersive halo is completely independent of the gemstone's lighting reflection calculation process, requiring only basic texture sampling and color blending operations.
[0072] In this example implementation, replacing real-time optical calculations with a pre-baked dispersive halo map can significantly reduce rendering time while maintaining the visual effect of color gradient halos.
[0073] Figure 14 The diagram illustrates the effect of a gemstone model according to a specific embodiment of the present disclosure. The processed top sub-model of the gemstone can produce a dynamic shimmering effect at the top, the processed bottom sub-model of the gemstone can produce reflective points and internal fire effects at the bottom, and the ground light spots can be obtained from the dispersion effect sheet model. By combining the processed top sub-model of the gemstone, the bottom sub-model of the gemstone, and the dispersion effect sheet model, a final effect can be achieved where the gemstone crown and interior exhibit separate, shimmering colored light that can dynamically shimmer with changes in the line of sight and also present a dispersion halo on the ground.
[0074] It should be noted that although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0075] Furthermore, this disclosure also provides a processing apparatus for a gemstone model. (See reference) Figure 15As shown, the processing device for the gemstone model may include a gemstone model splitting module 1510, a color block highlighting control module 1520, a reflective texture adding module 1530, and a color block color control module 1540. Wherein: The gem model splitting module 1510 can be used to split the original gem model to be processed, and obtain the top sub-model and the bottom sub-model of the gem. The color block highlighting control module 1520 can be used to fill the model UV of the top sub-model of the gem with color blocks of different brightness, and control the highlighting of some color blocks according to the first brightness range related to the input viewing direction. The reflective texture addition module 1530 can be used to add reflective point textures related to the input viewing direction on the base texture map of the gem's bottom sub-model, and add internal glitter texture maps of gem containing color blocks of different brightness and depth. The color control module 1540 can be used to control the color change of some color blocks in the internal glitter texture map of a gemstone according to a first brightness range related to the input viewing direction.
[0076] In some exemplary embodiments of this disclosure, the gemstone model processing apparatus provided by this disclosure may further include a dispersion effect sheet model combination module, which can be used to combine the original gemstone model with the dispersion effect sheet model; wherein, the dispersion effect sheet model is located at the bottom of the original gemstone model, and the dispersion effect sheet model contains a dispersion halo map, which is input through a self-illuminating channel.
[0077] In some exemplary embodiments of this disclosure, the color block highlighting control module 1520 may include a brightness threshold determination unit, a color block threshold filtering unit, and a color block highlighting display unit. Wherein: The brightness threshold determination unit can be used to obtain the gaze direction vector corresponding to the input gaze direction, and determine the first brightness threshold and the second brightness threshold based on the gaze direction vector, wherein the first brightness threshold is less than the second brightness threshold. The color block threshold filtering unit can be used to determine the first color block whose brightness value is greater than or equal to the first brightness threshold based on the first condition judgment node, and to determine the second color block whose brightness value is less than or equal to the second brightness threshold based on the second condition judgment node. The color block highlighting unit can be used to obtain color blocks within a first brightness range based on the intersection of the first color block and the second color block, and control the color blocks within the first brightness range to be highlighted.
[0078] In some exemplary embodiments of this disclosure, the brightness threshold determination unit may include a first direction vector determination unit and a viewing direction vector determination unit. Wherein: The first direction vector determination unit can be used to obtain the vertical orientation vector corresponding to the original gem model, and obtain the first direction vector based on the camera direction vector and the vertical orientation vector; The line-of-sight direction vector determination unit can be used to normalize the first direction vector to obtain the line-of-sight direction vector corresponding to the input line-of-sight direction.
[0079] In some exemplary embodiments of this disclosure, the reflective texture adding module 1530 may include a texture rotation angle determining unit and a reflective dot texture display unit. Wherein: The texture rotation angle determination unit can be used to determine the texture rotation angle based on the input viewing direction. The reflective dot texture display unit can be used to display reflective dot textures on the base texture map of the gem bottom sub-model based on the center point and texture rotation angle of the model UV.
[0080] In some exemplary embodiments of this disclosure, the reflective texture adding module 1530 may further include a distortion processing unit and a contrast enhancement unit. Wherein: The distortion processing unit can be used to distort the UVs of the bottom sub-model of a gem based on a black-and-white desaturated base texture map; The contrast enhancement unit can be used to enhance the contrast of the output of reflective point textures through the fast contrast node.
[0081] In some exemplary embodiments of this disclosure, the color block color control module 1540 may include a color block coloring unit and an offset processing unit. Wherein: The color block coloring unit can be used to determine color blocks within a first brightness range based on the input viewing direction, and to color the color blocks within the first brightness range using a glitter coloring map; The offset processing unit can be used to perform hue offset processing on the stained color blocks through the hue offset node, wherein the hue offset parameter of the hue offset node is related to the input viewing direction.
[0082] The specific details of each module / unit in the above-mentioned gemstone model processing device have been described in detail in the corresponding method embodiment section, and will not be repeated here.
[0083] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0084] Figure 16 A schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present disclosure is shown.
[0085] It should be noted that, Figure 16 The computer system 1600 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0086] like Figure 16 As shown, the computer system 1600 includes a central processing unit (CPU) 1601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1602 or programs loaded from storage portion 1608 into random access memory (RAM) 1603. The RAM 1603 also stores various programs and data required for system operation. The CPU 1601, ROM 1602, and RAM 1603 are interconnected via a bus 1604. An input / output (I / O) interface 1605 is also connected to the bus 1604.
[0087] The following components are connected to I / O interface 1605: an input section 1606 including a keyboard, mouse, etc.; an output section 1607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a LAN card, modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to I / O interface 1605 as needed. Removable media 1611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1610 as needed so that computer programs read from them can be installed into storage section 1608 as needed.
[0088] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1609, and / or installed from removable medium 1611. When the computer program is executed by central processing unit (CPU) 1601, it performs various functions defined in the system of this disclosure.
[0089] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the above-described gemstone model processing method.
[0090] In one implementation, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing a computer program, such as read-only memory, NAND flash memory, etc.
[0091] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.
[0092] Computer program code can be written in one or more programming languages. Examples of programming languages include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).
[0093] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic fields, and infrared radiation. Electronic devices can convert the signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to cause the electronic device to execute (more specifically, to execute by the processor of the electronic device) the method steps of various exemplary embodiments of this disclosure, such as the gemstone model processing method described above.
[0094] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0095] It should be noted that although several modules for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided and embodied by multiple modules.
[0096] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0097] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for processing a gemstone model, characterized in that, include: The original gem model to be processed is split into a top sub-model and a bottom sub-model. Fill the UV of the top sub-model of the gemstone with color blocks of different brightness, and control part of the color blocks to be highlighted according to a first brightness range related to the input viewing direction; Add reflective dot textures related to the input viewing direction to the base texture map of the gem's bottom sub-model, and add a gem's internal glitter texture map containing color blocks of different brightness and depth. The color of a portion of the color blocks in the internal glitter texture map of the gemstone is controlled to change according to a first brightness range related to the input viewing direction.
2. The method for processing gemstone models according to claim 1, characterized in that, The method further includes: The original gem model is combined with the dispersion effect piece model; wherein the dispersion effect piece model is located at the bottom of the original gem model, and the dispersion effect piece model contains a dispersion halo map, which is input through a self-illuminating channel.
3. The method for processing gemstone models according to claim 1, characterized in that, The step of highlighting the color blocks according to the first brightness range related to the input viewing direction includes: Obtain the gaze direction vector corresponding to the input gaze direction, and determine a first brightness threshold and a second brightness threshold based on the gaze direction vector, wherein the first brightness threshold is less than the second brightness threshold; The first color block with a brightness value greater than or equal to the first brightness threshold is determined based on the first condition judgment node, and the second color block with a brightness value less than or equal to the second brightness threshold is determined based on the second condition judgment node. Based on the intersection of the first color block and the second color block, color blocks within the first brightness range are obtained, and the color blocks within the first brightness range are controlled to be highlighted.
4. The method for processing gemstone models according to claim 3, characterized in that, The step of obtaining the gaze direction vector corresponding to the input gaze direction includes: Obtain the vertical orientation vector corresponding to the original gem model, and obtain the first direction vector based on the camera direction vector and the vertical orientation vector; The first direction vector is normalized to obtain the line-of-sight direction vector corresponding to the input line-of-sight direction.
5. The method for processing gemstone models according to claim 1, characterized in that, Adding reflective dot textures related to the input viewing direction to the base texture map of the gem's bottom sub-model includes: Determine the texture rotation angle based on the input gaze direction; Based on the center point of the model UV of the gemstone bottom sub-model and the texture rotation angle, the reflective point texture is displayed on the base texture map of the gemstone bottom sub-model.
6. The method for processing gemstone models according to claim 5, characterized in that, The method further includes: The UV mapping of the bottom sub-model of the gemstone is distorted based on the black and white desaturated base texture map; The output of the reflective point texture is enhanced by using a fast contrast node.
7. The method for processing gemstone models according to claim 1, characterized in that, The step of controlling the color change of a portion of the color blocks in the internal glitter texture map of the gemstone according to a first brightness range related to the input viewing direction includes: The color blocks within the first brightness range are determined based on the input gaze direction, and the color blocks within the first brightness range are colored using a glitter coloring diagram. The hue shifting process is performed on the stained color block by a hue shifting node, wherein the hue shifting parameter of the hue shifting node is related to the input viewing direction.
8. The method for processing gemstone models according to claim 1, characterized in that, The size of the color block in the internal glitter texture map of the gemstone is proportional to the distance between the color block and the center of the internal glitter texture map of the gemstone, and the brightness value of the color block is inversely proportional to the depth of the color block in the internal glitter texture map of the gemstone.
9. A processing device for a gemstone model, characterized in that, include: The gem model splitting module is used to split the original gem model to be processed into a top sub-model and a bottom sub-model. A color block highlighting control module is used to fill color blocks of different brightness on the model UV of the top sub-model of the gemstone, and control part of the color blocks to be highlighted according to a first brightness range related to the input viewing direction; The reflective texture addition module is used to add reflective point textures related to the input viewing direction on the base texture map of the bottom sub-model of the gemstone, and to add a gemstone internal glitter texture map containing color blocks of different brightness and different layer depths. A color control module for coloring color blocks in the internal glitter texture map of a gemstone according to a first brightness range related to the input viewing direction.
10. An electronic device, characterized in that, include: processor; as well as A memory for storing one or more programs that, when executed by the processor, cause the processor to implement the processing method for the gem model as described in any one of claims 1 to 8.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the processing method for the gemstone model as described in any one of claims 1 to 8.
