CN112184873B - Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium - Google Patents

Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112184873B
CN112184873B CN202011121660.7A CN202011121660A CN112184873B CN 112184873 B CN112184873 B CN 112184873B CN 202011121660 A CN202011121660 A CN 202011121660A CN 112184873 B CN112184873 B CN 112184873B
Authority
CN
China
Prior art keywords
dimensional
ray
coordinate data
dimensional coordinate
light ray
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011121660.7A
Other languages
Chinese (zh)
Other versions
CN112184873A (en
Inventor
黄振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011121660.7A priority Critical patent/CN112184873B/en
Publication of CN112184873A publication Critical patent/CN112184873A/en
Application granted granted Critical
Publication of CN112184873B publication Critical patent/CN112184873B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/06Ray-tracing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the invention provides a fractal graph creation method, a fractal graph creation device, electronic equipment and a storage medium, wherein the fractal graph creation method comprises the following steps: creating a three-dimensional patch model; determining a pixel plane from the three-dimensional patch model; determining a light ray departure point and a light ray departure direction based on the pixel plane; taking the light ray departure point as a starting point, and performing ray tracing calculation in the light ray departure direction to obtain target three-dimensional coordinate data; and rendering the target three-dimensional coordinate data in a coloring way to create a fractal graph. According to the embodiment of the invention, only the ray tracing and coloring rendering are needed for the pixel screen in the three-dimensional patch model, and a large amount of computing resources can be saved because the ray tracing and coloring rendering are not needed for the full screen.

Description

Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of graphic processing, in particular to a fractal graphic creation method, a fractal graphic creation device, electronic equipment and a storage medium.
Background
Fractal (Fractal) having morphological features filling the space in a non-integer dimension. Fractal is generally defined as "a rough or fragmented geometric shape, which may be divided into several parts, and each part is (at least approximately) an overall contracted shape", i.e. has self-similar properties. Among them, a pattern having the above-described special effects is called a fractal pattern.
However, the existing fractal pattern creation method has at least two disadvantages: 1. the iterative computation amount is large, the CPU thread computation capacity and the memory of lightweight equipment (such as a mobile phone, a tablet computer and the like) are limited, and the data of the parting graph after multiple iterations can not be almost carried; 2. display pixel loading details are limited and the very large number of vertex data transfer operations are wasteful of performance and unnecessary.
As such, the main implementation means of the fractal graph is that the CPU only transmits necessary parameters, and the calculation iteration process of the fractal graph is handed to the GPU thread, however, even though the GPU calculation iteration process still does not avoid the ultra-high frame rate delay caused by a large amount of calculation, for example, the real-time application is generally required to be 30FPS, that is, the calculation time of each frame is maximally 33.33 … milliseconds. As can be seen, the current desire to create fractal patterns still requires a significant amount of computing resources.
Disclosure of Invention
In view of the foregoing, embodiments of the present invention have been made to provide a fractal pattern creation method and a corresponding fractal pattern creation apparatus, electronic device, storage medium, which overcome or at least partially solve the foregoing problems.
In order to solve the above problems, an embodiment of the present invention discloses a fractal graph creation method, which includes:
creating a three-dimensional patch model;
determining a pixel plane from the three-dimensional patch model;
Determining a light ray departure point and a light ray departure direction based on the pixel plane;
taking the light ray departure point as a starting point, and performing ray tracing calculation in the light ray departure direction to obtain target three-dimensional coordinate data;
and rendering the target three-dimensional coordinate data in a coloring way to create a fractal graph.
Optionally, the determining a pixel plane from the three-dimensional patch model includes:
Determining a corresponding surface patch of the three-dimensional surface patch model in a plane formed by an X axis and a Y axis in a world space coordinate system;
The patch is taken as a pixel plane.
Optionally, the step of using the patch as a pixel plane includes:
And taking the uncovered area in the patch as a pixel plane.
Optionally, the determining the light ray departure point and the light ray departure direction based on the pixel plane includes:
Constructing a depth value in a world space coordinate system;
forming first three-dimensional coordinate data based on the depth value and plane coordinate data of the patch;
multiplying the first three-dimensional coordinate data by a preset inverse matrix to obtain light emitting points, wherein the inverse matrix is an inverse matrix between a view space coordinate system and the world space coordinate system.
Optionally, the determining the light ray departure point and the light ray departure direction based on the pixel plane includes:
Acquiring three-dimensional coordinate data of a lens of an observation camera as second three-dimensional coordinate data;
And multiplying the second three-dimensional coordinate data by a preset inverse matrix to obtain the light ray departure direction.
Optionally, the performing ray tracing calculation in the ray departure direction with the ray departure point as a starting point to obtain target three-dimensional coordinate data includes:
Taking the light ray departure point as a starting point, and performing ray tracing calculation in the light ray departure direction;
And when the ray tracing calculation reaches a preset ray detection iteration number, taking a calculation result of the ray tracing calculation as target three-dimensional coordinate data.
Optionally, the rendering the three-dimensional coordinate data of the target to create a fractal graph includes:
and performing solid color coloring rendering on the target three-dimensional coordinate data based on the semi-Lanbert illumination model.
The embodiment of the invention discloses a fractal graph creation device, which comprises:
The three-dimensional surface patch model creation module is used for creating a three-dimensional surface patch model;
A pixel plane determining module for determining a pixel plane from the three-dimensional patch model;
The tracking data determining module is used for determining a light ray departure point and a light ray departure direction based on the pixel plane;
The ray tracing calculation module is used for carrying out ray tracing calculation in the ray departure direction by taking the ray departure point as a starting point to obtain target three-dimensional coordinate data;
and the coloring rendering module is used for coloring and rendering the three-dimensional coordinate data of the target so as to create a fractal graph.
The embodiment of the invention discloses an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps of the fractal graph creation method when being executed by the processor.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program realizes the steps of the fractal graph creation method when being executed by a processor.
The embodiment of the invention has the following advantages:
In the embodiment of the invention, a pixel plane is determined from a three-dimensional surface patch model to determine a light departure point and a light departure direction, then light tracing calculation is performed in the light departure direction by taking the light departure point as a starting point to obtain target three-dimensional coordinate data, and finally coloring rendering is performed on the target three-dimensional coordinate data to create a fractal graph. The embodiment of the invention only needs to carry out ray tracing and coloring rendering on the plane pixels in the screen in the three-dimensional patch model, so compared with the current creation method which needs full-screen ray tracing and coloring rendering, a great deal of computing resources can be saved.
Drawings
Fig. 1 is a flow chart of steps of an embodiment of a fractal pattern creation method of the present invention;
FIG. 2 is a schematic representation of the patch of a three-dimensional patch model of the present invention at UV coordinates;
FIG. 3 is a schematic illustration of a three-dimensional dough model of the present invention, prior to being uncovered;
FIG. 4 is a schematic illustration of a three-dimensional dough model of the present invention, prior to being uncovered;
FIG. 5 is a schematic diagram of a fractal pattern corresponding to a different number of iterations of radiation detection in accordance with the present invention;
fig. 6 is a schematic diagram of a fractal pattern of the present invention;
fig. 7 is a block diagram showing the construction of an embodiment of a fractal pattern creating apparatus of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
The fractal graph creation method in the embodiment of the application can be operated on terminal equipment or a server. The terminal device may be a local terminal device. When the fractal pattern creation method is run as a server, it may be a cloud game.
In an alternative embodiment, cloud gaming refers to a game style based on cloud computing. In the running mode of the cloud game, a running main body of the game program and a game picture presentation main body are separated, the storage and the running of the fractal graph creation method are completed on a cloud game server, and the cloud game client is used for receiving and sending data and presenting game pictures, for example, the cloud game client can be a display device with a data transmission function, such as a mobile terminal, a television, a computer, a palm computer and the like, which is close to a user side; the terminal device for processing game data is a cloud game server in the cloud. When playing a game, a player operates the cloud game client to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, codes and compresses data such as game pictures and the like, returns the data to the cloud game client through a network, and finally decodes the data through the cloud game client and outputs the game pictures.
In an alternative embodiment, the terminal device may be a local terminal device. The local terminal device stores a game program and is used for presenting game pictures. The local terminal device is used for interacting with the player through the graphical user interface, namely, conventionally downloading and installing the game program through the electronic device and running. The manner in which the local terminal device provides the graphical user interface to the player may include a variety of ways, for example, may be rendered for display on a display screen of the terminal, or provided to the player by holographic projection. For example, the local terminal device may include a display screen for presenting a graphical user interface including game visuals, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
First, technical terms related to the embodiments of the present invention are described: ray tracing (RAY TRACER): in computer graphics, ray tracing is a rendering technique for generating images by tracing the path of light in pixel planes in pixel units and simulating the effect of its meeting a virtual object. Ray tracing is capable of producing a high degree of Visual realism compared to scanline rendering methods, which makes ray tracing most suitable for applications where longer-time rendering can be tolerated, such as in computer-generated still images and Visual effects (VFX) of movies and television, where the rate of rendering each frame is critical, ray tracing is capable of simulating various optical effects such as reflection and refraction, scattering and dispersion phenomena (e.g., chromatic aberration).
Referring to fig. 1, a step flow chart of an embodiment of a fractal graph creation method of the present invention is shown, and the embodiment of the present invention may specifically include the following steps:
step 101, creating a three-dimensional patch model.
Step 102, determining a pixel plane from the three-dimensional patch model.
And step 103, determining a light ray departure point and a light ray departure direction based on the pixel plane.
And 104, taking the light ray departure point as a starting point, and performing ray tracing calculation in the light ray departure direction to obtain target three-dimensional coordinate data.
And 105, coloring and rendering the three-dimensional coordinate data of the target to create a fractal graph.
In the embodiment of the invention, a pixel plane is determined from a three-dimensional surface patch model to determine a light departure point and a light departure direction, then light tracing calculation is performed in the light departure direction by taking the light departure point as a starting point to obtain target three-dimensional coordinate data, and finally coloring rendering is performed on the target three-dimensional coordinate data to create a fractal graph. The embodiment of the invention only needs to carry out ray tracing and coloring rendering on the plane pixels in the screen in the three-dimensional patch model, so compared with the current creating method which needs full screen ray tracing and coloring rendering, a great deal of calculation time can be saved.
Next, a fractal pattern creation method in the present exemplary embodiment will be further described with reference to fig. 2 to 6.
In step 101, a three-dimensional patch model is created.
The embodiment of the invention relies on an engine capable of programming data, any engine capable of programming data can be used as a practical scene, for example, uinty D engine, and various types of graphics, such as 2D graphics or 3D graphics, can be created in real time based on data processing knowledge data and mathematical knowledge data existing in the Uinty3D engine.
Specifically, the embodiment of the invention can newly build a three-dimensional surface patch model in the world space coordinate system of the Uinty D engine or make and import the three-dimensional surface patch model through other software. Wherein, X-axis and Y-axis in the world space coordinate system represent the length and width of the three-dimensional surface patch model, and Z-axis represents the height of the three-dimensional surface patch model.
In the embodiment of the invention, the projection of the three-dimensional patch model on a certain plane in the world space coordinate system is a patch, wherein for the patch of the three-dimensional patch model on an XY plane formed by the X axis and the Y axis in the world space coordinate system, the patch can be mapped to UV coordinates through UV mapping. Specifically, the UV coordinates refer to a plane in which all graphics are two-dimensional, U represents a horizontal direction, and V represents a vertical direction, corresponding to X-axis and Y-axis of the world space coordinate system. Referring to fig. 2, a schematic view of a three-dimensional patch model according to the present invention in UV coordinates is shown, where the three-dimensional patch model is arranged in the UV plane in conformity with the XY plane, and the patch on the UV plane is a three-dimensional patch model displayed on an electronic device.
In step 102, a pixel plane is determined from the three-dimensional patch model.
The pixel plane is used for calculating the surface patch in the three-dimensional surface patch model in the fractal graph.
In an exemplary embodiment, the step 102 of determining a pixel plane from the three-dimensional patch model may include the steps of: determining a corresponding surface patch of the three-dimensional surface patch model in a plane formed by an X axis and a Y axis in a world space coordinate system; the patch is taken as a pixel plane.
Wherein, the three-dimensional patch model can be used as a pixel plane for drawing fractal graphs, namely, the patch of a UV plane in the X axis and the Y axis of a world space coordinate system, namely, the ray tracing can be performed on the pixel plane. Since full-screen ray tracing is not required, a large amount of computing resource consumption caused by ray tracing computation can be saved.
In an exemplary embodiment, the taking the patch as a pixel plane includes: and taking the uncovered area in the patch as a pixel plane.
In a real scene, other objects on the screen may obscure the three-dimensional patch model, resulting in that only part of the three-dimensional patch model can be seen on the screen, and the three-dimensional patch model of the screen can be used as a pixel plane for drawing fractal graphics, namely, the pixel plane which is not covered can be used for ray tracing. In the above example, since the embodiment of the present invention performs ray tracing only for the position that the patch can display, that is, the pixel plane covered by other objects, the computing resource consumption caused by ray tracing can be further saved.
In summary, it can be seen that, in the embodiment of the present invention, full-screen ray tracing is not required, so that a large amount of resource consumption can be saved no matter the three-dimensional patch model is covered or covered. For example, referring to fig. 3, which is a schematic view of a three-dimensional patch model that is not covered by a square, referring to fig. 4, which is a schematic view of a three-dimensional patch model that is covered by a square, in an embodiment of the present invention, only the uncovered portions of fig. 3 and 4, that is, the portions of the three-dimensional patch model that are framed in fig. 3 and 4 need to be subjected to ray tracing computation, that is, no full-screen ray tracing computation is required, and other portions are normal rendering processes, so that a large amount of computing resources can be saved.
In step 103, a light ray departure point and a light ray departure direction are determined based on the pixel plane.
After the pixel plane is determined, the light departure point and the light departure direction can be determined based on the pixel plane, so that light ray tracing is performed based on the light departure point and the light departure direction determined by the pixel plane, and further, target three-dimensional coordinate data of the fractal graph is determined.
In an exemplary embodiment, the determining the light ray departure point and the light ray departure direction based on the pixel plane in step 103 may include the following steps: constructing a depth value in a world space coordinate system; forming first three-dimensional coordinate data based on the depth value and plane coordinate data of the patch; multiplying the first three-dimensional coordinate data by a preset inverse matrix to obtain light emitting points, wherein the inverse matrix is an inverse matrix between a view space coordinate system and the world space coordinate system.
Wherein, in order to display the object in world space, the observation camera lens needs to be placed in a designated position in world space, and the object (such as all or partial object) which can be observed by the observer in world space is designated based on the observation camera lens, so that a corresponding image is generated to be displayed on the screen. The space used to define objects observed in world space is view space (also commonly referred to as camera space), where the view space coordinate transformation from the world space coordinate system of world space to view space is referred to as view transformation, and the matrix used to make the view change is referred to as inverse matrix.
First, a depth value W, which is a depth range for determining a renderable fractal image, is fictionally constructed in a world space coordinate system as a near-tangential plane of a Z-direction simulation observation camera lens. Then, the pixel plane and the depth value W determined by the three-dimensional patch model are taken as first three-dimensional coordinate data (U, V, W), the first three-dimensional coordinate data (U, V, W) is multiplied by the inverse matrix of the view space and the world space, the obtained data is taken as a light ray departure point in light ray tracing, and the light ray departure point can be marked as S. The near-cut plane is the nearest range seen by the lens of the observation camera, and specifically, if the distance between the object and the lens is less than 0.2 meter, the lens cannot capture the object, which is equivalent to the object being in a vision blind area, assuming that the near-cut plane of the lens is 0.2 meter.
In an exemplary embodiment, the determining the light ray departure point and the light ray departure direction based on the pixel plane in step 103 may include the following steps: acquiring three-dimensional coordinate data of a lens of an observation camera as second three-dimensional coordinate data; and multiplying the second three-dimensional coordinate data by a preset inverse matrix to obtain the light ray departure direction.
In the Uinty D engine, the Z-axis direction in the world space coordinate system is usually in front of the observation camera lens, so the three-dimensional coordinate data of the observation camera lens, that is, the second three-dimensional coordinate data may be (0, 1) or (0, -1). Then, the second three-dimensional coordinate data (0, -1) is multiplied by the inverse matrix of the view space and the world space, and the obtained data is used as the light ray departure direction when the light rays are traced, and the light ray departure direction can be marked as D.
In step 104, taking the light ray departure point as a starting point, performing ray tracing calculation in the light ray departure direction to obtain target three-dimensional coordinate data.
In the embodiment of the invention, the UV plane of the three-dimensional patch model can be used as a pixel plane for drawing the fractal graph, and the light ray departure point and the light ray departure direction can be determined according to the pixel plane. Then, taking the light starting point as a starting position, performing ray tracing calculation on the light starting direction of the light starting point, and further calculating to obtain new three-dimensional coordinate data, namely, the target three-dimensional coordinate data for creating the fractal graph in the embodiment of the invention, and finally performing coloring rendering on the target three-dimensional coordinate data, so that the fractal graph can be created.
In an exemplary embodiment, the step 104, taking the light ray departure point as a starting point, performs ray tracing calculation in the light ray departure direction to obtain the target three-dimensional coordinate data, may include the following steps: taking the light ray departure point as a starting point, and performing ray tracing calculation in the light ray departure direction; and when the ray tracing calculation reaches a preset ray detection iteration number, taking a calculation result of the ray tracing calculation as target three-dimensional coordinate data.
Specifically, a suitable maximum ray detection iteration number is preset, and then ray tracing calculation is performed based on the maximum ray detection iteration number, so that target three-dimensional coordinate data is calculated. For example, a ray tracing calculation is performed on D (ray departure direction) of S with S point (ray departure point) as a starting position on the pixel plane, and after reaching a preset ray detection iteration number, the obtained calculation result is saved as new three-dimensional coordinate data (target three-dimensional coordinate data), which may be denoted as P. Alternatively, the fractal graph calculation formula used in the embodiment of the present invention may be a formula of a miscanthus sphere or a formula of other fractal graphs, which is not limited in the embodiment of the present invention.
In step 105, the target three-dimensional coordinate data is rendered to create a fractal pattern.
In the embodiment of the invention, a new loader file and a material file are created in a Uinty D engine and are endowed with a three-dimensional patch model for controlling the drawing process of the GPU on a pixel plane. Specifically, in the Uinty D engine, the material file is a calculation method that needs a loader file to describe the fractal graph, and the final graph drawing result is submitted to the display, so that the drawing result of the fractal graph is displayed on the display. In brief, the three-dimensional patch model may call the calculation method in the loader file through the material file, so as to draw and display the final fractal graph on the display.
Specifically, the embodiment of the invention performs coloring rendering on the three-dimensional coordinate data of the target, and can finish the creation of the fractal graph, and the embodiment of the invention does not limit the rendering method.
In an exemplary embodiment, the step 105 of rendering the target three-dimensional coordinate data to create a fractal graph includes: and performing solid color coloring rendering on the target three-dimensional coordinate data based on the semi-Lanbert illumination model.
As a specific example, solid color rendering may be performed on the target three-dimensional coordinate data based on a half Lambert (half Lambert illumination model). In particular, lambert defines the properties of an ideal "matte" or diffusely reflective surface, which is the same apparent brightness to an observer regardless of the observer's viewing angle. Referring to fig. 5, a schematic diagram of fractal patterns corresponding to different numbers of iteration of radiation detection is shown, which is a schematic diagram of fractal patterns corresponding to different numbers of iteration of radiation detection, for example, 1,2, 5, 10, 20, 30, 50, and 100 in fig. 5, after pure color output is performed on three-dimensional coordinate data of a target and illumination is given based on half Lambert.
Of course, in addition to the semi-lambert illumination model, other ways of rendering the three-dimensional coordinate data of the target can be adopted to achieve different graphic effects, and the embodiment of the invention is not limited.
The embodiment of the invention can realize the creation of the fractal graph without consuming a large amount of computing resources. Referring to fig. 6, a schematic diagram of a fractal pattern according to an embodiment of the present invention, where the fractal pattern has self-similarity, that is, a part of the fractal pattern has a certain degree of similarity with its whole. Because the embodiment of the invention does not need to carry out ray tracing calculation on all three-dimensional patch models of the current screen, but only carries out ray tracing calculation on the patches of the three-dimensional patch models on the current screen, the consumption of calculation resources of the embodiment of the invention is only the position which can be displayed by the patches of the three-dimensional patch models, and even if the three-dimensional patch models are not covered or covered, the embodiment of the invention can save a large amount of calculation resources, so that the real-time creation of the formation graph on lightweight equipment such as mobile phones, tablet computers and the like is possible.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 7, there is shown a block diagram of an embodiment of a fractal pattern creation device according to the present invention, which may specifically include the following modules:
A three-dimensional patch model creation module 701 for creating a three-dimensional patch model;
A pixel plane determination module 702 configured to determine a pixel plane from the three-dimensional patch model;
a trace data determining module 703, configured to determine a light ray departure point and a light ray departure direction based on the pixel plane;
The ray tracing calculation module 704 is configured to perform ray tracing calculation in the ray departure direction with the ray departure point as a starting point to obtain target three-dimensional coordinate data;
And the coloring rendering module 705 is used for coloring and rendering the three-dimensional coordinate data of the target to create a fractal graph.
In a preferred embodiment of the present invention, the pixel plane determining module 702 is configured to determine a corresponding patch of the three-dimensional patch model in a plane formed by an X-axis and a Y-axis in a world space coordinate system; the patch is taken as a pixel plane.
In a preferred embodiment of the present invention, the pixel plane determining module 702 is configured to use an uncovered area in the patch as a pixel plane.
In a preferred embodiment of the present invention, the tracking data determining module 703 is configured to construct a depth value in a world space coordinate system; forming first three-dimensional coordinate data based on the depth value and plane coordinate data of the patch; multiplying the first three-dimensional coordinate data by a preset inverse matrix to obtain light emitting points, wherein the inverse matrix is an inverse matrix between a view space coordinate system and the world space coordinate system.
In a preferred embodiment of the present invention, the tracking data determining module 703 is configured to obtain three-dimensional coordinate data of the lens of the observation camera as second three-dimensional coordinate data; and multiplying the second three-dimensional coordinate data by a preset inverse matrix to obtain the light ray departure direction.
In a preferred embodiment of the present invention, the ray tracing calculation module 704 is configured to perform ray tracing calculation in the ray departure direction with the ray departure point as a starting point; and when the ray tracing calculation reaches a preset ray detection iteration number, taking a calculation result of the ray tracing calculation as target three-dimensional coordinate data.
In a preferred embodiment of the present invention, the rendering module 705 is configured to perform solid color rendering on the three-dimensional coordinate data of the target based on a semi-lambertian illumination model.
In a preferred embodiment of the invention, the invention is applied to lightweight electronic devices.
As can be seen from the above, in the embodiment of the present invention, a pixel plane is determined from a three-dimensional patch model to determine a light departure point and a light departure direction, then, ray tracing calculation is performed in the light departure direction with the light departure point as a starting point to obtain target three-dimensional coordinate data, and finally, coloring rendering is performed on the target three-dimensional coordinate data to create a fractal graph. The embodiment of the invention only needs to carry out ray tracing and coloring rendering on the plane pixel screen in the three-dimensional patch model, so compared with the current creating method which needs to carry out ray tracing and coloring rendering on a full screen, a great deal of computing resources can be saved.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention discloses an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps in the fractal graph creation method embodiment when being executed by the processor.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program realizes the steps in the fractal graph creation method embodiment when being executed by a processor.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or terminal device that comprises the element.
The above description of the fractal graph creating method, the fractal graph creating device, the electronic equipment and the storage medium provided by the invention applies specific examples to illustrate the principle and the implementation of the invention, and the description of the examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (9)

1. A fractal pattern creation method, applied to a game, said method comprising:
creating a three-dimensional patch model;
determining a pixel plane from the three-dimensional patch model;
Determining a light ray departure point and a light ray departure direction based on the pixel plane;
taking the light ray departure point as a starting point, and performing ray tracing calculation in the light ray departure direction to obtain target three-dimensional coordinate data;
coloring and rendering the three-dimensional coordinate data of the target to create a fractal graph;
wherein said determining a pixel plane from said three-dimensional patch model comprises:
Determining a corresponding surface patch of the three-dimensional surface patch model in a plane formed by an X axis and a Y axis in a world space coordinate system;
The patch is taken as a pixel plane.
2. The method of claim 1, wherein said taking the patch as a pixel plane comprises:
And taking the uncovered area in the patch as a pixel plane.
3. The method of claim 1, wherein determining a light ray departure point and a light ray departure direction based on the pixel plane comprises:
Constructing a depth value in a world space coordinate system;
forming first three-dimensional coordinate data based on the depth value and plane coordinate data of the patch;
Multiplying the first three-dimensional coordinate data by a preset inverse matrix to obtain light emitting points, wherein the inverse matrix is an inverse matrix between a view space coordinate system and the world space coordinate system.
4. A method according to claim 3, wherein said determining a light ray departure point and a light ray departure direction based on said pixel plane comprises:
Acquiring three-dimensional coordinate data of a lens of an observation camera as second three-dimensional coordinate data;
And multiplying the second three-dimensional coordinate data by a preset inverse matrix to obtain the light ray departure direction.
5. The method according to claim 1, wherein performing ray tracing calculation in the ray-starting direction with the ray-starting point as a starting point to obtain target three-dimensional coordinate data comprises:
Taking the light ray departure point as a starting point, and performing ray tracing calculation in the light ray departure direction;
And when the ray tracing calculation reaches a preset ray detection iteration number, taking a calculation result of the ray tracing calculation as target three-dimensional coordinate data.
6. The method of claim 1, wherein rendering the target three-dimensional coordinate data to create a fractal graphic comprises:
and performing solid color coloring rendering on the target three-dimensional coordinate data based on the semi-Lanbert illumination model.
7. A fractal pattern creation device, characterized by being applied to a game, said device comprising:
The three-dimensional surface patch model creation module is used for creating a three-dimensional surface patch model;
A pixel plane determining module for determining a pixel plane from the three-dimensional patch model;
The tracking data determining module is used for determining a light ray departure point and a light ray departure direction based on the pixel plane;
The ray tracing calculation module is used for carrying out ray tracing calculation in the ray departure direction by taking the ray departure point as a starting point to obtain target three-dimensional coordinate data;
the coloring rendering module is used for coloring and rendering the three-dimensional coordinate data of the target so as to create a fractal graph;
The pixel plane determining module is used for determining a corresponding surface patch of the three-dimensional surface patch model in a plane formed by an X axis and a Y axis in a world space coordinate system; the patch is taken as a pixel plane.
8. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the fractal pattern creation method of any one of claims 1-6.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the fractal pattern creation method of any one of claims 1 to 6.
CN202011121660.7A 2020-10-19 2020-10-19 Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium Active CN112184873B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011121660.7A CN112184873B (en) 2020-10-19 2020-10-19 Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011121660.7A CN112184873B (en) 2020-10-19 2020-10-19 Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112184873A CN112184873A (en) 2021-01-05
CN112184873B true CN112184873B (en) 2024-04-26

Family

ID=73921971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011121660.7A Active CN112184873B (en) 2020-10-19 2020-10-19 Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112184873B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114820910A (en) * 2021-01-21 2022-07-29 华为云计算技术有限公司 Rendering method and device
CN115731331A (en) * 2021-08-30 2023-03-03 华为云计算技术有限公司 Method and related device for rendering application
CN114066721B (en) * 2021-11-03 2024-02-02 抖音视界有限公司 Display method and device and electronic equipment
CN116681814B (en) * 2022-09-19 2024-05-24 荣耀终端有限公司 Image rendering method and electronic equipment
JP7457879B1 (en) 2023-03-16 2024-03-28 株式会社Rist Data generation method, program, data generation device, and trained model

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009044282A2 (en) * 2007-10-04 2009-04-09 Mental Images Gmbh Quasi-monte carlo light transport simulation by efficient ray tracing
CN107563088A (en) * 2017-09-14 2018-01-09 北京邮电大学 A kind of light field display device emulation mode based on Ray Tracing Algorithm
CN108090947A (en) * 2018-01-03 2018-05-29 沈阳品尚科技有限公司 A kind of ray tracing optimization method towards 3D scenes
WO2018164852A1 (en) * 2017-02-22 2018-09-13 Mine One Gmbh Image reconstruction for virtual 3d
CN111275801A (en) * 2018-12-05 2020-06-12 ***通信集团广西有限公司 Three-dimensional picture rendering method and device
CN111354066A (en) * 2020-02-25 2020-06-30 腾讯科技(深圳)有限公司 Rendering method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009044282A2 (en) * 2007-10-04 2009-04-09 Mental Images Gmbh Quasi-monte carlo light transport simulation by efficient ray tracing
WO2018164852A1 (en) * 2017-02-22 2018-09-13 Mine One Gmbh Image reconstruction for virtual 3d
CN107563088A (en) * 2017-09-14 2018-01-09 北京邮电大学 A kind of light field display device emulation mode based on Ray Tracing Algorithm
CN108090947A (en) * 2018-01-03 2018-05-29 沈阳品尚科技有限公司 A kind of ray tracing optimization method towards 3D scenes
CN111275801A (en) * 2018-12-05 2020-06-12 ***通信集团广西有限公司 Three-dimensional picture rendering method and device
CN111354066A (en) * 2020-02-25 2020-06-30 腾讯科技(深圳)有限公司 Rendering method and device

Also Published As

Publication number Publication date
CN112184873A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN112184873B (en) Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium
CN107341853B (en) Virtual-real fusion method and system for super-large virtual scene and dynamic screen shooting
CN112840378B (en) Global illumination interacting using shared illumination contributions in path tracking
CN110889890A (en) Image processing method and device, processor, electronic device and storage medium
Fender et al. Optispace: Automated placement of interactive 3d projection mapping content
CN113674389B (en) Scene rendering method and device, electronic equipment and storage medium
US9183654B2 (en) Live editing and integrated control of image-based lighting of 3D models
WO2022063260A1 (en) Rendering method and apparatus, and device
CN109979013B (en) Three-dimensional face mapping method and terminal equipment
CN111739142A (en) Scene rendering method and device, electronic equipment and computer readable storage medium
CN116485984B (en) Global illumination simulation method, device, equipment and medium for panoramic image vehicle model
JP2012190428A (en) Stereoscopic image visual effect processing method
CN110634178A (en) Three-dimensional scene refinement reconstruction method for digital museum
CA3199390A1 (en) Systems and methods for rendering virtual objects using editable light-source parameter estimation
US20240087219A1 (en) Method and apparatus for generating lighting image, device, and medium
CN116758208A (en) Global illumination rendering method and device, storage medium and electronic equipment
CN111161398A (en) Image generation method, device, equipment and storage medium
CN113546410B (en) Terrain model rendering method, apparatus, electronic device and storage medium
KR102108244B1 (en) Image processing method and device
CN116912387A (en) Texture map processing method and device, electronic equipment and storage medium
CN111862338B (en) Display method and device for simulated eyeglass wearing image
US11361477B2 (en) Method for improved handling of texture data for texturing and other image processing tasks
CN115359172A (en) Rendering method and related device
CN108846897B (en) Three-dimensional model surface material simulation method and device, storage medium and electronic equipment
CN114820980A (en) Three-dimensional reconstruction method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant