CN113034656B - Rendering method, device and equipment for illumination information in game scene - Google Patents

Rendering method, device and equipment for illumination information in game scene Download PDF

Info

Publication number
CN113034656B
CN113034656B CN202110342315.4A CN202110342315A CN113034656B CN 113034656 B CN113034656 B CN 113034656B CN 202110342315 A CN202110342315 A CN 202110342315A CN 113034656 B CN113034656 B CN 113034656B
Authority
CN
China
Prior art keywords
illumination
probe
game scene
information
texture
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
CN202110342315.4A
Other languages
Chinese (zh)
Other versions
CN113034656A (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.)
Perfect World Beijing Software Technology Development Co Ltd
Original Assignee
Perfect World Beijing Software Technology Development 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 Perfect World Beijing Software Technology Development Co Ltd filed Critical Perfect World Beijing Software Technology Development Co Ltd
Priority to CN202110342315.4A priority Critical patent/CN113034656B/en
Priority to CN202210188716.3A priority patent/CN114549723A/en
Publication of CN113034656A publication Critical patent/CN113034656A/en
Application granted granted Critical
Publication of CN113034656B publication Critical patent/CN113034656B/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/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • 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

Abstract

The application discloses a rendering method, a rendering device and rendering equipment for illumination information in a game scene, relates to the technical field of 3D rendering, and can reduce the updating, transmission and storage costs of illumination information sampling in the game scene and improve the rendering efficiency of the illumination information. The method comprises the following steps: arranging a probe grid aiming at a space voxel in a game scene, wherein the probe grid comprises an illumination probe used for capturing illumination information in the game scene, updating the illumination probe at the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capturing the illumination information at the viewpoint position; generating a plurality of probe data textures with the same data size by the central processing unit according to the illumination information of the viewpoint position, and transmitting the probe data textures to the graphic processor; and in response to the rendering instruction called by the central processing unit, the graphics processor samples the illumination information of the object in the game scene by using the resource texture and the indirect texture according to the position information of the surface sampling point of the object in the game scene, and renders the illumination information of the object.

Description

Rendering method, device and equipment for illumination information in game scene
Technical Field
The present application relates to the field of 3D rendering technologies, and in particular, to a method, an apparatus, and a device for rendering illumination information in a game scene.
Background
In order to make objects in a game scene more realistic, light rays are generally required to be projected in the scene, natural illumination is very complex, and various reflections, refractions and the like are adopted, so that illumination in a game China simulates a real world as much as possible to achieve a vivid effect.
At present, the game scene usually uses global illumination to simulate algorithms of complex behaviors such as light interaction, light bounce and the like, the global illumination calculates the ejection of light rays on the surfaces of objects after the light rays are emitted from a light source through a series of complex algorithms, and the accurate simulation is usually realized during the operation, so that the sense of reality of the scene can be effectively enhanced. The performance of real-time global illumination is limited to small-scale rendering and is suitable for rendering of static objects, while for dynamic object illumination calculation, an illumination probe is usually used for storing reflected light of nearby objects, and when a dynamic object passes through, the reflected light is supplied to the dynamic object to be used in combination with a light source.
As a way for acquiring illumination information by the illumination probe, pixel-by-pixel sampling in a game scene can be performed, since screen pixels are fixed, a way of acquiring illumination information by pixel units instead of object units can provide a more accurate illumination probe, and in a pixel or a computation shader, when linear interpolation is performed among a plurality of illumination probes, GPU hardware can be used to quickly sample illumination information captured by millions of illumination probes per frame. However, due to the requirement of a large number of pixel textures in a game scene, the processes of reading and sampling the maps in the shader or the GPU computing unit need to be high-speed and convenient, the updating, transmission and storage costs of the illumination information sampling in the game scene are increased to a certain extent, and the rendering efficiency of the illumination information is influenced.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, and a device for rendering illumination information in a game scene, and mainly aims to solve the problem that in the prior art, the update, transmission, and storage costs of the illumination information sampling in the game scene are high, which affects the rendering efficiency of the illumination information.
According to a first aspect of the present application, there is provided a rendering method of lighting information in a game scene, including:
arranging a probe grid aiming at spatial voxels in a game scene, wherein the probe grid comprises an illumination probe used for capturing illumination information in the game scene;
updating the illumination probes at the corresponding viewpoint positions in the probe grids according to the viewpoint positions in the game scene, and capturing illumination information of the viewpoint positions;
generating a plurality of probe data textures with the same data size by the central processing unit of the illumination information of the viewpoint position, and transmitting the probe data textures to the graphic processor, wherein the probe data textures comprise resource textures and indirect textures;
and responding to a rendering instruction called by the central processing unit, the graphics processor samples the illumination information of the object in the game scene by using the resource texture and the indirect texture according to the position information of the surface sampling point of the object in the game scene, and renders the illumination information of the object.
Further, the illumination probes in the probe grid have a node hierarchical relationship, the illumination probes at corresponding viewpoint positions in the probe grid are updated according to the viewpoint positions in the game scene, and the illumination information at the viewpoint positions is captured, which specifically includes:
inquiring the node level relation of the viewpoint position mapping illumination probe according to the viewpoint position in the game scene;
and according to the node hierarchical relation of the viewpoint position mapping illumination probe, updating the illumination probe at the corresponding viewpoint position in the probe grid, and capturing the illumination information of the viewpoint position.
Further, the illumination information of the viewpoint position carries a node hierarchical relationship, and the generating of the illumination information of the viewpoint position into a plurality of probe data textures with the same data size and then transmitting the probe data textures to the graphics processor specifically includes:
extracting resource textures and indirect textures by using the node hierarchical relation carried by the illumination information of the viewpoint position;
and generating a plurality of probe data textures with the same data size by the resource texture and the indirect texture and transmitting the probe data textures to a graphic processor.
Further, the extracting the resource texture and the indirect texture by using the node hierarchical relationship carried by the illumination information of the viewpoint position specifically includes:
expanding the illumination information of the viewpoint position information into resource textures according to the node hierarchical relationship carried by the illumination information of the viewpoint position;
and storing the original hierarchical relation of the resource texture in the tree structure to the indirect texture in the process of expanding the resource texture.
Further, the probe grid includes an effective illumination probe and a virtual illumination probe, and the probe grid is arranged for a spatial voxel in a game scene, specifically including:
obtaining a near distance voxel contained in a space voxel in a game scene, wherein the near distance voxel is a voxel meeting a distance condition in voxels of a preset level formed by space voxel segmentation in the game scene, and the distance condition is that a bounding box of the voxel is intersected with an object bounding box in the game scene;
a grid of probes is arranged for the close range voxels comprised by the spatial voxels.
Further, the illumination probes in the probe grid include an effective illumination probe and a virtual illumination probe, and the probe grid is arranged for the close-range voxels included in the spatial voxels, and specifically includes:
creating an active light probe for a near voxel within a hierarchy of the spatial voxels;
adding virtual voxels corresponding to the levels for the spatial voxels, and creating a virtual illumination probe for the voxels meeting the adding conditions in the virtual voxels, wherein the virtual illumination probe is used for performing seamless interpolation on illumination information sampled by the voxels which are close to the levels in the spatial voxels.
Further, the sampling, according to the position information of the object surface sampling point in the game scene, the illumination information of the object in the game scene by using the resource texture and the indirect texture, and rendering the illumination information of the object specifically includes:
acquiring the original hierarchical relation of the resource texture in the tree structure from the indirect texture according to the position information of the object surface sampling point in the game scene;
and sampling illumination information of objects in a game scene from the resource textures by utilizing the original hierarchical relation of the resource textures in the tree structure, and rendering the illumination information of the objects.
Further, the sampling, by using the original hierarchical relationship of the resource texture in the tree structure, the illumination information of the object in the game scene from the resource texture, and rendering the illumination information of the object specifically includes:
acquiring the level and the offset of the resource texture in the tree structure by utilizing the original hierarchical relation of the resource texture in the tree structure;
calculating the illumination sampling position cached in the resource texture according to the level and the offset of the resource texture in the tree structure;
and sampling illumination information of objects in the game scene according to the illumination sampling positions cached in the resource texture, and rendering the illumination information of the objects.
According to a second aspect of the present application, there is provided an apparatus for rendering illumination information in a game scene, comprising:
the system comprises an arrangement unit, a processing unit and a display unit, wherein the arrangement unit is used for arranging a probe grid aiming at spatial voxels in a game scene, and the probe grid comprises an illumination probe used for capturing illumination information in the game scene;
the updating unit is used for updating the illumination probes at the corresponding viewpoint positions in the probe grids according to the viewpoint positions in the game scene and capturing illumination information of the viewpoint positions;
the generating unit is used for generating a plurality of probe data textures with the same data size from the illumination information of the viewpoint position through a central processing unit and transmitting the probe data textures to an image processor, wherein the probe data textures comprise resource textures and indirect textures;
and the rendering unit is used for responding to a rendering instruction called by the central processing unit, and the graphics processor samples the illumination information of the object in the game scene by using the resource texture and the indirect texture according to the position information of the object surface sampling point in the game scene and renders the illumination information of the object.
Further, the illumination probes in the probe grid have a node hierarchy relationship, the updating unit comprises:
the query module is used for querying the node hierarchical relation of the viewpoint position mapping illumination probe according to the viewpoint position in the game scene;
and the updating module is used for updating the illumination probes at the corresponding viewpoint positions in the probe grid according to the node hierarchical relation of the viewpoint position mapping illumination probes, and capturing the illumination information of the viewpoint positions.
Further, the illumination information of the viewpoint position carries a node hierarchy relationship, and the generating unit includes:
the extraction module is used for extracting the resource texture and the indirect texture by utilizing the node hierarchical relationship carried by the illumination information of the viewpoint position;
and the generating module is used for generating a plurality of probe data textures with the same data size from the resource texture and the indirect texture and transmitting the probe data textures to the graphics processor.
Further, the extraction module comprises:
the unfolding submodule is used for unfolding the illumination information of the viewpoint position information into resource textures according to the node hierarchical relationship carried by the illumination information of the viewpoint position;
and the storage submodule is used for storing the original hierarchical relation of the resource texture in the tree structure to the indirect texture in the process of expanding the resource texture.
Further, the probe grid comprises an active illumination probe and a virtual illumination probe, the arrangement unit comprises:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring near-distance voxels contained in space voxels in a game scene, the near-distance voxels are voxels meeting a distance condition in voxels of a preset level formed by the space voxels in the game scene in a segmentation mode, and the distance condition is that a bounding box of the voxels is intersected with an object bounding box in the game scene;
a placement module for placing a grid of probes for close range voxels comprised by the spatial voxels.
Further, the placement module is specifically configured to create an active light probe for a close-range voxel within a hierarchy of the spatial voxels;
the arrangement module is specifically further configured to add a virtual voxel corresponding to a hierarchy to the spatial voxel, and create a virtual illumination probe for a voxel meeting an addition condition in the virtual voxel, where the virtual illumination probe is used to perform seamless interpolation on illumination information sampled by a near-distance voxel in the hierarchy in the spatial voxel.
Further, the rendering unit includes:
the second acquisition module is used for acquiring the original hierarchical relationship of the resource texture in the tree structure from the indirect texture according to the position information of the object surface sampling point in the game scene;
and the rendering module is used for sampling illumination information of objects in a game scene from the resource textures by utilizing the original hierarchical relation of the resource textures in the tree structure and rendering the illumination information of the objects.
Further, the rendering module includes:
the obtaining submodule is used for obtaining the level and the offset of the resource texture in the tree structure by utilizing the original hierarchical relation of the resource texture in the tree structure;
the calculation submodule is used for calculating the illumination sampling position cached in the resource texture according to the level and the offset of the resource texture in the tree structure;
and the rendering submodule is used for sampling the illumination information of the object in the game scene according to the illumination sampling position cached in the resource texture and rendering the illumination information of the object.
According to a third aspect of the present application, there is provided a computer device comprising a memory storing a computer program and a processor implementing the steps of the method of the first aspect when the computer program is executed.
According to a fourth aspect of the present application, there is provided a readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of the first aspect described above.
By the technical scheme, compared with the mode of quickly sampling the illumination information captured by millions of illumination probes in each frame by using GPU hardware in the existing mode, the method, the device and the equipment for rendering the illumination information in the game scene have the advantages that the probe grids are arranged aiming at the space voxels in the game scene, the illumination probes can be reasonably placed, the waste of the illumination probes is effectively avoided, the illumination probes at the corresponding view point positions in the probe grids are further updated according to the view point positions in the game scene, the illumination information at the view point positions is captured, a plurality of probe data textures with the same data size are generated by the illumination information at the view point positions and are transmitted to a graphic processor, the sampling of the illumination information is not needed to be carried out pixel by pixel, the storage space of rendering buffer is saved, the probe data textures comprise resource textures and indirect textures, and the graphic processor responds to the rendering instruction of a central processing unit, the illumination information of the object in the game scene is sampled by utilizing the resource texture and the indirect texture according to the position information of the surface sampling point of the object in the game scene, and the illumination information of the object is rendered.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 illustrates a flowchart of a rendering method for lighting information in a game scene according to an embodiment of the present application;
fig. 2 is a flowchart illustrating another rendering method for lighting information in a game scene according to an embodiment of the present disclosure;
3a-3b illustrate schematic diagrams of an illumination probe creation and rendering process in a game scene provided by an embodiment of the present application;
fig. 4 is a flowchart illustrating another rendering method for lighting information in a game scene according to an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a framework for rendering lighting information in a game scene according to an embodiment of the present application;
fig. 6 is a schematic structural diagram illustrating a rendering apparatus for lighting information in a game scene according to an embodiment of the present application;
fig. 7 is a schematic structural diagram illustrating a rendering apparatus for lighting information in another game scene according to an embodiment of the present application;
fig. 8 is a schematic device structure diagram of a computer apparatus according to an embodiment of the present invention.
Detailed Description
The content of the invention will now be discussed with reference to a number of exemplary embodiments. It is to be understood that these examples are discussed only to enable those of ordinary skill in the art to better understand and thus implement the teachings of the present invention, and are not meant to imply any limitations on the scope of the invention.
As used herein, the term "include" and its variants are to be read as open-ended terms meaning "including, but not limited to. The term "based on" is to be read as "based, at least in part, on". The terms "one embodiment" and "an embodiment" are to be read as "at least one embodiment". The term "another embodiment" is to be read as "at least one other embodiment".
In a game scene, illumination is a factor which has a large influence and is also a part of which the visual style cannot be lost, under the common condition, both static and dynamic objects in the game scene have the possibility of different volumes or complex model structures, the artistic assets are difficult to be baked into an effective illumination map, and the illumination probe which samples pixel by pixel can avoid the illumination effect of a moving object and the sense of incongruity of the whole scene using the static illumination map, can bring uniform indirect illumination to the scene, simplifies the complexity of a rendering pipeline and improves the rendering efficiency. In the operation process of the illumination probes, illumination information can be sampled at a position point where a certain illumination probe is located, then the illumination information is sampled from the positions of other adjacent illumination probes of the illumination probe, and then interpolation operation is performed on the illumination information obtained by sampling, so that the illumination information at a certain position among the illumination probes is calculated.
As a sampling mode of an illumination probe, the method can sample objects one by one in a game scene, and specifically comprises object-by-object corresponding parameter sampling and object-by-object 3D texture sampling, in the process of object-by-object corresponding parameter sampling, illumination change depends on the surface normal of the object instead of the position on the surface, and is sufficient for small objects, but illumination mismatching and discontinuity with an adjacent larger model can be caused, so that one-to-one collection, updating and sampling are carried out at a CPU end, each related object has an SH coefficient after corresponding interpolation, although the method is relatively easy to maintain and low in cost, indirect illumination cannot be provided for a large number of complex objects, the method is applicable to a single scene, and in the process of object-by-object 3D texture sampling, sampling interpolation calculation is carried out at a GPU end by utilizing a hardware acceleration function, compared with the mode of object-by object corresponding parameter sampling, the sampling effect of the illumination information is improved to a certain extent, but the total number of the objects sampled one by one is limited by the updating cost and the transmission bandwidth of the 3D texture from the CPU end to the CPU end, and a large number of large instantiated models have a multi-sampling mode which is difficult to use one by one.
Under the general condition, static object and the dynamic object in the game scene all have the condition of different size, or the model structure is complicated for the fine arts asset is difficult to be baked into effectual illumination map, and pixel sampling has the acquired treatment advantage one by one in the game scene, can unify the processing of indirect illumination, simplifies the complexity of the pipeline of rendering simultaneously, promotes and renders efficiency. However, a more accurate illumination probe needs to be provided for the dynamic object, the sampling efficiency of the illumination information at the later stage is affected to a certain extent by the position and the number of the illumination probes, and the sampling rate of the illumination probes is accelerated by GPU hardware due to the requirement of a large number of texture resources in the game scene, so that the updating, transmission and storage costs of the illumination information sampling in the game scene are increased, and the rendering efficiency of the illumination information is affected.
In order to solve the problem, the embodiment provides a rendering method of illumination information in a game scene, as shown in fig. 1, the method is applied to a scene rendering tool, and relates to interaction between a central processing unit and an image processor of the scene rendering tool, that is, interaction between a CPU end and a GPU end, and includes the following steps:
101. a grid of probes is arranged for spatial voxels in the game scene.
The game is real-time, dynamic and interactive computer simulation, a plurality of three-dimensional games use a three-dimensional triangular mesh to express the surface of an object, detail layers of the expressed surface of the object are stored in textures, when the rendering is carried out, objects with crossed rays are considered firstly, then multilevel textures of detail layers corresponding to the surface of the object are selected to carry out rendering calculation, space voxels are used as volume units for rendering the textures in a game space, and objects containing the voxels can be represented by three-dimensional rendering or polygon isosurface extracting given threshold value outlines.
Aiming at the illumination effect related to a game scene, the global illumination is generally used for rendering, the direct illumination of light rays and the diffuse reflection effect as much as possible are considered in the global illumination, and the finally presented illumination effect is closer to the real world. The specific global illumination refers to the calculation of light reflection around a game scene and is responsible for producing a plurality of fine coloring special effects, atmospheres and glossy metal reflection effects in the realization environment. In the existing global illumination mode, all indirect illumination is pre-calculated and stored in texture information with a light map, and the light map enables a game scene to have an effect similar to global illumination, and the light map is only effective on static objects due to the pre-calculation. For the global illumination of the non-static object, the illumination probe can be used for simulating the effect of using an illumination map, the illumination probe can sample illumination information illuminating a certain specified point in the 3D space in a pre-calculation stage before operation, and then the collected information is compiled and stored in a package mode through a spherical harmonic function. When the game runs, the lighting information can be coded by the shader program to quickly reconstruct the lighting effect. Similar to the light map, the light probe can capture the light information in the game scene and store the light information in the scene, except that the light map stores the light information of the light illuminating the surface of the object, and the light probe stores the light information of the light passing through the vacuum area.
In general, the arrangement of the illumination probes is manually placed and adjusted, the positions and the number of the arrangement of the illumination probes directly influence the sampling result of illumination information, and in order to avoid the waste of unnecessary illumination probe resources, in the embodiment of the invention, in the process of arranging the probe grids for the illumination probes in a game scene, the illumination probes can be arranged for space voxels close to the surface of an object, and the illumination probes can be arranged for space voxels in an open interval. The determination process for the space voxel close to the surface of the object can be specifically determined by performing multiple segmentation on the space voxel in the game scene to form a multi-level voxel, and if the voxel is determined to intersect with the object in the game scene, the voxel is determined to be the space voxel close to the surface of the object, and then an illumination probe is arranged for the space voxel close to the surface of the object to form a probe grid.
It can be understood that, because the illumination probe generally processes the illumination of the character role or the dynamic object of the game scene to provide high-quality illumination for the moving object in the game scene, the probe grid arranged in the application sets the illumination probe for the spatial voxel close to the surface of the object in the game scene, and does not set the illumination probe for other spatial voxels, so that the illumination information sampled subsequently is effective illumination information around the object, thereby avoiding the waste of the illumination probe resources and improving the illumination effect of the moving object in the game scene.
102. And updating the illumination probes at the corresponding viewpoint positions in the probe grids according to the viewpoint positions in the game scene, and capturing illumination information of the viewpoint positions.
It can be understood that, because the collection process of the illumination information is influenced by the position of the illumination probe in the probe grid, the illumination information of different spatial positions can be influenced mutually, the viewpoint position in the game scene is the spatial position corresponding to the visual angle of the video equipment, the position is taken as the sampling position of the illumination information, the illumination probe of the corresponding viewpoint position in the probe grid is updated, the illumination information captured by the illumination probe of the viewpoint position is rendered subsequently, a large amount of resources are not required to be consumed to store and transmit probe data, the storage and transmission expenses are saved, and meanwhile, the rendering precision is ensured.
The method comprises the steps that a viewpoint position in a game scene is any sampling position of illumination information set in the game scene, an effective illumination probe can continuously collect illumination data changing in the game scene aiming at the viewpoint position, and then sampling interpolation results with different densities are provided by a probe grid in the process of interpolating the illumination information so as to form illumination information of the viewpoint position captured by the probe grid.
Specifically, in the process of updating the illumination probe at the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, the position of the illumination probe corresponding to the corresponding viewpoint position in the probe grid in the space voxel can be obtained for the viewpoint position in the game scene, whether the space voxel contains an object or not is judged according to the position of the illumination probe in the space voxel, the illumination probe can be arranged in the space voxel containing the object, the illumination probe cannot be arranged for the space voxel not containing the object, and the illumination probe arranged in the space voxel containing the object in the probe grid is further updated according to the viewpoint position, so that the subsequent illumination information corresponding to the illumination probe arranged in the space voxel containing the object can be directly collected in the process of collecting the illumination information.
103. And generating a plurality of probe data textures with the same data size by the central processing unit according to the illumination information of the viewpoint position, and transmitting the probe data textures to the graphic processor.
It can be understood that the illumination information of the viewpoint position includes pre-calculated illumination data, and many budget costs are generated during editing, and when the system does not run, the illumination probe stores the illumination data passing through the scene space and integrates the illumination data into a plurality of probe data textures with the same data size, where the probe data textures are equivalent to an illumination map of a dynamic object, and also include a direct light source projected onto the surface of the object in the scene and an indirect light source reflected between different objects, and the surface information and the concave-convex information of the object can be described through a shader on the material of the object.
In the process of generating a plurality of probe data textures with the same data size from illumination information of a viewpoint position, because the illumination information of the viewpoint position is captured by an illumination probe in a probe grid, and the position of the illumination probe in the probe grid can influence the sampling of the illumination information, an octree is used to represent a game scene, the size of a scene space, the distribution and the complexity of objects in the space cannot be unified, the viewpoint position in the current game scene is positioned in a certain subnode in a certain hierarchy of the octree, the subnode is also positioned in the probe grid and has corresponding probe data, on one hand, the hierarchical relationship of the probe data corresponding to the viewpoint position can be recorded in an indirect texture, on the other hand, the probe data corresponding to the viewpoint position can be recorded in a resource texture, and the indirect texture and the resource texture form a probe data texture, the probe data texture is further transmitted to a graphics processor.
The central processing unit is equivalent to a graphics processing unit, which is equivalent to a microprocessor for performing drawing operations on a personal computer, a workstation, a game machine and some mobile devices (such as a tablet computer, a smart phone and the like), and is mainly used for rendering probe data textures.
104. And responding to a rendering instruction called by the central processing unit, the graphics processor samples the illumination information of the object in the game scene by using the resource texture and the indirect texture according to the position information of the surface sampling point of the object in the game scene, and renders the illumination information of the object.
After the CPU gives a rendering instruction, the image processor performs calculation according to the rendering state (e.g., texture, shader, etc.) and the input sampling point data, and finally outputs the pixel. Specifically, the original hierarchical relationship of the resource texture in the tree structure can be obtained from the indirect texture according to the position information of the surface sampling point of the object in the game, the position information of the surface sampling point of the object in the game scene is equivalent to the position of the sampling point output to the screen by the game scene, the illumination information of the object in the game scene is sampled from the resource texture by utilizing the original hierarchical relationship of the resource texture in the tree structure, and the illumination information of the object is rendered.
As for the execution main body of this embodiment, the execution main body may be a rendering device or an apparatus for lighting information in a game scene, and mainly relates to a CPU end and a GPU end of a scene rendering tool, and as for steps 101 to 103, the execution main body is mainly applied to the CPU end, specifically, after the game scene is arranged, position information of a lighting probe in the game scene needs to be arranged, since the lighting probe cannot be directly hung on a game object, usually, a specified spatial area in the game scene needs to be relied on, when the lighting probe is added to the game scene, a spatial voxel of the specified spatial area, which is closer to an object, can be used as a preferred position for placing the lighting probe, so that lighting information more conforming to the requirements of the game scene can be collected, then the lighting probe is updated according to the position of a viewpoint in the game scene, and the lighting information is captured, the arrangement process of the lighting probe and the capture process of the lighting information are mainly executed by a client of the rendering tool, the process can be executed by a CPU (central processing unit) end, the illumination information is uploaded to the CPU end, the illumination information is transmitted to a GPU (graphics processing unit) end after generating probe data textures through the CPU end, the display content is calculated by the CPU end and then submitted to the GPU end, the GPU end responds to a rendering instruction called by the CPU, the illumination information of an object in a game scene is sampled by using resource textures and indirect textures according to the position information of the surface sampling points of the object in the game scene, the illumination information of the object is rendered, and then the illumination information is output to a screen.
Compared with the prior art that GPU hardware is used for rapidly sampling the illumination information captured by millions of illumination probes in each frame, the method for rendering the illumination information in the game scene provided by the embodiment of the application is characterized in that a probe grid is arranged aiming at space voxels in the game scene, the illumination probes can be reasonably placed, the waste of the illumination probes is effectively avoided, the illumination probes at corresponding view points in the probe grid are further updated according to the view points in the game scene, the illumination information at the view points is captured, a plurality of probe data textures with the same data size are generated according to the illumination information at the view points and then transmitted to a graphic processor, the illumination information is not required to be sampled pixel by pixel, the storage space of rendering buffer is saved, the probe data textures comprise resource textures and indirect textures, and the graphic processor responds to rendering instructions called by a central processor, the illumination information of the object in the game scene is sampled by utilizing the resource texture and the indirect texture according to the position information of the surface sampling point of the object in the game scene, and the illumination information of the object is rendered.
Further, as a refinement and an extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of the embodiment, the embodiment provides another rendering method of lighting information in a game scene, which is applied to the CPU end of the scene rendering tool, as shown in fig. 2,
201. and acquiring short-distance voxels contained in the space voxels in the game scene.
The space voxels in the game scene are equivalent to a three-dimensional space unit in a game world, the short-distance voxels are voxels meeting a distance condition in voxels of a preset level formed by the space voxel segmentation in the game scene and are equivalent to voxels close to the surface of an object, the distance condition is used as a basis for judging the voxels close to the surface of the object, a bounding box of the voxels can be intersected with an object bounding box in the game scene, the pixels to be segmented and the segmented pixels can be judged according to the distance condition by forming the space voxels in the segmentation process, and if the bounding box of the voxels is intersected with the object bounding box in the game scene, the voxels are close to the surface of the object and are the short-distance voxels.
It can be understood that the above determination process may be performed before and after the intermediate voxels are segmented, and the voxels meeting the determination condition are repeatedly segmented, and if the voxels meeting the determination condition are not segmented, the voxels are not segmented, first, a large voxel is used as an original spatial voxel to be segmented, and then the original spatial voxel is uniformly segmented, the segmentation principle is that if the large voxel is close to the surface of the object, the large voxel is subdivided, and each sub-voxel is repeatedly segmented until a specified minimum voxel size is reached, that is, a preset level is reached, and the process generates a tree structure of the preset level.
Specifically, in the process of obtaining a short-distance voxel contained in a space voxel in a game scene, because the short-distance voxel is a voxel close to the surface of an object in the game scene, each space voxel in the space region can be divided into voxels of a preset level aiming at the space region covered by the object to be hooked in the game scene, the preset level is a limiting depth of a tree structure, the preset level can be specifically set according to an actual application scene, the higher the level number is, the more the number of voxels contained in the divided space voxel is, then each voxel in the preset level is traversed, whether the bounding box of the divided voxel is intersected with the bounding box of the object in the game scene is judged, and if yes, the divided voxel is determined to be the short-distance voxel on the surface of the object in the game scene.
202. A grid of probes is arranged for the close range voxels comprised by the spatial voxels.
The light rays in the game scene can control the activities of characters, influence the mood of players and influence the mode of perceiving various events, and the game engine is used as a tool for game development, and various effects including intensity, color, shadow and the like which can be observed in real time in the process of making the game can be flexibly adjusted in the process of making the game. In general, for a dynamic object in a game scene, sampling points of an illumination probe can be set in a designated area to collect light and shade information of the designated area, the designated area can be a space area covered by the object to be hung in the game scene, as the illumination information generated in a place with small illumination change in the game scene is less, waste can be generated by arranging too many illumination probes, and intensive illumination probes are preferably set in the illumination change, shadow and illumination transition area.
Specifically, in the process of arranging a probe grid for a short-distance voxel included in a space voxel, on one hand, an effective illumination probe is created for the short-distance voxel in a hierarchy in the space voxel, the effective illumination probe can capture illumination information in a game scene to form a spherical harmonic function coefficient defined on a spherical coordinate system, on the other hand, a virtual voxel corresponding to the hierarchy is added for the space voxel, a virtual illumination probe is created for a voxel meeting an adding condition in the virtual voxel, and the virtual illumination probe is used for performing seamless interpolation on illumination information sampled by the short-distance voxel in the hierarchy in the space voxel.
The position of the effective illumination probe in the probe grid is fixed, and a virtual illumination probe does not need to be set for the position of the effective illumination probe in the probe grid, specifically, in the process of adding the virtual illumination probe, firstly, a virtual voxel corresponding to a hierarchy is added for the hierarchy which is more than one order in the space voxel, the virtual voxel is mapped with the voxel of the corresponding hierarchy in the space voxel, the virtual voxel corresponding to the hierarchy is further traversed, whether the effective illumination probe exists in the mapped voxel in the space voxel is judged, and if not, the virtual illumination probe is created for the virtual voxel. The virtual illumination probe can be additionally created for the places where the effective illumination probes do not exist around the short-distance voxels for creating the effective illumination probe.
203. And inquiring the node hierarchical relation of the viewpoint position mapping illumination probe according to the viewpoint position in the game scene.
It can be understood that the illumination information captured by the probe mesh of the spatial voxel includes pre-computed illumination data, and many budget costs are generated at the time of editing, and when the system does not run, the illumination probe stores the illumination information passing through the scene space and integrates the illumination information into a data probe texture, where the data probe texture is equivalent to an illumination map of a dynamic object, and also includes a direct light source projected onto the surface of the object in the scene and an indirect light source reflected between different objects, and the surface information and the concave-convex information of the object can be described through a shader on the material of the object.
The viewpoint position in the game scene is the sampling position of the current shooting equipment, the node hierarchical relation of the illumination probes is inquired according to the sampling position of the current shooting equipment, the illumination information is captured by using the node hierarchical relation of the corresponding illumination probes, GPU hardware is not required to sample millions of illumination probes, more efficient illumination information sampling is achieved, and the rendering efficiency of the illumination information is improved.
204. And according to the node hierarchical relation of the viewpoint position mapping illumination probe, updating the illumination probe at the corresponding viewpoint position in the probe grid, and capturing the illumination information of the viewpoint position.
In the embodiment of the application, each probe node in the tree structure of the probe grid has spatial range information, the node hierarchical relationship of the viewpoint position mapping illumination probe is relatively easy to determine, and then the illumination probe at the corresponding viewpoint position in the probe grid is updated according to the node hierarchical relationship of the viewpoint position illumination probe so as to capture the illumination information of the viewpoint position.
205. And extracting the resource texture and the indirect texture by using the node hierarchical relation carried by the illumination information of the viewpoint position.
In the embodiment of the application, the illumination data in the game scene can be sampled by using the effective illumination probe in the probe grid, interpolation operation is performed on the illumination data to obtain first illumination information of the viewpoint position in the game scene, seamless interpolation is performed on the illumination data sampled by the short-distance voxel in the hierarchy in the space voxel by using the virtual illumination probe in the probe grid to obtain second illumination information of the viewpoint position in the game scene, and the first illumination information and the second illumination information of the viewpoint position in the game scene are further expanded to extract the resource texture and the indirect texture.
It can be understood that the illumination data is attached to the illumination probe, and the illumination probe belongs to a node on a certain level in the probe grid, so that the level information and the illumination information of the node are also expanded in the process of expanding the first illumination information and the second illumination information, the level information of the node in the attribute structure is used for gradually expanding the illumination information, a resource texture can be formed aiming at the illumination information, and an indirect texture can be formed aiming at the level information of the node.
206. And generating a plurality of probe data textures with the same data size by the resource texture and the indirect texture and transmitting the probe data textures to a graphic processor.
It should be noted that the data probe texture of the tree structure is combined with the illumination information captured by the active illumination probe and the virtual illumination probe, and can transmit the illumination information to the GPU to form the literary resource information. Specifically, the illumination information of the viewpoint position information can be expanded into resource textures according to the node hierarchical relationship carried by the illumination information of the viewpoint position; and further storing the original hierarchical relation of the resource texture in the tree structure to the indirect texture in the process of expanding the resource texture.
Taking a 2D quadtree as a specific application scene for example, firstly adaptively creating an effective illumination probe in a spatial voxel in a game scene, then placing an effective illumination probe at a corner of each voxel, specifically dividing each spatial voxel into 4 voxels, further repeatedly dividing each voxel, forming the spatial voxel into an octree structure to form a 2 x 2 probe grid, recording the voxels close to the surface of an object, placing the effective illumination probes on the voxel nodes, then adding virtual voxels and virtual illumination probes in a hierarchy corresponding to the spatial voxel in the game scene, wherein the virtual voxels and the virtual illumination probes can realize seamless interpolation of illumination information when sampling between voxels of a larger hierarchy and a smaller hierarchy, and further form a plurality of probe data textures with the same data size from the illumination information captured by the effective illumination probes and the virtual illumination probes, as shown in fig. 3a and fig. 3b, the probe data texture includes a resource texture and an indirect texture, and can be developed layer by layer in the rendering process, the resource texture of each level has a separate number, and usually, the resource texture of each level merges the illumination information captured by the effective illumination probe and the virtual illumination probe, and for the resource texture which is not merged and stored, merging processing can be continued.
The method comprises the steps of expanding spatial voxels with hierarchical relations in a tree structure into an illumination probe set to form data probe textures, storing the hierarchical relations of all resource textures in the tree structure in indirect mapping textures, updating illumination information captured by the illumination probe in the tree structure according to a viewpoint position in the game scene rendering process through each frame of scene data, expanding the illumination information to the data probe textures, recording the hierarchical relations to the indirect textures in the expanding process, transmitting the indirect textures to a GPU, obtaining a certain hierarchical relation in the corresponding tree structure from the indirect textures according to the world position of an object surface sampling point during sampling, finally sampling the illumination information formed by the final illumination probe in the resource textures through the hierarchical relations, and rendering the illumination information.
Further, the present embodiment provides another method for rendering illumination information in a game scene, as shown in fig. 4, where the method is applied to a GPU end of a scene rendering tool, and includes the following steps:
301. receiving a plurality of probe data textures in response to rendering instructions invoked by the central processor.
The probe data texture comprises a resource texture and an indirect texture, has a storage structure with the same data size, can meet texture caching of a GUP end, and shows uniform layout of the resource texture.
Because the space of each level in the storage structure is tiled and expanded, the illumination information acquired by the illumination probe in the game scene is provided, the GPU end is further required to sample the illumination information in the game scene, the sampling process of the illumination information implemented by the GPU end is relatively simple and fixed operation, the indirect texture in the probe data texture is used for addressing the resource texture, and the illumination information of a large number of illumination probes does not need to be transmitted and sampled at one time, so that the data transmission and sampling of the whole game scene can be efficiently met by the limited probe data texture and the fixed overhead.
302. And acquiring the original hierarchical relation of the resource texture in the tree structure from the indirect texture according to the position information of the object surface sampling point in the game scene.
In consideration of the distribution conditions of the effective illumination probes and the virtual illumination probes in the probe grid, in the process of acquiring the original hierarchical relationship of the resource texture in the tree structure from the indirect texture, firstly, the position distribution of the effective illumination probes and the virtual illumination probes in the probe grid is extracted according to the position information of the object surface sampling points in the game scene, and then, the original hierarchical relationship of the resource texture in the tree structure is acquired from the indirect texture according to the position distribution of the effective illumination probes and the virtual illumination probes in the probe grid.
303. And sampling illumination information of objects in a game scene from the resource textures by utilizing the original hierarchical relation of the resource textures in the tree structure, and rendering the illumination information of the objects.
Node information of the resource texture in the tree structure, namely an offset value, can be sampled from the indirect texture through the position of the current pixel in the game scene, then the probe spherical harmonic function on the pixel can be obtained in the resource texture through the offset value, and then projection and reconstruction of the spherical harmonic function can be realized so as to render illumination information.
In the embodiment of the present invention, the level and the offset of the resource texture in the tree structure may be obtained specifically by using the original hierarchical relationship of the resource texture in the tree structure, and then according to the level and the offset of the resource texture in the tree structure, since the expansion of each hierarchical node in the tree structure is performed according to a set sequence, the expansion is usually performed from the first hierarchical node, the offset is 0 at this time, and so on, the illumination sampling position cached in the resource texture is calculated, and then the illumination information of the object in the game scene is sampled according to the illumination sampling position cached in the resource texture, and the illumination information of the object is rendered.
In a specific application scene, a process of rendering illumination information in a game scene can be as shown in fig. 5, the process mainly relates to data transmission between a CPU end and a GPU end, firstly, the CPU end arranges a probe grid for a hollow body element in the game scene, a uniform and irregular grid probe can be generated by a self-adaptive mechanism, the grid probe comprises an effective illumination probe and a virtual illumination probe, a position marked in a midpoint of the grid probe is an effective illumination probe, a position marked in a cross of the grid probe is a virtual illumination probe, then, data operation is performed by combining illumination precomputation data, material and illumination, probe data textures, namely indirect textures comprising a node hierarchical relationship and resource textures comprising illumination information, the probe texture data and a cube map are transmitted to a renderer in the GPU by combining a viewpoint position of the game scene, the probe data textures are stored in a cache by the renderer in the GPU to perform delayed rendering, the method comprises the steps that a GPU end executes a geometric stage of a drawing instruction to rasterize a scene object, delayed rendering utilizes multiple MRT rendering buffers to store geometric information at the extreme, sampling and buffering cost are not needed to be additionally operated to store illumination information, cache resources are saved, meanwhile GPU bandwidth is reduced, probe data textures are sampled pixel by pixel, the scene is sampled according to a specific position, a reflection probe is arranged, when an object with a reflection effect is near the probe, the result of the probe is given to the object, screen space reflection is further utilized to obtain set information of a game scene from the cache, and sampling and calculation are conducted according to the resource textures corresponding to the object at a viewpoint position, so that the illumination information of the object in the game scene is rendered when direct illumination is used.
Further, as a specific implementation of the method in fig. 1 and fig. 2, an embodiment of the present application provides a rendering apparatus for lighting information in a game scene, as shown in fig. 6, the apparatus includes: an arrangement unit 41, an update unit 42, a generation unit 43, a rendering unit 44.
An arrangement unit 41, which may be configured to arrange a probe grid for spatial voxels in the game scene, the probe grid including therein an illumination probe for capturing illumination information in the game scene;
the updating unit 42 may be configured to update the illumination probe at the corresponding viewpoint position in the probe grid according to the viewpoint position in the game scene, and capture illumination information of the viewpoint position;
the generating unit 43 may be configured to generate, by a central processing unit, a plurality of probe data textures with the same data size from the illumination information of the viewpoint position, and transmit the probe data textures to a graphics processor, where the probe data textures include a resource texture and an indirect texture;
and the rendering unit 44 is configured to, in response to a rendering instruction called by the central processing unit, sample, by using the resource texture and the indirect texture, illumination information of an object in the game scene according to position information of a surface sampling point of the object in the game scene, and render the illumination information of the object.
In a specific application scenario, as shown in fig. 7, the illumination probes in the probe grid have a node hierarchical relationship, and the updating unit 42 includes:
the query module 421 may be configured to query a node hierarchical relationship of the viewpoint position mapping illumination probe according to a viewpoint position in a game scene;
the updating module 422 may be configured to update the illumination probe at the corresponding viewpoint position in the probe grid according to the node hierarchical relationship of the viewpoint position mapping illumination probe, and capture illumination information of the viewpoint position.
In a specific application scenario, as shown in fig. 7, the illumination information of the viewpoint position carries a node hierarchy relationship, and the generating unit 43 includes:
the extracting module 431 may be configured to extract a resource texture and an indirect texture by using a node hierarchical relationship carried by the illumination information of the viewpoint position;
and a generating module 432, configured to generate a plurality of probe data textures with the same data size from the resource texture and the indirect texture, and transmit the generated probe data textures to a graphics processor.
In a specific application scenario, as shown in fig. 7, the extracting module 431 includes:
the unfolding submodule 4311 is configured to unfold the illumination information of the viewpoint position information into a resource texture according to a node hierarchical relationship carried by the illumination information of the viewpoint position;
the storing sub-module 4312 may be configured to store the original hierarchical relationship of the resource texture in the tree structure to the indirect texture in the process of expanding into the resource texture.
In a specific application scenario, as shown in fig. 7, the probe grid includes an active illumination probe and a virtual illumination probe, and the placement unit 41 includes:
the first obtaining module 411 may be configured to obtain a short-distance voxel included in a spatial voxel in a game scene, where the short-distance voxel is a voxel meeting a distance condition in voxels of a preset hierarchy formed by spatial voxel segmentation in the game scene, and the distance condition is that a bounding box of the voxel intersects with an object bounding box in the game scene;
a placement module 412 may be used to place a grid of probes for the close-range voxels contained by the spatial voxels.
In a specific application scenario, the placement module 412 may be specifically configured to create an active light probe for a close-range voxel within a hierarchy of the spatial voxels;
the arranging module 412 may be further specifically configured to add a virtual voxel corresponding to a hierarchy to the spatial voxel, and create a virtual illumination probe for a voxel meeting an addition condition in the virtual voxel, where the virtual illumination probe is used to perform seamless interpolation on illumination information sampled by a voxel located in a close distance within the hierarchy in the spatial voxel.
In a specific application scenario, as shown in fig. 7, the rendering unit 44 includes:
the second obtaining module 441 may be configured to obtain, from the indirect texture, an original hierarchical relationship of the resource texture in the tree structure according to the position information of the object surface sampling point in the game scene;
the rendering module 442 may be configured to sample illumination information of an object in a game scene from the resource texture by using an original hierarchical relationship of the resource texture in the tree structure, and render the illumination information of the object.
In a specific application scenario, as shown in fig. 7, the rendering module 442 includes:
the obtaining sub-module 4421 is configured to obtain a level and an offset of the resource texture in the tree structure by using an original hierarchical relationship of the resource texture in the tree structure;
the calculating submodule 4422 may be configured to calculate, according to the level and the offset of the resource texture in the tree structure, an illumination sampling position cached in the resource texture;
the rendering submodule 4423 may be configured to sample illumination information of an object in a game scene according to the illumination sampling position cached in the resource texture, and render the illumination information of the object.
Compared with the prior art that GPU hardware is used for rapidly sampling the illumination information captured by millions of illumination probes in each frame, the device for rendering the illumination information in the game scene provided by the embodiment of the invention arranges the probe grids aiming at the spatial voxels in the game scene, can reasonably arrange the illumination probes, effectively avoids the waste of the illumination probes, further updates the illumination probes at corresponding view points in the probe grids according to the view points in the game scene, captures the illumination information at the view points, generates a plurality of probe data textures with the same data size according to the illumination information at the view points and transmits the probe data textures to the graphic processor, does not need to sample the illumination information pixel by pixel, saves the storage space of rendering buffer, and the probe data textures comprise resource textures and indirect textures which are responded by the graphic processor in a rendering instruction called by the central processor, the illumination information of the object in the game scene is sampled by utilizing the resource texture and the indirect texture according to the position information of the surface sampling point of the object in the game scene, and the illumination information of the object is rendered.
It should be noted that other corresponding descriptions of the functional units related to the rendering apparatus for lighting information in a game scene provided in this embodiment may refer to the corresponding descriptions in fig. 1 to fig. 2, and are not repeated herein.
Based on the methods shown in fig. 1, fig. 2, and fig. 4, correspondingly, an embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for rendering the lighting information in the game scene shown in fig. 1, fig. 2, and fig. 4 is implemented.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Based on the method shown in fig. 1, fig. 2, and fig. 4 and the virtual device embodiments shown in fig. 6 to fig. 7, to achieve the above object, an embodiment of the present application further provides an entity device for rendering illumination information in a game scene, which may be specifically a computer, a smart phone, a tablet computer, a smart watch, a server, or a network device, where the entity device includes a storage medium and a processor; a storage medium for storing a computer program; a processor, configured to execute a computer program to implement the method for rendering lighting information in a game scene as shown in fig. 1, fig. 2, and fig. 4.
Optionally, the entity device may further include a user interface, a network interface, a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, and the like. The user interface may include a Display screen (Display), an input unit such as a keypad (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), etc.
In an exemplary embodiment, referring to fig. 8, the entity device includes a communication bus, a processor, a memory, and a communication interface, and may further include an input/output interface and a display device, where the functional units may communicate with each other through the bus. The memory stores computer programs, and the processor is used for executing the programs stored in the memory and executing the rendering method of the illumination information in the game scene in the embodiment.
Those skilled in the art will appreciate that the physical device structure for rendering the illumination information in the game scene provided by the present embodiment does not constitute a limitation to the physical device, and may include more or less components, or combine some components, or arrange different components.
The storage medium may further include an operating system and a network communication module. The operating system is a program for managing hardware and software resources of the actual device for store search information processing, and supports the operation of the information processing program and other software and/or programs. The network communication module is used for realizing communication among components in the storage medium and communication with other hardware and software in the information processing entity device.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus a necessary general hardware platform, and can also be implemented by hardware. By applying the technical scheme, compared with the prior art, the method and the device have the advantages that the graphics processor responds to the rendering instruction called by the central processing unit, the illumination information of the object in the game scene is sampled by utilizing the resource texture and the indirect texture according to the position information of the surface sampling point of the object in the game scene, and the illumination information of the object is rendered.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (11)

1. A rendering method of illumination information in a game scene is characterized by comprising the following steps:
arranging a probe grid aiming at spatial voxels in a game scene, wherein the probe grid comprises an illumination probe used for capturing illumination information in the game scene, the probe grid comprises an effective illumination probe created aiming at a short-distance voxel in the spatial voxel within a preset level and a virtual illumination probe created aiming at the spatial voxel by adding the voxel meeting an adding condition in a virtual voxel, and the short-distance voxel is the voxel meeting a distance condition in the voxels of the preset level formed by the segmentation of the spatial voxel in the game scene;
updating the illumination probes at the corresponding viewpoint positions in the probe grids according to the viewpoint positions in the game scene, and capturing illumination information of the viewpoint positions;
generating a plurality of probe data textures with the same data size by the central processing unit of the illumination information of the viewpoint position, and transmitting the probe data textures to the graphic processor, wherein the probe data textures comprise resource textures and indirect textures, and the hierarchical relationship of the probe data corresponding to the viewpoint position is recorded in the indirect textures;
and responding to a rendering instruction called by the central processing unit, the graphics processor samples the illumination information of the object in the game scene by using the resource texture and the indirect texture according to the position information of the surface sampling point of the object in the game scene, and renders the illumination information of the object.
2. The method according to claim 1, wherein the illumination probes in the probe grid have a node hierarchical relationship, and the updating the illumination probes at corresponding viewpoint positions in the probe grid according to the viewpoint positions in the game scene and capturing the illumination information of the viewpoint positions specifically includes:
inquiring the node level relation of the viewpoint position mapping illumination probe according to the viewpoint position in the game scene;
and according to the node hierarchical relation of the viewpoint position mapping illumination probe, updating the illumination probe at the corresponding viewpoint position in the probe grid, and capturing the illumination information of the viewpoint position.
3. The method according to claim 1, wherein the illumination information of the viewpoint carries a node hierarchy relationship, and the generating of the illumination information of the viewpoint into a plurality of probe data textures having the same data size and then transmitting the probe data textures to a graphics processor specifically includes:
extracting resource textures and indirect textures by using the node hierarchical relation carried by the illumination information of the viewpoint position;
and generating a plurality of probe data textures with the same data size by the resource texture and the indirect texture and transmitting the probe data textures to a graphic processor.
4. The method according to claim 3, wherein the extracting the resource texture and the indirect texture using the node hierarchical relationship carried by the lighting information of the viewpoint position specifically includes:
expanding the illumination information of the viewpoint position information into resource textures according to the node hierarchical relationship carried by the illumination information of the viewpoint position;
and storing the original hierarchical relation of the resource texture in the tree structure to the indirect texture in the process of expanding the resource texture.
5. The method according to any one of claims 1 to 4, wherein the arranging of the probe grid for spatial voxels in the game scene specifically comprises:
obtaining a near distance voxel contained in a space voxel in a game scene, wherein the near distance voxel is a voxel meeting a distance condition in voxels of a preset level formed by space voxel segmentation in the game scene, and the distance condition is that a bounding box of the voxel is intersected with an object bounding box in the game scene;
a grid of probes is arranged for the close range voxels comprised by the spatial voxels.
6. The method according to claim 5, wherein the illumination probes in the probe grid comprise an active illumination probe and a virtual illumination probe, and the arranging the probe grid for the close-range voxels included in the spatial voxel comprises:
creating an active light probe for a near voxel within a hierarchy of the spatial voxels;
adding virtual voxels corresponding to the levels for the spatial voxels, and creating a virtual illumination probe for the voxels meeting the adding conditions in the virtual voxels, wherein the virtual illumination probe is used for performing seamless interpolation on illumination information sampled by the voxels which are close to the levels in the spatial voxels.
7. The method according to any one of claims 1 to 4, wherein the sampling illumination information of an object in a game scene by using the resource texture and the indirect texture according to the position information of the object surface sampling point in the game scene and rendering the illumination information of the object specifically comprises:
acquiring the original hierarchical relation of the resource texture in the tree structure from the indirect texture according to the position information of the object surface sampling point in the game scene;
and sampling illumination information of objects in a game scene from the resource textures by utilizing the original hierarchical relation of the resource textures in the tree structure, and rendering the illumination information of the objects.
8. The method according to claim 7, wherein the sampling illumination information of an object in a game scene from the resource texture by using the original hierarchical relationship of the resource texture in the tree structure and rendering the illumination information of the object comprises:
acquiring the level and the offset of the resource texture in the tree structure by utilizing the original hierarchical relation of the resource texture in the tree structure;
calculating the illumination sampling position cached in the resource texture according to the level and the offset of the resource texture in the tree structure;
and sampling illumination information of objects in the game scene according to the illumination sampling positions cached in the resource texture, and rendering the illumination information of the objects.
9. An apparatus for rendering illumination information in a game scene, comprising:
the system comprises an arrangement unit, a detection unit and a processing unit, wherein the arrangement unit is used for arranging a probe grid aiming at space voxels in a game scene, the probe grid comprises an illumination probe used for capturing illumination information in the game scene, the probe grid comprises an effective illumination probe created aiming at near distance voxels in the space voxels within a preset level and a virtual illumination probe created by adding voxels meeting an adding condition in virtual voxels aiming at the space voxels, and the near distance voxels are voxels meeting a distance condition in voxels of the preset level formed by space voxel segmentation in the game scene;
the updating unit is used for updating the illumination probes at the corresponding viewpoint positions in the probe grids according to the viewpoint positions in the game scene and capturing illumination information of the viewpoint positions;
the generating unit is used for generating a plurality of probe data textures with the same data size from the illumination information of the viewpoint position through a central processing unit and transmitting the probe data textures to an image processor, wherein the probe data textures comprise resource textures and indirect textures, and the hierarchical relationship of the probe data corresponding to the viewpoint position is recorded in the indirect textures;
and the rendering unit is used for responding to a rendering instruction called by the central processing unit, and the graphics processor samples the illumination information of the object in the game scene by using the resource texture and the indirect texture according to the position information of the object surface sampling point in the game scene and renders the illumination information of the object.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor when executing the computer program realizes the steps of a method for rendering lighting information in a game scene according to any one of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of a method for rendering lighting information in a game scene according to any one of claims 1 to 8.
CN202110342315.4A 2021-03-30 2021-03-30 Rendering method, device and equipment for illumination information in game scene Active CN113034656B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110342315.4A CN113034656B (en) 2021-03-30 2021-03-30 Rendering method, device and equipment for illumination information in game scene
CN202210188716.3A CN114549723A (en) 2021-03-30 2021-03-30 Rendering method, device and equipment for illumination information in game scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110342315.4A CN113034656B (en) 2021-03-30 2021-03-30 Rendering method, device and equipment for illumination information in game scene

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202210188716.3A Division CN114549723A (en) 2021-03-30 2021-03-30 Rendering method, device and equipment for illumination information in game scene

Publications (2)

Publication Number Publication Date
CN113034656A CN113034656A (en) 2021-06-25
CN113034656B true CN113034656B (en) 2022-03-22

Family

ID=76452900

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202210188716.3A Pending CN114549723A (en) 2021-03-30 2021-03-30 Rendering method, device and equipment for illumination information in game scene
CN202110342315.4A Active CN113034656B (en) 2021-03-30 2021-03-30 Rendering method, device and equipment for illumination information in game scene

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202210188716.3A Pending CN114549723A (en) 2021-03-30 2021-03-30 Rendering method, device and equipment for illumination information in game scene

Country Status (1)

Country Link
CN (2) CN114549723A (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160379B (en) * 2021-05-24 2023-03-24 网易(杭州)网络有限公司 Material rendering method and device, storage medium and electronic equipment
CN113546416A (en) * 2021-08-16 2021-10-26 网易(杭州)网络有限公司 Game scene processing method and device, computer equipment and storage medium
CN117011119A (en) * 2022-06-09 2023-11-07 腾讯科技(深圳)有限公司 Illumination information loading method and device, computer equipment and storage medium
CN115359170B (en) * 2022-10-19 2023-03-03 北京百度网讯科技有限公司 Scene data generation method and device, electronic equipment and storage medium
CN116310061B (en) * 2023-05-18 2023-08-08 腾讯科技(深圳)有限公司 Data processing method and device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106100753A (en) * 2016-06-02 2016-11-09 北京邮电大学 Two-way wire and wireless mixed light cut-in method based on optical phase modulator and system
CN111915710A (en) * 2020-07-10 2020-11-10 杭州渲云科技有限公司 Building rendering method based on real-time rendering technology

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995700A (en) * 2014-05-14 2014-08-20 无锡梵天信息技术股份有限公司 Method for achieving global illumination of 3D game engine
CN106204701B (en) * 2016-06-22 2019-04-30 浙江大学 A kind of rendering method calculating indirect reference bloom based on light probe interpolation dynamic
US11069135B2 (en) * 2019-03-07 2021-07-20 Lucasfilm Entertainment Company Ltd. On-set facial performance capture and transfer to a three-dimensional computer-generated model
CN110193193B (en) * 2019-06-10 2022-10-04 网易(杭州)网络有限公司 Rendering method and device of game scene
CN110992466B (en) * 2019-12-05 2021-05-18 腾讯科技(深圳)有限公司 Illumination probe generation method and device, storage medium and computer equipment
CN112233217B (en) * 2020-12-18 2021-04-02 完美世界(北京)软件科技发展有限公司 Rendering method and device of virtual scene

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106100753A (en) * 2016-06-02 2016-11-09 北京邮电大学 Two-way wire and wireless mixed light cut-in method based on optical phase modulator and system
CN111915710A (en) * 2020-07-10 2020-11-10 杭州渲云科技有限公司 Building rendering method based on real-time rendering technology

Also Published As

Publication number Publication date
CN113034656A (en) 2021-06-25
CN114549723A (en) 2022-05-27

Similar Documents

Publication Publication Date Title
CN113034656B (en) Rendering method, device and equipment for illumination information in game scene
CN110738721B (en) Three-dimensional scene rendering acceleration method and system based on video geometric analysis
US11024077B2 (en) Global illumination calculation method and apparatus
CN111340928B (en) Ray tracing-combined real-time hybrid rendering method and device for Web end and computer equipment
US11804002B2 (en) Techniques for traversing data employed in ray tracing
US11373358B2 (en) Ray tracing hardware acceleration for supporting motion blur and moving/deforming geometry
US11816783B2 (en) Enhanced techniques for traversing ray tracing acceleration structures
JP6864495B2 (en) Drawing Global Illumination in 3D scenes
US11508112B2 (en) Early release of resources in ray tracing hardware
KR20080018404A (en) Computer readable recording medium having background making program for making game
CN113034657B (en) Rendering method, device and equipment for illumination information in game scene
Wyman et al. Frustum-traced raster shadows: Revisiting irregular z-buffers
RU2680355C1 (en) Method and system of removing invisible surfaces of a three-dimensional scene
Apers et al. Interactive Light Map and Irradiance Volume Preview in Frostbite
CN117058301B (en) Knitted fabric real-time rendering method based on delayed coloring
US20240009226A1 (en) Techniques for traversing data employed in ray tracing
US20240087211A1 (en) Generation and Traversal of Partial Acceleration Structures for Ray Tracing
Wang et al. GPU-based Grass Simulation with Accurate Blade Reconstruction
Simion et al. Practical gpu and voxel-based indirect illumination for real time computer games
Favorskaya et al. Large scene rendering
Forstmann et al. Visualizing large procedural volumetric terrains using nested clip-boxes
Koçdemir Visibility grid method for efficient crowd rendering wirh shadows
ARCH for the degree of Master of Science in the Department of Game Technologies
Koçdemir Visibility grid method for efficient crowd rendering with shadows
Liu et al. The Research of Real-Time Shadow Rendering Algorithm of Virtual Scenes

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
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20210625

Assignee: Beijing Xuanguang Technology Co.,Ltd.

Assignor: Perfect world (Beijing) software technology development Co.,Ltd.

Contract record no.: X2022990000254

Denomination of invention: Method, device and equipment for rendering lighting information in game scenes

Granted publication date: 20220322

License type: Exclusive License

Record date: 20220610