CN112184873A - Fractal graph creating method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN112184873A
CN112184873A CN202011121660.7A CN202011121660A CN112184873A CN 112184873 A CN112184873 A CN 112184873A CN 202011121660 A CN202011121660 A CN 202011121660A CN 112184873 A CN112184873 A CN 112184873A
Authority
CN
China
Prior art keywords
coordinate data
dimensional
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.)
Granted
Application number
CN202011121660.7A
Other languages
Chinese (zh)
Other versions
CN112184873B (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

Images

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 creating method, a fractal graph creating device, electronic equipment and a storage medium, wherein the method comprises the following steps: creating a three-dimensional patch model; determining a pixel plane from the three-dimensional patch model; determining a light departure point and a light departure direction based on the pixel plane; taking the light starting point as a starting point, and performing ray tracing calculation in the light starting direction to obtain target three-dimensional coordinate data; and performing coloring rendering on the target three-dimensional coordinate data to create a fractal graph. According to the embodiment of the invention, only ray tracing and coloring rendering are required to be carried out on the pixel screen in the three-dimensional patch model, and since the ray tracing and coloring rendering are not required to be carried out on the full screen, a large amount of computing resources can be saved.

Description

Fractal graph creating method and 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 graph creating method, a fractal graph creating device, electronic equipment and a storage medium.
Background
Fractal (Fractal), which has morphological features that fill space in the form of non-integer dimensions. Fractal is generally defined as "a rough or fragmented geometric shape, which can be divided into several parts, and each part is (at least approximately) an overall reduced shape", i.e. has self-similar properties. Among them, a pattern having the above special effect is called a fractal pattern.
However, the existing fractal graph creation method has at least two disadvantages as follows: 1. the iterative computation amount is large, the CPU thread computation capability and the memory of lightweight equipment (such as a mobile phone, a tablet personal computer and the like) are limited, and the data of the classified graph after multiple iterations can not be borne; 2. the display pixel loading details are limited and the very large number of vertex data transfer operations is wasteful of performance and unnecessary.
Even so, the main implementation means of the fractal graph at present is that only necessary parameters are transmitted by a CPU, and the computation iterative process of the fractal graph is handed over to a GPU thread, however, even though the computation iterative process of the GPU is performed, the ultra-high frame rate delay caused by a large amount of computation is still avoided, for example, the real-time application requirement is usually 30FPS, that is, the computation time per frame is maximally no more than 33.33 … milliseconds. Therefore, a large amount of computing resources are still required to be consumed when a fractal graph is to be created at present.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a fractal drawing creation method and a corresponding fractal drawing creation apparatus, electronic device, storage medium that overcome or at least partially address the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a fractal graph creating method, including:
creating a three-dimensional patch model;
determining a pixel plane from the three-dimensional patch model;
determining a light departure point and a light departure direction based on the pixel plane;
taking the light starting point as a starting point, and performing ray tracing calculation in the light starting direction to obtain target three-dimensional coordinate data;
and performing coloring rendering on the target three-dimensional coordinate data to create a fractal graph.
Optionally, the determining a pixel plane from the three-dimensional patch model includes:
determining 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.
Optionally, the regarding the patch as a pixel plane includes:
and taking the uncovered area of the patch as a pixel plane.
Optionally, the determining a light departure point and a light 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 values and the plane coordinate data of the patches;
and multiplying the first three-dimensional coordinate data by a preset reversal matrix to obtain a light starting point, wherein the reversal matrix is a reversal matrix between a view space coordinate system and the world space coordinate system.
Optionally, the determining a light departure point and a light 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 reversal matrix to obtain the light starting direction.
Optionally, the obtaining target three-dimensional coordinate data by performing ray tracing calculation in the light departure direction with the light departure point as a starting point includes:
taking the light starting point as a starting point, and performing ray tracing calculation in the light starting 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 target three-dimensional coordinate data to create a fractal graph includes:
and performing pure-color rendering on the target three-dimensional coordinate data based on a half-Lambert illumination model.
The embodiment of the invention discloses a fractal graph creating device, which comprises:
the three-dimensional patch model creating module is used for creating a three-dimensional patch model;
the pixel plane determining module is used for determining a pixel plane from the three-dimensional patch model;
the tracking data determining module is used for determining a light starting point and a light starting direction based on the pixel plane;
the ray tracing calculation module is used for carrying out ray tracing calculation in the starting direction of the ray by taking the starting point of the ray as a starting point to obtain target three-dimensional coordinate data;
and the coloring rendering module is used for performing coloring rendering on the target three-dimensional coordinate data to create a fractal graph.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the fractal graph creating method are realized.
The embodiment of the invention discloses a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the fractal graph creating method are realized.
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 starting point and a light starting direction, then, the light starting point is taken as a starting point, light tracking calculation is carried out in the light starting direction to obtain target three-dimensional coordinate data, and finally, the target three-dimensional coordinate data is colored and rendered to create a fractal graph. The embodiment of the invention only needs to perform ray tracing and coloring rendering on the plane pixels in the screen in the three-dimensional patch model, so compared with the existing creating method which needs to perform ray tracing and coloring rendering on the full screen, a large amount of computing resources can be saved.
Drawings
FIG. 1 is a flow chart of the steps of an embodiment of a fractal graph creation method of the present invention;
FIG. 2 is a schematic illustration of patches at UV coordinates of a three-dimensional patch model of the present invention;
FIG. 3 is a schematic representation of a three-dimensional patch model of the present invention before it is occluded;
FIG. 4 is a schematic representation of a three-dimensional patch model of the present invention before it is masked;
FIG. 5 is a diagram of fractal graphs corresponding to different ray detection iteration numbers according to the present invention;
FIG. 6 is a schematic illustration of a fractal pattern of the present invention;
FIG. 7 is a block diagram of a fractal pattern creation apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The fractal graph creating 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 graph creation method is operated as a server, a cloud game can be realized.
In an alternative embodiment, cloud gaming refers to a cloud computing-based gaming mode. In the running mode of the cloud game, a running main body of a game program and a game picture presenting main body are separated, the storage and the running of the fractal graph creating method are completed on a cloud game server, and a cloud game client is used for receiving and sending data and presenting a game picture, for example, the cloud game client can be a display device with a data transmission function close to a user side, such as a mobile terminal, a television, a computer, a palm computer and the like; however, the terminal device performing the game data processing is a cloud game server in the cloud. When a game is played, 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, data such as game pictures and the like are encoded and compressed, the data are returned to the cloud game client through a network, and finally the data are decoded through the cloud game client and the game pictures are output.
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 a game screen. The local terminal device is used for interacting with the player through a graphical user interface, namely, a game program is downloaded and installed and operated through an electronic device conventionally. The manner in which the local terminal device provides the graphical user interface to the player may include a variety of ways, for example, it may be rendered for display on a display screen of the terminal or provided to the player through holographic projection. For example, the local terminal device may include a display screen for presenting a graphical user interface including a game screen and a processor for running the game, generating the graphical user interface, and controlling display of the graphical user interface on the display screen.
First, technical terms related to the embodiments of the present invention are introduced: ray tracing (Ray tracker): in computer graphics, ray tracing is a rendering technique for generating an image by tracing a path of light in units of pixel points in a pixel plane and simulating an effect that it meets a virtual object. Ray tracing can produce a high degree of Visual realism compared to scan-line rendering methods, which makes ray tracing most suitable for applications that can tolerate longer-time rendering, such as in computer-generated still images and Visual effects (VFX) for movies and television, where the rate at which each frame is rendered is critical in real-time applications, and can simulate various optical effects such as reflection and refraction, scattering and dispersion phenomena (e.g. chromatic aberrations).
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a fractal graph creation method according to the present invention is shown, where the embodiment of the present invention may specifically include the following steps:
step 101, creating a three-dimensional patch model.
And 102, determining a pixel plane from the three-dimensional patch model.
And 103, determining a light starting point and a light starting direction based on the pixel plane.
And step 104, taking the light starting point as a starting point, and performing ray tracing calculation in the light starting direction to obtain target three-dimensional coordinate data.
And 105, performing coloring rendering on the target three-dimensional coordinate data 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 starting point and a light starting direction, then, the light starting point is taken as a starting point, light tracking calculation is carried out in the light starting direction to obtain target three-dimensional coordinate data, and finally, the target three-dimensional coordinate data is colored and rendered to create a fractal graph. According to the method and the device, ray tracing and coloring rendering are only needed to be carried out on the plane pixels in the screen in the three-dimensional patch model, so that compared with the existing creating method which needs ray tracing and coloring rendering on the full screen, a large amount of computing time can be saved.
Hereinafter, the 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 depends on an engine capable of programming data, and any engine capable of programming data can be used as a practical scene, for example, the Uinty3D engine can process knowledge data and mathematical knowledge data based on the data in the Uinty3D engine, and can create various types of graphs, such as 2D graphs or 3D graphs in real time.
Specifically, the embodiment of the invention can newly build a three-dimensional patch model in the world space coordinate system of the uvity 3D engine, or create and import a three-dimensional patch model through other software. Wherein, X-axis and Y-axis represent the length and width of the three-dimensional patch model in the world space coordinate system, and Z-axis represents the height of the three-dimensional 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 an X axis and a Y axis of the three-dimensional patch model in the world space coordinate system, the three-dimensional patch model can be mapped onto UV coordinates through UV mapping. Specifically, the UV coordinate means a plane in which all figures are two-dimensional, U represents a horizontal direction, and V represents a vertical direction, corresponding to the X-axis and the Y-axis of the world space coordinate system. Referring to fig. 2, a schematic diagram of a patch of a three-dimensional patch model of the present invention at UV coordinates is shown, the three-dimensional patch model is arranged on a UV plane and is consistent with an XY plane, and a 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 a patch in a three-dimensional 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 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.
The three-dimensional patch model can be used as a pixel plane for drawing a fractal graph, namely ray tracing can be performed on the pixel plane, wherein the patch of the three-dimensional patch model is located on an X axis and a Y axis of a world space coordinate system, namely a UV plane. Because full-screen ray tracing is not needed, a large amount of computing resource consumption caused by ray tracing computation can be saved.
In an exemplary embodiment, the regarding the patch as a pixel plane includes: and taking the uncovered area of the patch as a pixel plane.
In an actual scene, other objects on the screen may cover the three-dimensional patch model, so that only part of the three-dimensional patch model can be seen on the screen, and at this time, the three-dimensional patch model of the screen is an area covered by other objects in the screen, and is used as a pixel plane for drawing the fractal graph, that is, ray tracing is performed on the pixel plane which is not covered. In the above example, since the embodiment of the present invention performs ray tracing only for the position where the patch can be displayed, that is, the pixel plane covered by other objects, the computational resource consumption caused by ray tracing can be further saved.
In summary, according to the embodiment of the present invention, since full-screen ray tracing is not required, a large amount of resource consumption can be saved no matter whether the three-dimensional patch model is covered or covered. For example, referring to fig. 3, which is a schematic diagram of a three-dimensional patch model not covered by a block, and referring to fig. 4, which is a schematic diagram of a three-dimensional patch model covered by a block, in the embodiment of the present invention, only the uncovered portion in fig. 3 and 4, that is, the portion of the three-dimensional patch model selected by frame in fig. 3 and 4, needs to be subjected to ray tracing calculation, that is, the full-screen ray tracing calculation is not needed, and other portions are normal rendering processes, so that a large amount of calculation resources can be saved.
In step 103, a ray departure point and a ray departure direction are determined based on the pixel plane.
After the pixel plane is determined, a light starting point and a light starting direction can be determined based on the pixel plane, and light tracking is performed according to the light starting point and the light starting direction determined based on the pixel plane, so that target three-dimensional coordinate data of the fractal graph is determined.
In an exemplary embodiment, the step 103 of determining a light departure point and a light departure direction based on the pixel plane may include the steps of: constructing a depth value in a world space coordinate system; forming first three-dimensional coordinate data based on the depth values and the plane coordinate data of the patches; and multiplying the first three-dimensional coordinate data by a preset reversal matrix to obtain a light starting point, wherein the reversal matrix is a reversal matrix between a view space coordinate system and the world space coordinate system.
In order to show an object in the world space, the observation camera lens needs to be placed in a specified position in the world space, and an object (such as all or a part of the object) which can be observed in the world space by an observer is specified based on the observation camera lens, so that a corresponding image is generated to be shown on the screen. A space for defining an object observed in the world space is a view space (also commonly referred to as a camera space), in which a view space coordinate transformation from a world space coordinate system of the world space to the view space is referred to as a view transformation, and a matrix for performing the view change is referred to as an inverse matrix.
First, a depth value W is fictitious in a world space coordinate system as a near-cutting plane of a lens of a simulated observation camera in the Z direction, and specifically, the depth value W is a depth range for determining a drawable fractal image. Then, the pixel plane and the depth value W determined by the three-dimensional patch model are used as a 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, and the obtained data is used as a ray starting point in ray tracing, and the ray starting point can be denoted as S. Specifically, if the lens grazing plane is 0.2 m, if the distance between the object and the lens is less than 0.2 m, the lens cannot capture the object, which is equivalent to the object being in the blind area.
In an exemplary embodiment, the step 103 of determining a light departure point and a light departure direction based on the pixel plane may include the steps of: 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 reversal matrix to obtain the light starting direction.
In the maintenance engine of the Uinty3D, the front side of the observation camera lens is generally the Z-axis direction in the world space coordinate system, and therefore the three-dimensional coordinate data of the observation camera lens, i.e., the second three-dimensional coordinate data may be (0, 0, 1) or (0, 0, -1). Then, the second three-dimensional coordinate data (0, 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 departure direction when the light ray is traced, and the light departure direction can be recorded as D.
In step 104, taking the light departure point as a starting point, performing ray tracing calculation in the light departure direction to obtain target three-dimensional coordinate data.
In the embodiment of the invention, the UV plane of the three-dimensional surface patch model can be used as a pixel plane for drawing the fractal graph, and the light starting point and the light starting direction can be determined according to the pixel plane. Then, taking the light departure point as the starting position, performing ray tracing calculation on the light departure direction of the light departure point, and further calculating to obtain new three-dimensional coordinate data, namely, 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 creation of the fractal graph can be realized.
In an exemplary embodiment, the step 104, taking the light departure point as a starting point, and performing ray tracing calculation in the light departure direction to obtain target three-dimensional coordinate data, may include the following steps: taking the light starting point as a starting point, and performing ray tracing calculation in the light starting 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, an appropriate 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 (a ray departure direction) of S with an S point (a ray departure point) as a start position on a pixel plane, and after a preset ray detection iteration number is reached, an obtained calculation result is saved as new three-dimensional coordinate data (target three-dimensional coordinate data), and the new three-dimensional coordinate data may be denoted as P. Optionally, the fractal graph calculation formula used in the embodiment of the present invention may be a formula of a munder sphere or a formula of another fractal graph, which is not limited in the embodiment of the present invention.
In step 105, the target three-dimensional coordinate data is rendered in a shading manner to create a fractal graph.
In the embodiment of the invention, a new Shader file and a material file are created in the Uinty3D 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 uvity 3D engine, the material file is a calculation method for describing a fractal graph by a Shader file, and a final graph drawing result is submitted to a display, so that the drawing result of the fractal graph is displayed on the display. In brief, the three-dimensional surface patch model can call a calculation method in a Shader file through a material file, so that the final fractal graph is drawn and displayed on a display.
Specifically, the embodiment of the present invention performs rendering on the target three-dimensional coordinate data, that is, the fractal graph can be created, and it should be noted that the embodiment of the present 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 pure-color rendering on the target three-dimensional coordinate data based on a half-Lambert illumination model.
As a specific example, the target three-dimensional coordinate data may be rendered in pure color rendering based on a half Lambert (half Lambert lighting model). In particular, Lambert defines the property of an ideal "matte" or diffusely reflective surface whose apparent brightness to a viewer is the same regardless of the viewing angle of the viewer. Referring to fig. 5, a schematic diagram of fractal patterns corresponding to different ray detection iteration numbers is shown, in which after pure color output is performed on target three-dimensional coordinate data and illumination is given based on half Lambert, the fractal patterns respectively corresponding to different ray detection iteration numbers, for example, the ray detection iteration numbers 1, 2, 5, 10, 20, 30, 50, and 100 in fig. 5, are schematically shown.
Of course, besides the half-lambert lighting model, the embodiment of the present invention may also adopt other manners to render and color the target three-dimensional coordinate data to achieve different graphic effects, and the embodiment of the present 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 graph according to an embodiment of the present invention is shown, where the fractal graph has self-similarity, that is, a part of the fractal graph has a certain similarity with the whole fractal graph. Because the embodiment of the invention does not need to perform ray tracing calculation on all three-dimensional patch models of the current screen, but only performs ray tracing calculation on patches of the three-dimensional patch models on the current screen, the consumption of the calculation resources of the embodiment of the invention is only the positions which can be displayed by the patches of the three-dimensional patch models, and just so, no matter the three-dimensional patch models are uncovered or covered, the embodiment of the invention can save a large amount of calculation resources, so that the fractal graph can be created in real time on light-weight equipment, such as mobile phones, tablet computers and the like.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 7, a block diagram of a fractal graph creating apparatus according to an embodiment of the present invention is shown, where the embodiment of the present invention may specifically include the following modules:
a three-dimensional patch model creating module 701, configured to create a three-dimensional patch model;
a pixel plane determining module 702, configured to determine a pixel plane from the three-dimensional patch model;
a tracking data determining module 703, configured to determine a light departure point and a light departure direction based on the pixel plane;
a ray tracing calculation module 704, configured to perform ray tracing calculation in the light starting direction to obtain target three-dimensional coordinate data, with the light starting point as a starting point;
and a rendering module 705 for rendering the target three-dimensional coordinate data 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 of 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 values and the plane coordinate data of the patches; and multiplying the first three-dimensional coordinate data by a preset reversal matrix to obtain a light starting point, wherein the reversal matrix is a reversal 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 a lens of the observation camera as the second three-dimensional coordinate data; and multiplying the second three-dimensional coordinate data by a preset reversal matrix to obtain the light starting direction.
In a preferred embodiment of the present invention, the ray tracing calculation module 704 is configured to perform ray tracing calculation in the starting direction of the ray by using the starting point of the ray 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 a solid-color rendering on the target three-dimensional coordinate data based on a half-lambert lighting model.
In a preferred embodiment of the invention, the method is applied to a light-weight electronic device.
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 starting point and a light starting direction, then, with the light starting point as a starting point, a ray tracing calculation is performed in the light starting direction to obtain target three-dimensional coordinate data, and finally, the target three-dimensional coordinate data is rendered to create a fractal graph. The embodiment of the invention only needs to perform ray tracing and coloring rendering on the plane pixel screen in the three-dimensional patch model, so compared with the existing creating method which needs to perform ray tracing and coloring rendering on the full screen, a large amount of computing resources can be saved.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the computer program realizes the steps of the fractal graph creating 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 when the computer program is executed by a processor, the steps of the fractal graph creation method embodiment are realized.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, 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 present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, 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 terminal 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 terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal 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 of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed descriptions of the fractal pattern creation method, the fractal pattern creation apparatus, the electronic device and the storage medium provided by the present invention are provided, and specific examples are applied herein to illustrate the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understanding the method and the core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A fractal pattern creation method, the method comprising:
creating a three-dimensional patch model;
determining a pixel plane from the three-dimensional patch model;
determining a light departure point and a light departure direction based on the pixel plane;
taking the light starting point as a starting point, and performing ray tracing calculation in the light starting direction to obtain target three-dimensional coordinate data;
and performing coloring rendering on the target three-dimensional coordinate data to create a fractal graph.
2. The method of claim 1, wherein determining a pixel plane from the three-dimensional patch model comprises:
determining 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.
3. The method of claim 2, wherein the treating the patch as a pixel plane comprises:
and taking the uncovered area of the patch as a pixel plane.
4. The method of claim 2, wherein determining a ray origin and a ray origin 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 values and the plane coordinate data of the patches;
and multiplying the first three-dimensional coordinate data by a preset reversal matrix to obtain a light starting point, wherein the reversal matrix is a reversal matrix between a view space coordinate system and the world space coordinate system.
5. The method of claim 4, wherein determining a ray origin and a ray origin direction based on the 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 reversal matrix to obtain the light starting direction.
6. The method of claim 1, wherein performing ray tracing calculations in the starting direction of the ray to obtain target three-dimensional coordinate data from the starting point of the ray comprises:
taking the light starting point as a starting point, and performing ray tracing calculation in the light starting 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.
7. The method of claim 1, wherein the rendering the target three-dimensional coordinate data for rendering to create a fractal graph comprises:
and performing pure-color rendering on the target three-dimensional coordinate data based on a half-Lambert illumination model.
8. A fractal drawing creation apparatus, the apparatus comprising:
the three-dimensional patch model creating module is used for creating a three-dimensional patch model;
the pixel plane determining module is used for determining a pixel plane from the three-dimensional patch model;
the tracking data determining module is used for determining a light starting point and a light starting direction based on the pixel plane;
the ray tracing calculation module is used for carrying out ray tracing calculation in the starting direction of the ray by taking the starting point of the ray as a starting point to obtain target three-dimensional coordinate data;
and the coloring rendering module is used for performing coloring rendering on the target three-dimensional coordinate data to create a fractal graph.
9. An electronic device comprising a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the fractal pattern creation method according to any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the fractal pattern creation method as claimed in any one of claims 1 to 7.
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 true CN112184873A (en) 2021-01-05
CN112184873B 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)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114066721A (en) * 2021-11-03 2022-02-18 北京字节跳动网络技术有限公司 Display method and device and electronic equipment
WO2022156451A1 (en) * 2021-01-21 2022-07-28 华为云计算技术有限公司 Rendering method and apparatus
WO2023029424A1 (en) * 2021-08-30 2023-03-09 华为云计算技术有限公司 Method for rendering application and related device
CN116681814A (en) * 2022-09-19 2023-09-01 荣耀终端有限公司 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

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022156451A1 (en) * 2021-01-21 2022-07-28 华为云计算技术有限公司 Rendering method and apparatus
WO2023029424A1 (en) * 2021-08-30 2023-03-09 华为云计算技术有限公司 Method for rendering application and related device
CN114066721A (en) * 2021-11-03 2022-02-18 北京字节跳动网络技术有限公司 Display method and device and electronic equipment
CN114066721B (en) * 2021-11-03 2024-02-02 抖音视界有限公司 Display method and device and electronic equipment
CN116681814A (en) * 2022-09-19 2023-09-01 荣耀终端有限公司 Image rendering method 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

Also Published As

Publication number Publication date
CN112184873B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
CN112184873B (en) Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium
CN108154548B (en) Image rendering method and device
CN111369655B (en) Rendering method, rendering device and terminal equipment
US8878849B2 (en) Horizon split ambient occlusion
CN114419240B (en) Illumination rendering method and device, computer equipment and storage medium
EP4213102A1 (en) Rendering method and apparatus, and device
CN111739142A (en) Scene rendering method and device, electronic equipment and computer readable storage medium
CN111476851A (en) Image processing method, image processing device, electronic equipment and storage medium
RU2680355C1 (en) Method and system of removing invisible surfaces of a three-dimensional scene
CN114424239A (en) De-noising technique for cyclic blur in ray tracing applications
CN115512025A (en) Method and device for detecting model rendering performance, electronic device and storage medium
CN113332714A (en) Light supplementing method and device for game model, storage medium and computer equipment
CN116912387A (en) Texture map processing method and device, electronic equipment and storage medium
CN108846897B (en) Three-dimensional model surface material simulation method and device, storage medium and electronic equipment
CN116137051A (en) Water surface rendering method, device, equipment and storage medium
KR20230022153A (en) Single-image 3D photo with soft layering and depth-aware restoration
CN112819929A (en) Water surface rendering method and device, electronic equipment and storage medium
WO2021155318A1 (en) Method for improved handling of texture data for texturing and other image processing tasks
CN115803782A (en) Augmented reality effect of perception geometry with real-time depth map
CN111862338A (en) Display method and device for simulating glasses wearing image
CN112840378B (en) Global illumination interacting using shared illumination contributions in path tracking
CN117745915B (en) Model rendering method, device, equipment and storage medium
CN113546410B (en) Terrain model rendering method, apparatus, electronic device and storage medium
CN116824082B (en) Virtual terrain rendering method, device, equipment, storage medium and program product
US20240169653A1 (en) Neural networks to render textured materials on curved surfaces

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