WO2024109006A1 - Light source elimination method and rendering engine - Google Patents

Light source elimination method and rendering engine Download PDF

Info

Publication number
WO2024109006A1
WO2024109006A1 PCT/CN2023/101625 CN2023101625W WO2024109006A1 WO 2024109006 A1 WO2024109006 A1 WO 2024109006A1 CN 2023101625 W CN2023101625 W CN 2023101625W WO 2024109006 A1 WO2024109006 A1 WO 2024109006A1
Authority
WO
WIPO (PCT)
Prior art keywords
light source
target
rendering
point
cache
Prior art date
Application number
PCT/CN2023/101625
Other languages
French (fr)
Chinese (zh)
Inventor
李洪珊
Original Assignee
华为云计算技术有限公司
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 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2024109006A1 publication Critical patent/WO2024109006A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/10Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes

Definitions

  • the present application relates to the field of computer technology, and in particular to a light source culling method and a rendering engine.
  • Rendering technology refers to the output of realistic images that simulate the same model and lighting conditions in the real world based on 3D model data (including object geometry, surface material, etc.) and light data (including light source position, color, intensity, etc.).
  • Deferred rendering is a way to achieve rendering. In deferred rendering, a calculation is first performed to remove the faces of the 3D space that cannot be seen on the user's screen, and the face elements and vertex information that can be seen by the user are saved in a global buffer. Then, shading calculations are performed based on the information saved in the buffer. In this way, shading calculations are only performed on the information visible to the user, thereby reducing the amount of shading calculations in the rendering process.
  • Light source culling is a means to achieve delayed rendering.
  • the current light source culling includes screen space-based light source culling and camera space-based light source culling.
  • Screen space-based light source culling refers to dividing the screen space seen by the user into multiple two-dimensional grids of the same size, calculating the lighting result of each light source at each two-dimensional grid, and if the lighting result of the light source at the two-dimensional grid is less than the threshold, the influence of the light source on the two-dimensional grid is not calculated in the shading calculation stage.
  • Camera space-based light source culling refers to dividing the calculated camera space into multiple three-dimensional grids of the same size, calculating the lighting result of each light source at each three-dimensional grid, and if the lighting result of the light source at the three-dimensional grid is less than the threshold, the influence of the light source on the three-dimensional grid is not calculated in the shading calculation stage.
  • Both screen space and camera space are generated based on multiple perspectives, which requires calculating the light source culling result at each perspective, resulting in a large amount of light source culling calculation.
  • the embodiments of the present application provide a light source culling method and a rendering engine for sharing light source culling results among multiple perspectives, thereby reducing the amount of computation required for light source culling.
  • an embodiment of the present application provides a light source culling method, which can be used for a rendering application, wherein the rendering application includes multiple three-dimensional models and multiple light sources, each of the multiple three-dimensional models includes multiple cache points, and the method includes: respectively calculating multiple light intensity values of the multiple light sources at a target cache point, the multiple cache points including the target cache point, and the visible space corresponding to the first viewpoint includes the target cache point; according to the multiple light intensity values and the light intensity threshold, determining to indicate a target light source from the multiple light sources, and based on the at least one target light source, performing shading calculation on the target cache point to obtain a rendering result corresponding to the first viewpoint.
  • the light source culling calculation of the three-dimensional model is based on the granularity of the cache point, so that the light source culling results of the same cache point under different viewpoints can be shared, thereby eliminating the need to calculate the light source culling results of the same cache point under different viewpoints, thereby reducing the amount of light source culling calculations.
  • the visible space corresponding to the second viewpoint includes the target cache point
  • the method may further include: performing shading calculation on the target cache point based on at least one target light source to obtain a rendering result corresponding to the second viewpoint.
  • the cache point is one or more of the following: a patch, a texel point, or a point in a point cloud.
  • Setting the cache point to a patch, a texel point, or a point in a point cloud means that the rendering process is performed at the granularity of a patch, a texel point, or a point in a point cloud.
  • Source culling can improve the accuracy of light source culling and reduce the problem of too much or too little light source culling.
  • the cache points are located on the surface of the three-dimensional model, and different three-dimensional models include different numbers of cache points.
  • the method may further include: providing a configuration interface, wherein the configuration interface is used to receive the light intensity threshold value set by the user, so that the user can input the light intensity threshold value by himself through the configuration interface, thereby improving adaptability.
  • the illumination intensity value of each target light source of the at least one target light source at the target cache point is greater than or equal to the illumination intensity threshold.
  • an embodiment of the present application provides a rendering engine, which is used for rendering applications, wherein the rendering application includes multiple three-dimensional models and multiple light sources, each three-dimensional model includes multiple cache points, and the rendering engine includes a processing unit and a storage unit; the processing unit is used to obtain a target cache point from the storage unit, and respectively calculate multiple light intensity values of the multiple light sources at the target cache points, the multiple cache points include the target cache point, and the visible space corresponding to the first viewpoint includes the target cache point; according to the multiple light intensity values and the light intensity threshold, determine at least one target light source from the multiple light sources; and based on the at least one target light source, perform shading calculation on the target cache point to obtain a rendering result corresponding to the first viewpoint.
  • the visible space corresponding to the second viewpoint includes the target cache point
  • the processing unit is further used to: perform shading calculation on the target cache point based on the at least one target light source to obtain a rendering result corresponding to the second viewpoint.
  • the cache point is one or more of the following: a patch, a texel point, or a point in a point cloud.
  • the cache points are located on the surface of the three-dimensional model, and different three-dimensional models include different numbers of cache points.
  • the rendering engine may further include a configuration interface, wherein the configuration interface is used to receive the light intensity threshold set by a user.
  • the illumination intensity value of each target light source of the at least one target light source at the target cache point is greater than or equal to the illumination intensity threshold.
  • an embodiment of the present application provides a computer program product comprising instructions, which, when executed by a computer device cluster, causes the computer device cluster to execute the method provided in the first aspect or any possible design of the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, comprising computer program instructions.
  • the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method provided by the first aspect or any possible design of the first aspect.
  • an embodiment of the present application provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device performs a method provided by the first aspect or any possible design of the first aspect.
  • the computing device cluster includes a computing device, which includes a processor and a memory; the processor is used to execute instructions stored in the memory to run the rendering engine provided by the second aspect or any possible design of the second aspect, so that the computing device performs a method provided by the first aspect or any possible design of the first aspect.
  • the computing device cluster includes at least two computing devices, each computing device includes a processor and a memory.
  • the processors of the at least two computing devices are used to execute instructions stored in the memories of the at least two computing devices to run the rendering engine provided by the second aspect or any possible design of the second aspect, so that the computing device cluster performs the method provided by the first aspect or any possible design of the first aspect.
  • FIG1 is a schematic diagram of UV unfolding in an embodiment of the present application.
  • FIG2 is a schematic diagram of light source culling based on screen space in an embodiment of the present application.
  • FIG3 is a schematic diagram of light source culling based on camera space in an embodiment of the present application.
  • FIG4 is a schematic diagram of a rendering system in an embodiment of the present application.
  • FIG5 is a schematic diagram of a flow chart of a light source elimination method provided in an embodiment of the present application.
  • FIG6 is another schematic flow chart of a light source elimination method provided in an embodiment of the present application.
  • FIG7 is a schematic diagram of a light source elimination result provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of a structure of a rendering engine provided in an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a structure of a computing device provided in an embodiment of the present application.
  • a 3D model is a polygonal representation of an object, usually displayed by a computer or other video device.
  • the shapes of a 3D model can be various, for example, a sphere, a cone, a curved object, a flat object, an object with an irregular surface, etc.
  • the displayed object can be a real-world entity or a fictional object.
  • 3D models are often generated using specialized software such as 3D modeling tools, but they can also be generated by other methods. As a collection of data of points and other components, a 3D model can be generated manually or according to a certain algorithm.
  • the facets involved in the embodiments of the present application may also be referred to as meshes, which divide the surface of a three-dimensional model into countless tiny planes. These planes may be any polygons, and triangles and quadrilaterals are commonly used.
  • the shapes of the facets of three-dimensional models with different shapes may also be different. For example, the shapes of the facets of a sphere and the facets of a curved object may be completely different.
  • the size of the facets may be set as needed, and the higher the accuracy requirements for the rendered image, the smaller the size of the facets may be set.
  • the position, shape or size of the facets in the three-dimensional model may be described by geometric parameters.
  • the texel points involved in the embodiments of the present application may also be referred to as texels, texture elements, etc., which are the smallest component units of each of the multiple two-dimensional planes when the surface of a three-dimensional model is mapped into multiple two-dimensional planes.
  • the surface of a three-dimensional model can be expanded by UV to obtain multiple two-dimensional planes, where U refers to the horizontal axis of the two-dimensional plane and V refers to the vertical axis of the two-dimensional plane.
  • U refers to the horizontal axis of the two-dimensional plane
  • V refers to the vertical axis of the two-dimensional plane.
  • the car seat in Figure 1 (a) is expanded by UV as shown in Figure 1 (b).
  • the two-dimensional plane after such expansion can be called a texture, which is composed of texel points.
  • the point cloud involved in the embodiment of the present application is a data set obtained by mapping the surface of a three-dimensional model.
  • a point in the point cloud is the smallest component unit in the point cloud.
  • the patches, texel points, and points in the point cloud involved in the embodiments of the present application are different expressions of the surface of the three-dimensional model.
  • the embodiments of the present application do not limit the acquisition method and implementation method of the patches, texel points, and points in the point cloud.
  • the viewpoint involved in the embodiments of the present application can be understood as the position of the observer (such as a camera or human eye, etc.).
  • the viewing angle involved in the embodiments of the present application can be understood as the angle at which the observer observes the virtual scene. It should be noted that the "viewpoint” and “viewing angle” in the embodiments of the present application can be used interchangeably.
  • the cache points involved in the embodiments of the present application may also be referred to as cache units or surface cache points, etc., which are located on the surface of the three-dimensional model and are used to store the calculation results in the rendering process, and the calculation results may include, for example, light source culling results, shading results, or light effect results.
  • the cache points are used to store light source culling results as an example. It should be understood that the number of cache points of different three-dimensional models may be different.
  • the cache point can be one or more of the following: a patch, a texel point, and a point in a point cloud.
  • the patch can store the light source culling result of the patch, and then the light source culling result of the patch can be obtained through the patch.
  • the texel point can store the light source culling result of the texel point, and then the light source culling result of the texel point can be obtained through the texel point.
  • the cache point is a point in a point cloud
  • the point can store the light source culling result of the point, and then the light source culling result of the point can be obtained through the point.
  • the cache point is used to store the light source culling results, which can also be understood as a correspondence (or association) between the cache point and the light source culling results.
  • the light source culling result of the cache point can be obtained through the cache point and the correspondence (or association) between the cache point and the light source culling results.
  • the embodiments of the present application involve one or more light sources.
  • the light generated by the light source is irradiated onto a three-dimensional model.
  • the light source may be a point light source, a line light source, or a surface light source, etc. After the light generated by the light source contacts the surface of the three-dimensional model, one of the following situations may occur at each contact point on the surface: refraction, reflection, or diffuse reflection. Then, the light enters the user's eyes.
  • Shading calculation refers to the calculation of the color of light from the light source along the light ray direction to the shading point, and then along the veiw ray direction to the camera during the rendering process, for the line of sight (veiw ray) direction and the light (light ray) direction.
  • At least one refers to one or more, and a plurality refers to two or more.
  • the words “first”, “second”, etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
  • the first viewpoint and the second viewpoint mentioned below are used to distinguish different viewpoints, and do not mean Indicates the order and priority of the two viewpoints.
  • FIG2 shows a schematic diagram of light source culling based on screen space.
  • the screen space is divided into multiple two-dimensional grids, and light source culling is performed with the two-dimensional grid as the granularity.
  • the screen space lacks depth information, and different pixels in the same two-dimensional grid may be illuminated by different light sources.
  • the chair and the small room behind it in FIG2 may be illuminated by different light sources and the lighting results are different, which leads to errors in the light source culling results, which is not conducive to subsequent shading calculations;
  • the screen space is a space generated based on multiple perspectives or multiple viewpoints.
  • the light source culling results under different perspectives or different viewpoints need to be calculated, and the amount of calculation for light source culling is large.
  • FIG3 shows a schematic diagram of light source culling based on camera space. As shown in FIG3, the camera space is divided into multiple three-dimensional grids, and light source culling is performed with the three-dimensional grid as the granularity. Since the camera space is also a space generated based on multiple perspectives or multiple viewpoints, each three-dimensional grid also requires light source culling results under different perspectives or different viewpoints, and the amount of light source culling calculation is relatively large.
  • an embodiment of the present application provides a light source culling method, in which light source culling is performed at a cache point as the granularity, so that the light source culling results at the same cache point under different viewing angles or different viewpoints can be shared, thereby eliminating the need to calculate the light source culling results at the same cache point under each viewing angle or each viewpoint, thereby reducing the amount of computational complexity of light source culling.
  • Figure 4 is a schematic diagram of the structure of a rendering system involved in the present application.
  • the rendering system of the present application is used to render a three-dimensional (or two-dimensional) model of a virtual scene by a rendering method to obtain a two-dimensional image, that is, a rendered image.
  • the rendering system of the present application may include: one or more terminal devices 100, a network device 200, and a rendering platform 300.
  • the rendering platform 300 can be deployed on a cloud server, but the embodiments of the present application are not limited thereto.
  • the rendering platform 300 and the terminal device 100 are generally deployed in different data centers.
  • the terminal device 100 may be a device that needs to display rendered images in real time, for example, a virtual reality device (VR) for flight training, a computer for virtual games, a smart phone for a virtual mall, etc., which are not specifically limited here.
  • the terminal device may be a high-configuration, high-performance device (for example, multi-core, high main frequency, large memory, etc.), or a low-configuration, low-performance device (for example, single-core, low main frequency, small memory, etc.).
  • the terminal device 100 may include hardware, an operating system, and a rendering application client.
  • the network device 200 is used to transmit data between the terminal device 100 and the rendering platform 300 through a communication network of any communication mechanism/communication standard.
  • the communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.
  • the rendering platform 300 includes one or more rendering nodes (three rendering nodes are taken as an example in FIG. 4 ).
  • the rendering platform 300 can be implemented by one or more computing devices. Multiple computing devices can constitute a computing device cluster.
  • the functions of the rendering node can be implemented by one or more computing devices.
  • the rendering node can include rendering hardware, virtualization services, rendering engines, and rendering application servers from bottom to top.
  • the rendering hardware includes computing resources, storage resources, and network resources.
  • the computing resources can adopt a heterogeneous computing architecture, for example, a central processing unit (CPU) + graphics processing unit (GPU) architecture, CPU + AI chip, CPU + GPU + AI chip architecture, etc., which are not specifically limited here.
  • Storage resources may include storage devices such as memory and video memory.
  • Network resources may include network cards, port resources, address resources, etc.
  • Virtualization services virtualize the resources of rendering nodes into vCPUs, etc. through virtualization technology, and flexibly isolate independent resources according to user needs to run user applications.
  • virtualization services may include virtual machine (VM) services and container services.
  • VM and container may run rendering engines and rendering application servers.
  • the rendering engine is used to implement rendering algorithms.
  • the rendering application server is used to call the rendering engine to complete the rendering of the rendered image.
  • the rendering application client on the terminal device 100 and the rendering application server of the rendering platform 300 can be collectively referred to as a rendering application.
  • Common rendering applications may include: game applications, VR applications, movie special effects, and animations, etc.
  • the user inputs an operation instruction through the rendering application client, and the rendering application client sends the operation instruction to the rendering application server.
  • the rendering application server calls the rendering engine to generate a rendering result, sends the rendering result to the rendering application client, and then the rendering application client converts the rendering result into an image and presents it to the user.
  • the user can input a light intensity threshold through the rendering application client, and the rendering application client sends the light intensity threshold set by the user to the rendering application server.
  • the rendering application server schedules the rendering engine and configures the light intensity threshold.
  • the rendering engine performs light source culling according to the light intensity threshold, and generates a rendering result according to the light source culling, and sends the rendering result to the rendering application client, and then the rendering application client converts the rendering result into an image and presents it to the user.
  • the rendering application server and the rendering application client may be provided by a rendering application provider, and the rendering engine may be provided by a cloud service provider.
  • the rendering application may be a game application.
  • the game developer of the game application installs the game application server on the rendering platform provided by the cloud service provider, and the game developer of the game application installs the game application client via the Internet. Provide it to users for download and install on their terminal devices.
  • the cloud service provider also provides a rendering engine, which can provide computing power for the game application.
  • the rendering application client, the rendering application server, and the rendering engine can all be provided by the cloud service provider.
  • the rendering system may further include a management device (not shown in FIG. 4 ).
  • the management device may be a device provided by a third party other than the user's terminal device and the rendering platform 300 of the cloud service provider.
  • the management device may be a device provided by a game developer. The game developer may manage the rendering application through the management device. It is understood that the management device may be disposed on the rendering platform 300 or outside the rendering platform 300, which is not specifically limited here.
  • the light source culling method involved in the present application is described in detail.
  • the light source culling method provided in the embodiment of the present application can be executed by the rendering platform 300, or by a rendering node in the rendering platform 300, or by a rendering engine in a rendering node.
  • the illustrations of the various components in the rendering system will not be described in detail later.
  • FIG5 for a flow chart of a light source elimination method provided in an embodiment of the present application.
  • the rendering platform obtains relevant information of the rendering application.
  • the rendering application includes one or more three-dimensional models, and one or more light sources.
  • the embodiment of the present application takes multiple models and multiple light sources as an example.
  • Each of the multiple three-dimensional models includes one or more cache points (hereinafter, multiple cache points are taken as an example).
  • the relevant information of the rendering application may include light source parameters of multiple light sources and information of each three-dimensional model.
  • the information of each three-dimensional model may, for example, include the situation of the cache points mapped by the three-dimensional model.
  • the cache points involved in the embodiments of the present application may be one or more of a patch, a texel point, and a point in a point cloud.
  • the information of each three-dimensional model may include the patch division of the surface of the three-dimensional model, the patch number, the geometric parameters of the patch, etc.
  • the information of each three-dimensional model may include the texture mapping of the surface of the three-dimensional model, the texture map size, the texture coordinates, etc.
  • the information of each three-dimensional model may include the point cloud mapping of the surface of the three-dimensional model, the point cloud structure, the point cloud coordinates, etc.
  • the relevant information of the rendering application may be information sent by the terminal device to the rendering platform, or may be information sent by the management device to the rendering platform.
  • FIG5 takes the example of the terminal device sending the relevant information of the rendering application to the rendering platform.
  • the rendering platform respectively calculates multiple light intensity values of multiple light sources at target cache points.
  • the multiple cache points include the target cache point.
  • the rendering platform can initialize the surface cache of each of the multiple 3D models to obtain multiple cache points of each 3D model; for each 3D model, the rendering platform calculates multiple illumination intensity values of multiple light sources at the target cache points to be rendered.
  • the number of target cache points can be understood as one or more.
  • the rendering platform can illuminate the target cache point with one or more light sources, and respectively calculate the illumination intensity values of the one or more light sources at the target cache point to reduce the amount of illumination intensity calculation.
  • the embodiment of the present application takes the target cache point illuminated by multiple light sources as an example.
  • the rendering platform can establish a bitmap of the target cache point, and there is a corresponding relationship between the bitmap and the multiple light sources in the environment where the target cache point is located; the rendering platform determines the multiple light sources that illuminate the target cache point based on the bitmap, and respectively calculates the multiple illumination intensity values of the multiple light sources at the target cache point.
  • the rendering platform determines at least one target light source from multiple light sources according to multiple light intensity values and light intensity thresholds.
  • the light intensity threshold may be predefined by the rendering system, such as a light intensity threshold determined by the rendering system based on historical rendering results.
  • the light intensity threshold may be set by a user, such as a rendering system may include a configuration interface, which may be used to receive the light intensity threshold set by a user.
  • the terminal device may carry the light intensity threshold set by the user in the relevant information of the rendering application and send it to the rendering platform.
  • the rendering platform compares multiple illumination intensity values with the illumination intensity threshold respectively, and determines at least one target light source from the multiple light sources.
  • the illumination intensity value of each target light source in the at least one target light source at the target cache point is greater than or equal to the illumination intensity threshold.
  • the rendering platform can traverse each light source, calculate the illumination intensity value of each light source at the target cache point, and compare the calculated illumination intensity value with the illumination intensity threshold. If the illumination intensity value is greater than or equal to the illumination intensity threshold, the value of the light source corresponding to the illumination intensity value on the bitmap is set to the first value (such as 1). If the illumination intensity value is less than the illumination intensity threshold, the value of the light source corresponding to the illumination intensity threshold on the bitmap is set to the second value (such as 0). After traversing multiple light sources of the rendering application (or traversing multiple light sources that illuminate the target cache point), the light source corresponding to the first value on the bitmap is the target light source.
  • the light source culling result is based on the granularity of a cache point, and the generation of the cache point is independent of the viewpoint or viewing angle.
  • the cache point can be one or more of a patch, a texel point, or a point in a point cloud. Since the generation of the cache point is independent of the viewpoint or viewing angle, this means that the target light source whose light intensity value at the target cache point is greater than or equal to the light intensity threshold at different viewpoints or different viewing angles is the same, and multiple viewpoints or multiple viewing angles can share the light source culling result.
  • the rendering platform performs shading calculation on the target cache point based on at least one target light source to obtain a rendering corresponding to the first viewpoint.
  • the target cache point is included in the visible space corresponding to the first viewpoint.
  • the rendering platform can perform shading calculations on the target cache point based on at least one target light source, without considering the influence of light sources other than at least one target light source on the target cache point among the multiple light sources. For example, the rendering platform can shade the target cache point according to the light source corresponding to the first value on the bitmap of the target cache point. Taking multiple light sources including light source 1, light source 2, light source 3 and light source 4 as an example, the light intensity values of light source 1 and light source 2 are greater than or equal to the light intensity threshold, and the light intensity values of light source 3 and light source 4 are less than the light intensity threshold, as shown in Figure 6; the rendering platform can perform shading calculations on the target cache point based on light source 1 and light source 2.
  • the rendering results of the same cache point at different viewpoints or different viewing angles may be the same or different, but the light source culling results of the same cache point at different viewpoints or different viewing angles are the same.
  • the visual space corresponding to the first viewpoint includes the target cache point, and the rendering platform performs shading calculations on the target cache point based on at least one target light source to obtain the rendering result corresponding to the first viewpoint.
  • the rendering platform stores a correspondence between a target cache point and at least one target light source.
  • the rendering platform stores the correspondence between the target cache point and at least one target light source in a memory.
  • the memory may include a volatile memory, such as a random access memory (RAM).
  • the memory may also be a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
  • ROM read-only memory
  • HDD hard disk drive
  • SSD solid state drive
  • the memory may be deployed outside the rendering platform or inside the rendering platform.
  • the memory may be deployed inside the rendering engine.
  • the rendering platform can establish a light source rejection result table for multiple cache points corresponding to each three-dimensional model.
  • the light source rejection result table may include the number of each cache point, and the number of one or more light sources whose illumination intensity threshold at each cache point is greater than or equal to the illumination intensity threshold.
  • the light source rejection result table can be shown in Table 1. It should be noted that the rendering platform can uniquely identify the cache point corresponding to the three-dimensional model by number or index, or can uniquely identify the cache point corresponding to the three-dimensional model by coordinates, parameters, etc., which is not limited in the embodiments of the present application.
  • the rendering platform may first store the correspondence between the target cache point and at least one target light source, and then perform shading calculation on the target cache point based on the at least one target light source to obtain the rendering result corresponding to the first viewpoint; or, the rendering platform may also perform shading calculation on the target cache point based on the at least one target light source, and store the correspondence between the target cache point and the at least one target light source and the target cache point.
  • the rendering platform performs light source culling at the cache point granularity, so that the light source culling results at the same cache point under different viewing angles or different viewpoints can be shared, thereby eliminating the need to calculate the light source culling results at the same cache point under each viewing angle or each viewpoint, thereby reducing the amount of computation for light source culling.
  • FIG. 7 another schematic flow chart of a method for eliminating light sources provided in an embodiment of the present application is shown. As shown in Fig. 7, the method may include the following contents.
  • the rendering platform receives a rendering request.
  • the rendering request may come from a terminal device or a management device.
  • FIG7 takes the rendering request coming from a terminal device as an example.
  • the rendering request may include relevant information of the second viewpoint, which is used to request the rendering result of the second viewpoint.
  • the relevant information of the second viewpoint may be, for example, the viewpoint direction of the second viewpoint, etc., and then the rendering platform may determine the second viewpoint of the user based on the relevant information of the second viewpoint.
  • the rendering request may also include an identifier of the rendering application.
  • the identifier of the rendering application uniquely identifies the rendering application in the rendering system. In some scenarios, when the rendering system includes only one rendering application, the identifier of the rendering application may not be carried in the rendering request.
  • S701 is an optional step, which is indicated by a dotted line in Figure 7. That is, the rendering platform may obtain the rendering result of the second viewpoint in response to the rendering request, in which case the first viewpoint and the second viewpoint may be the same or different; or the rendering platform may obtain the rendering result of the second viewpoint after obtaining the rendering result of the first viewpoint, so as to obtain the rendering result under different viewpoints, in which case the first viewpoint and the second viewpoint are different.
  • the visible space corresponding to the second viewpoint includes the target cache point in the process shown in FIG. 5 .
  • the rendering platform obtains at least one target light source corresponding to the target cache point.
  • the rendering platform may obtain the light source culling result of the target cache point. For example, the rendering platform obtains at least one target light source corresponding to the target cache point by querying the light source culling result table. For example, the rendering platform may send a read request to the memory, the read request is used to read the light source culling result of the target cache point, and the memory responds to the read request and sends the at least one target light source corresponding to the target cache point to the rendering platform.
  • the rendering platform performs shading calculation on the target cache point based on at least one target light source to obtain a rendering result of a second viewpoint.
  • the rendering platform performs shading calculations on the target cache point based on at least one target light source obtained from the memory to obtain a rendering result of the second viewpoint. This allows the light source culling result of the target cache point under the first viewpoint to be shared, and there is no need to calculate the light source culling result of the target cache point under the second viewpoint, thereby reducing the amount of computational effort for light source culling.
  • an embodiment of the present application also provides a rendering engine.
  • the rendering engine 800 is used for rendering applications, which include multiple three-dimensional models and multiple light sources, and each three-dimensional model includes multiple cache points; the rendering engine 800 includes a processing unit 801 and a storage unit 802.
  • the processing unit 801 can be used to obtain a target cache point from the storage unit 802, and respectively calculate multiple illumination intensity values of multiple light sources at the target cache point, where the multiple cache points include the target cache point, and the visible space corresponding to the first viewpoint includes the target cache point; determine at least one target light source from the multiple light sources based on the multiple illumination intensity values and the illumination intensity threshold; and perform shading calculation on the target cache point based on the at least one target light source to obtain a rendering result corresponding to the first viewpoint.
  • the visible space corresponding to the second viewpoint includes the target cache point
  • the processing unit 801 is further used to: perform shading calculation on the target cache point based on the at least one target light source to obtain a rendering result corresponding to the second viewpoint.
  • the storage unit 802 is further used to: store a correspondence between the target cache point and the at least one target light source.
  • the cache point is one or more of the following: a patch, a texel point, or a point in a point cloud.
  • the cache points are located on the surface of the three-dimensional model, and different three-dimensional models include different numbers of cache points.
  • the rendering engine 800 may further include a configuration interface 803 (indicated by a dotted line in FIG. 8 ), where the configuration interface 803 is used to receive the illumination intensity threshold set by a user.
  • a light intensity value of each target light source of the at least one target light source at the target cache point is greater than or equal to the light intensity threshold.
  • the present application also provides a computing device 900.
  • the computing device 900 includes: a bus 902, a processor 904, and a memory 906.
  • the computing device 900 may also include a communication interface 908 (indicated by a dotted line in FIG9 ).
  • the processor 904, the memory 906, and the communication interface 908 communicate through the bus 902.
  • the computing device 900 may be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 900.
  • the bus 902 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • the bus may be divided into an address bus, a data bus, a control bus, etc.
  • FIG. 9 is represented by only one line, but does not mean that there is only one bus or one type of bus.
  • the bus 902 may include a path for transmitting information between various components of the computing device 900 (e.g., the memory 906, the processor 904, and the communication interface 908).
  • Processor 904 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP) or a digital signal processor (DSP).
  • CPU central processing unit
  • GPU graphics processing unit
  • MP microprocessor
  • DSP digital signal processor
  • the processor 904 may include one or more graphics processors.
  • the processor 904 is configured to execute instructions stored in the memory 906 to implement the method described in the embodiment corresponding to FIG. 5 or FIG. 7 .
  • the processor 904 may include one or more central processing units and one or more graphics processing units.
  • the processor 904 is configured to execute instructions stored in the memory 906 to implement the method described in the embodiment corresponding to FIG. 5 or FIG. 7 .
  • the memory 906 may include a volatile memory, such as a random access memory (RAM).
  • the processor 904 may also include a non-volatile memory, such as a read-only memory (READ-ONLY MEMORY). ROM), flash memory, hard disk drive (HDD) or solid state drive (SSD).
  • the memory 906 stores executable program code, and the processor 904 executes the executable program code to implement the method described in the embodiment corresponding to FIG. 5 or FIG. 7. Specifically, the memory 906 stores instructions for the rendering node to execute the method described in the embodiment corresponding to FIG. 5 or FIG. 7.
  • the communication interface 908 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or communication networks.
  • a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or communication networks.
  • the embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media.
  • the available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).
  • the computer-readable storage medium includes instructions that instruct the computing device to execute the method described in the embodiment corresponding to Figure 5 or Figure 7 above.
  • the present application also provides a computer program product including instructions.
  • the computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium.
  • the at least one computer device executes the method described in the embodiment corresponding to FIG. 5 or FIG. 7 above.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

Landscapes

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

Abstract

Provided in the embodiments of the present application are a light source elimination method and a rendering engine, which are used for reducing the amount of computing for light source elimination. The method can be applied to a rendering application, which comprises a plurality of three-dimensional models and a plurality of light sources, wherein each of the plurality of three-dimensional models comprises a plurality of cache points. The method specifically comprises: respectively computing a plurality of illumination intensity values of a plurality of light sources at a target cache point, wherein a plurality of cache points comprise the target cache point, and a visual space corresponding to a first viewpoint comprises the target cache point; according to the plurality of illumination intensity values and an illumination intensity threshold, determining to specify a target light source from the plurality of light sources, and performing coloring computing on the target cache point on the basis of the at least one target light source, so as to obtain a rendering result corresponding to the first viewpoint.

Description

一种光源剔除方法及渲染引擎A light source culling method and rendering engine
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求在2022年11月23日提交中国国家知识产权局、申请号为202211480728.X、申请名称为“一种光源剔除方法及渲染引擎”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on November 23, 2022, with application number 202211480728.X and application name “A light source culling method and rendering engine”, the entire contents of which are incorporated by reference in this application.
技术领域Technical Field
本申请涉及计算机技术领域,尤其涉及一种光源剔除方法及渲染引擎。The present application relates to the field of computer technology, and in particular to a light source culling method and a rendering engine.
背景技术Background technique
渲染技术是指根据三维模型数据(包括物体几何模型、表面材质等等)和光线数据(包括光源位置、颜色、强度等),输出模拟真实世界中相同模型和光照条件下的真实图片。延迟渲染是实现渲染的一种方式。在延迟渲染中,先进行一次计算,以剔除掉用户屏幕上看不到的三维空间的面片,将能被用户看见的面元、顶点信息等保存到全局的缓冲区中,再根据该缓冲区保存的信息进行着色计算,这样仅会对用户看得见的信息进行着色计算,从而能够减少渲染过程中的着色计算的运算量。Rendering technology refers to the output of realistic images that simulate the same model and lighting conditions in the real world based on 3D model data (including object geometry, surface material, etc.) and light data (including light source position, color, intensity, etc.). Deferred rendering is a way to achieve rendering. In deferred rendering, a calculation is first performed to remove the faces of the 3D space that cannot be seen on the user's screen, and the face elements and vertex information that can be seen by the user are saved in a global buffer. Then, shading calculations are performed based on the information saved in the buffer. In this way, shading calculations are only performed on the information visible to the user, thereby reducing the amount of shading calculations in the rendering process.
光源剔除是实现延迟渲染的一种手段。目前的光源剔除包括基于屏幕空间的光源剔除和基于相机空间的光源剔除。基于屏幕空间的光源剔除是指将用户看到的屏幕空间划分成相同大小的多个二维格子,计算每个光源在每个二维格子处的光照结果,若光源在二维格子处的光照结果小于阈值,在着色计算阶段,不计算该光源对该二维格子的影响。基于相机空间的光源剔除是指将计算得到的相机空间划分成相同大小的多个三维格子,计算每个光源在每个三维格子处的光照结果,若光源在三维格子处的光照结果小于阈值,在着色计算阶段,不计算该光源对该三维格子的影响。屏幕空间和相机空间皆是基于多个视角生成的,这就需要计算每个视角下的光源剔除结果,导致光源剔除的运算量较大。Light source culling is a means to achieve delayed rendering. The current light source culling includes screen space-based light source culling and camera space-based light source culling. Screen space-based light source culling refers to dividing the screen space seen by the user into multiple two-dimensional grids of the same size, calculating the lighting result of each light source at each two-dimensional grid, and if the lighting result of the light source at the two-dimensional grid is less than the threshold, the influence of the light source on the two-dimensional grid is not calculated in the shading calculation stage. Camera space-based light source culling refers to dividing the calculated camera space into multiple three-dimensional grids of the same size, calculating the lighting result of each light source at each three-dimensional grid, and if the lighting result of the light source at the three-dimensional grid is less than the threshold, the influence of the light source on the three-dimensional grid is not calculated in the shading calculation stage. Both screen space and camera space are generated based on multiple perspectives, which requires calculating the light source culling result at each perspective, resulting in a large amount of light source culling calculation.
发明内容Summary of the invention
本申请实施例提供一种光源剔除方法及渲染引擎,用以在多个视角之间共享光源剔除结果,减少光源剔除的运算量。The embodiments of the present application provide a light source culling method and a rendering engine for sharing light source culling results among multiple perspectives, thereby reducing the amount of computation required for light source culling.
第一方面,本申请实施例提供一种光源剔除方法,该方法可用于渲染应用,该渲染应用包括多个三维模型和多个光源,该多个三维模型中的每一三维模型包括多个缓存点,该方法包括:分别计算多个光源在目标缓存点处的多个光照强度值,该多个缓存点包括该目标缓存点,第一视点对应的可视空间中包括该目标缓存点;根据该多个光照强度值和光照强度阈值,从该多个光源中确定指示一个目标光源,以及基于该至少一个目标光源,对目标缓存点进行着色计算,以获得第一视点对应的渲染结果。In a first aspect, an embodiment of the present application provides a light source culling method, which can be used for a rendering application, wherein the rendering application includes multiple three-dimensional models and multiple light sources, each of the multiple three-dimensional models includes multiple cache points, and the method includes: respectively calculating multiple light intensity values of the multiple light sources at a target cache point, the multiple cache points including the target cache point, and the visible space corresponding to the first viewpoint includes the target cache point; according to the multiple light intensity values and the light intensity threshold, determining to indicate a target light source from the multiple light sources, and based on the at least one target light source, performing shading calculation on the target cache point to obtain a rendering result corresponding to the first viewpoint.
在本申请的上述实施例中三维模型的光源剔除计算以缓存点为粒度,使得不同视点下同一个缓存点的光源剔除结果可以共享,从而无需计算不同视点下同一个缓存点的光源剔除结果,能够减少光源剔除的运算量。In the above-mentioned embodiment of the present application, the light source culling calculation of the three-dimensional model is based on the granularity of the cache point, so that the light source culling results of the same cache point under different viewpoints can be shared, thereby eliminating the need to calculate the light source culling results of the same cache point under different viewpoints, thereby reducing the amount of light source culling calculations.
在一种可能的设计中,第二视点对应的可视空间中包括目标缓存点,该方法还可以包括:基于至少一个目标光源,对目标缓存点进行着色计算,以获得第二视点对应的渲染结果。通过该设计,第二视点下目标缓存点的光源剔除结果可以共享第一视点下目标缓存点的光源剔除结果,无需再计算第二视点下该目标缓存点的光源剔除结果,能够减少光源剔除的运算量。In a possible design, the visible space corresponding to the second viewpoint includes the target cache point, and the method may further include: performing shading calculation on the target cache point based on at least one target light source to obtain a rendering result corresponding to the second viewpoint. With this design, the light source culling result of the target cache point under the second viewpoint can share the light source culling result of the target cache point under the first viewpoint, and there is no need to calculate the light source culling result of the target cache point under the second viewpoint, which can reduce the amount of light source culling calculation.
在一种可能的设计中,所述根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源后,该方法还可以包括:存储所述目标缓存点与所述至少一个目标光源的对应关系。这样将目标缓存点与至少一个目标光源的对应关系存储在存储器,后期可通过读取存储器获取该目标缓存点的光源剔除结果,无需再重复计算该目标缓存点的光源剔除结果。In a possible design, after determining at least one target light source from the multiple light sources according to the multiple light intensity values and the light intensity threshold, the method may further include: storing the correspondence between the target cache point and the at least one target light source. In this way, the correspondence between the target cache point and the at least one target light source is stored in the memory, and the light source culling result of the target cache point can be obtained by reading the memory later, without repeatedly calculating the light source culling result of the target cache point.
在一种可能的设计中,所述缓存点为下述的一种或多种:面片、纹素点、点云中的点。这样将缓存点设置为面片、纹素点或点云中的点,意味着渲染过程中是以面片、纹素点或点云中的点为粒度进行光 源剔除,能够提高光源剔除的精度,减少光源剔除过多或过少的问题。In a possible design, the cache point is one or more of the following: a patch, a texel point, or a point in a point cloud. Setting the cache point to a patch, a texel point, or a point in a point cloud means that the rendering process is performed at the granularity of a patch, a texel point, or a point in a point cloud. Source culling can improve the accuracy of light source culling and reduce the problem of too much or too little light source culling.
在一种可能的设计中,所述缓存点位于所述三维模型的表面,不同三维模型包括的缓存点的数量不同。In a possible design, the cache points are located on the surface of the three-dimensional model, and different three-dimensional models include different numbers of cache points.
在一种可能的设计中,该方法还可以包括:提供配置接口,所述配置接口用于接收用户设置的所述光照强度阈值。这样用户可通过配置接口自行输入光照强度阈值,提高适应性。In a possible design, the method may further include: providing a configuration interface, wherein the configuration interface is used to receive the light intensity threshold value set by the user, so that the user can input the light intensity threshold value by himself through the configuration interface, thereby improving adaptability.
在一种可能的设计中,所述至少一个目标光源中的每一目标光源在所述目标缓存点处的光照强度值大于或等于所述光照强度阈值。In one possible design, the illumination intensity value of each target light source of the at least one target light source at the target cache point is greater than or equal to the illumination intensity threshold.
第二方面,本申请实施例提供一种渲染引擎,所述渲染引擎用于渲染应用,所述渲染应用包括多个三维模型和多个光源,每一三维模型包括多个缓存点,所述渲染引擎包括处理单元和存储单元;所述处理单元,用于从所述存储单元中获取目标缓存点,分别计算所述多个光源在所述目标缓存点处的多个光照强度值,所述多个缓存点包括所述目标缓存点,第一视点对应的可视空间中包括所述目标缓存点;根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源;以及基于所述至少一个目标光源,对所述目标缓存点进行着色计算,以获得所述第一视点对应的渲染结果。In a second aspect, an embodiment of the present application provides a rendering engine, which is used for rendering applications, wherein the rendering application includes multiple three-dimensional models and multiple light sources, each three-dimensional model includes multiple cache points, and the rendering engine includes a processing unit and a storage unit; the processing unit is used to obtain a target cache point from the storage unit, and respectively calculate multiple light intensity values of the multiple light sources at the target cache points, the multiple cache points include the target cache point, and the visible space corresponding to the first viewpoint includes the target cache point; according to the multiple light intensity values and the light intensity threshold, determine at least one target light source from the multiple light sources; and based on the at least one target light source, perform shading calculation on the target cache point to obtain a rendering result corresponding to the first viewpoint.
在一种可能的设计中,第二视点对应的可视空间中包括所述目标缓存点,所述处理单元进一步用于:基于所述至少一个目标光源,对所述目标缓存点进行着色计算,以获得所述第二视点对应的渲染结果。In a possible design, the visible space corresponding to the second viewpoint includes the target cache point, and the processing unit is further used to: perform shading calculation on the target cache point based on the at least one target light source to obtain a rendering result corresponding to the second viewpoint.
在一种可能的设计中,在根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源后,所述存储单元进一步用于:存储所述目标缓存点与所述至少一个目标光源的对应关系。In a possible design, after determining at least one target light source from the multiple light sources according to the multiple light intensity values and the light intensity thresholds, the storage unit is further used to: store a corresponding relationship between the target cache point and the at least one target light source.
在一种可能的设计中,所述缓存点为下述的一种或多种:面片、纹素点、点云中的点。In one possible design, the cache point is one or more of the following: a patch, a texel point, or a point in a point cloud.
在一种可能的设计中,所述缓存点位于所述三维模型的表面,不同三维模型包括的缓存点的数量不同。In a possible design, the cache points are located on the surface of the three-dimensional model, and different three-dimensional models include different numbers of cache points.
在一种可能的设计中,所述渲染引擎还可以包括配置接口,所述配置接口用于接收用户设置的所述光照强度阈值。In a possible design, the rendering engine may further include a configuration interface, wherein the configuration interface is used to receive the light intensity threshold set by a user.
在一种可能的设计中,所述至少一个目标光源中的每一目标光源在所述目标缓存点处的光照强度值大于或等于所述光照强度阈值。In one possible design, the illumination intensity value of each target light source of the at least one target light source at the target cache point is greater than or equal to the illumination intensity threshold.
第三方面,本申请实施例提供提一种包含指令的计算机程序产品,当该指令被计算机设备集群运行时,使得该计算机设备集群执行如第一方面或第一方面的任意可能的设计提供的方法。In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed by a computer device cluster, causes the computer device cluster to execute the method provided in the first aspect or any possible design of the first aspect.
第四方面,本申请实施例提供一种计算机可读存储介质,包括计算机程序指令,当所述计算机程序指令由计算设备集群执行时,所述计算设备集群执行如第一方面或第一方面的任意可能的设计提供的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method provided by the first aspect or any possible design of the first aspect.
第五方面,本申请实施例提供一种计算设备集群,包括至少一个计算设备,每个计算设备包括处理器和存储器;至少一个计算设备的处理器用于执行至少一个计算设备的存储器中存储的指令,以使得该计算设备执行如第一方面或第一方面的任意可能的设计提供的方法。In a fifth aspect, an embodiment of the present application provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device performs a method provided by the first aspect or any possible design of the first aspect.
在一些可能的设计中,该计算设备集群包括一个计算设备,该计算设备包括处理器和存储器;该处理器用于执行该存储器中存储的指令以运行第二方面或第二方面的任意可能的设计提供的渲染引擎,以使得该计算设备执行如第一方面或第一方面的任意可能的设计提供的方法。In some possible designs, the computing device cluster includes a computing device, which includes a processor and a memory; the processor is used to execute instructions stored in the memory to run the rendering engine provided by the second aspect or any possible design of the second aspect, so that the computing device performs a method provided by the first aspect or any possible design of the first aspect.
在一些可能的设计中,该计算设备集群包括至少两个计算设备,每个计算设备包括处理器和存储器。该至少两个计算设备的处理器用于执行该至少两个计算设备的存储器中存储的指令以运行第二方面或第二方面的任意可能的设计提供的渲染引擎,以使得该计算设备集群执行如第一方面或第一方面的任意可能的设计提供的方法。In some possible designs, the computing device cluster includes at least two computing devices, each computing device includes a processor and a memory. The processors of the at least two computing devices are used to execute instructions stored in the memories of the at least two computing devices to run the rendering engine provided by the second aspect or any possible design of the second aspect, so that the computing device cluster performs the method provided by the first aspect or any possible design of the first aspect.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例中的UV展开示意图;FIG1 is a schematic diagram of UV unfolding in an embodiment of the present application;
图2为本申请实施例中的基于屏幕空间的光源剔除的示意图;FIG2 is a schematic diagram of light source culling based on screen space in an embodiment of the present application;
图3为本申请实施例中的基于相机空间的光源剔除的示意图;FIG3 is a schematic diagram of light source culling based on camera space in an embodiment of the present application;
图4为本申请实施例中渲染系统的一种示意图;FIG4 is a schematic diagram of a rendering system in an embodiment of the present application;
图5为本申请实施例提供的光源剔除方法的一种流程示意图;FIG5 is a schematic diagram of a flow chart of a light source elimination method provided in an embodiment of the present application;
图6为本申请实施例提供的光源剔除方法的另一种流程示意图; FIG6 is another schematic flow chart of a light source elimination method provided in an embodiment of the present application;
图7为本申请实施例提供的光源剔除结果的一种示意图;FIG7 is a schematic diagram of a light source elimination result provided in an embodiment of the present application;
图8为本申请实施例提供的渲染引擎的一种结构示意图;FIG8 is a schematic diagram of a structure of a rendering engine provided in an embodiment of the present application;
图9为本申请实施例提供的计算设备的一种结构示意图。FIG. 9 is a schematic diagram of a structure of a computing device provided in an embodiment of the present application.
具体实施方式Detailed ways
首先,对本申请实施例涉及的部分用语以及相关技术进行解释说明,以便本领域技术人员容易理解。First, some terms and related technologies involved in the embodiments of the present application are explained so that those skilled in the art can easily understand them.
三维模型是物体的多边形表示,通常用计算机或者其它视频设备进行显示。三维模型的形状可以是多种多样的,例如,可以是球体、锥体、曲面物体、平面物体以及表面不规则物体等等。显示的物体是可以是现实世界的实体,也可以是虚构的物体。三维模型经常用三维建模工具这种专门的软件生成,但是也可以用其它方法生成。作为点和其它分量集合的数据,三维模型可以手工生成,也可以按照一定的算法生成。A 3D model is a polygonal representation of an object, usually displayed by a computer or other video device. The shapes of a 3D model can be various, for example, a sphere, a cone, a curved object, a flat object, an object with an irregular surface, etc. The displayed object can be a real-world entity or a fictional object. 3D models are often generated using specialized software such as 3D modeling tools, but they can also be generated by other methods. As a collection of data of points and other components, a 3D model can be generated manually or according to a certain algorithm.
本申请实施例涉及的面片也可以称为网格,是将三维模型的表面划分成无数个微小的平面。这些平面可以是任意多边形,常用的是三角形和四边形。形状不同的三维模型的面片的形状也可以不同。例如,球体的面片和曲面物体的面片的形状可以完全不同。面片的尺寸可以根据需要进行设置,对渲染出的图像的精度要求越高的情况下,面片的尺寸可以设置得越小。面片在三维模型的位置、形状或者尺寸等可以通过几何参数来描述。The facets involved in the embodiments of the present application may also be referred to as meshes, which divide the surface of a three-dimensional model into countless tiny planes. These planes may be any polygons, and triangles and quadrilaterals are commonly used. The shapes of the facets of three-dimensional models with different shapes may also be different. For example, the shapes of the facets of a sphere and the facets of a curved object may be completely different. The size of the facets may be set as needed, and the higher the accuracy requirements for the rendered image, the smaller the size of the facets may be set. The position, shape or size of the facets in the three-dimensional model may be described by geometric parameters.
本申请实施例涉及的纹素点也可以称为纹素、纹理元素等,是将三维模型的表面映射为多个二维平面时,该多个二维平面中每个二维平面的最小组成单位。例如,三维模型的表面通过UV展开可得到多个二维平面,其中,U指的二维平面的水平轴,V指的是二维平面的垂直轴。例如,参见图1所示,图1中(a)汽车座椅进行UV展开后如图1中(b)所示。这样展开后的二维平面可称为纹理,该纹理由纹素点组成。The texel points involved in the embodiments of the present application may also be referred to as texels, texture elements, etc., which are the smallest component units of each of the multiple two-dimensional planes when the surface of a three-dimensional model is mapped into multiple two-dimensional planes. For example, the surface of a three-dimensional model can be expanded by UV to obtain multiple two-dimensional planes, where U refers to the horizontal axis of the two-dimensional plane and V refers to the vertical axis of the two-dimensional plane. For example, as shown in Figure 1, the car seat in Figure 1 (a) is expanded by UV as shown in Figure 1 (b). The two-dimensional plane after such expansion can be called a texture, which is composed of texel points.
本申请实施例涉及的点云是对三维模型的表面进行映射得到的数据集。点云中的点是该点云中的最小组成单位。The point cloud involved in the embodiment of the present application is a data set obtained by mapping the surface of a three-dimensional model. A point in the point cloud is the smallest component unit in the point cloud.
需要说明的是,本申请实施例涉及的面片、纹素点、以及点云中的点是对三维模型的表面的不同表达,本申请实施例对面片、纹素点以及点云中的点的获取方式和实现方式不作限定。It should be noted that the patches, texel points, and points in the point cloud involved in the embodiments of the present application are different expressions of the surface of the three-dimensional model. The embodiments of the present application do not limit the acquisition method and implementation method of the patches, texel points, and points in the point cloud.
本申请实施例涉及的视点可理解为观察者(例如相机或者人眼等)所在的位置。本申请实施例涉及的视角可理解为观察者观察虚拟场景的角度。需要说明的是,本申请实施例中的“视点”和“视角”可替换使用。The viewpoint involved in the embodiments of the present application can be understood as the position of the observer (such as a camera or human eye, etc.). The viewing angle involved in the embodiments of the present application can be understood as the angle at which the observer observes the virtual scene. It should be noted that the "viewpoint" and "viewing angle" in the embodiments of the present application can be used interchangeably.
本申请实施例涉及的缓存点也可以称为缓存单元或表面缓存点等,位于三维模型的表面,用于存储渲染过程中的运算结果,该运算结果例如可以包括光源剔除结果、着色结果、或光效结果等。在本申请实施例中以缓存点用于存储光源剔除结果为例。应理解的是,不同三维模型的缓存点的数量可以不同。The cache points involved in the embodiments of the present application may also be referred to as cache units or surface cache points, etc., which are located on the surface of the three-dimensional model and are used to store the calculation results in the rendering process, and the calculation results may include, for example, light source culling results, shading results, or light effect results. In the embodiments of the present application, the cache points are used to store light source culling results as an example. It should be understood that the number of cache points of different three-dimensional models may be different.
需要说明的是,本申请实施例涉及的缓存点的生成与视点以及视角无关。示例性的,该缓存点可以是如下中的一种或多种:面片、纹素点、点云中的点。例如,缓存点为面片,则该面片可存储该面片的光源剔除结果,那么通过该面片可获取该面片的光源剔除结果。又例如,该缓存点为纹素点,则该纹素点可存储该纹素点的光源剔除结果,那么通过该纹素点可获取该纹素点的光源剔除结果。再例如,缓存点为点云中的点,则该点可存储该点的光源剔除结果,那么通过该点可获取该点的光源剔除结果。It should be noted that the generation of cache points involved in the embodiments of the present application is independent of viewpoints and viewing angles. Exemplarily, the cache point can be one or more of the following: a patch, a texel point, and a point in a point cloud. For example, if the cache point is a patch, then the patch can store the light source culling result of the patch, and then the light source culling result of the patch can be obtained through the patch. For another example, if the cache point is a texel point, then the texel point can store the light source culling result of the texel point, and then the light source culling result of the texel point can be obtained through the texel point. For another example, if the cache point is a point in a point cloud, then the point can store the light source culling result of the point, and then the light source culling result of the point can be obtained through the point.
需要说明的是,缓存点用于存储光源剔除结果,也可理解为缓存点与光源剔除结果之间存在对应关系(或关联关系),这样通过该缓存点以及该缓存点与光源剔除结果之间的对应关系(或关联关系),可获取该缓存点的光源剔除结果。It should be noted that the cache point is used to store the light source culling results, which can also be understood as a correspondence (or association) between the cache point and the light source culling results. In this way, the light source culling result of the cache point can be obtained through the cache point and the correspondence (or association) between the cache point and the light source culling results.
本申请实施例涉及一个或多个光源。光源产生的光线照射到三维模型上。光源可以是点光源、线光源或者面光源等等。光源产生的光线在接触到三维模型的表面后在表面的每个接触点会发生如下情形中的一种:折射、反射或漫反射。然后进入到用户的眼睛。The embodiments of the present application involve one or more light sources. The light generated by the light source is irradiated onto a three-dimensional model. The light source may be a point light source, a line light source, or a surface light source, etc. After the light generated by the light source contacts the surface of the three-dimensional model, one of the following situations may occur at each contact point on the surface: refraction, reflection, or diffuse reflection. Then, the light enters the user's eyes.
着色计算,是指在渲染过程中,对于视线(veiw ray)方向和光线(light ray)方向,计算光线从光源沿着light ray方向照射到着色点,再沿着veiw ray方向出射到相机的光线颜色结果。Shading calculation refers to the calculation of the color of light from the light source along the light ray direction to the shading point, and then along the veiw ray direction to the camera during the rendering process, for the line of sight (veiw ray) direction and the light (light ray) direction.
本申请中所涉及的至少一个指一个或多个,多个是指两个或两个以上。另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。例如,下文涉及的第一视点和第二视点用于区别不同的视点,并不是指 示该两个视点的顺序和优先级等。In this application, at least one refers to one or more, and a plurality refers to two or more. In addition, it should be understood that in the description of this application, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order. For example, the first viewpoint and the second viewpoint mentioned below are used to distinguish different viewpoints, and do not mean Indicates the order and priority of the two viewpoints.
在渲染技术中,基于屏幕空间的光源剔除和基于相机空间的光源剔除是实现延迟渲染的两种常用手段,能够减少着色计算的运算量。图2示出了基于屏幕空间的光源剔除的一种示意图。如图2所示,屏幕空间被划分为多个二维格子,以二维格子为粒度进行光源剔除。一方面,屏幕空间缺少深度信息,同一二维格子中不同像素点可能由不同的光源照亮,如图2中椅子与背后的小房间可能由不同的光源照亮且光照结果不同,这样导致光源剔除结果存在误差,不利于后续的着色计算;另一方面,屏幕空间是基于多个视角或多个视点生成的空间,对于每个二维格子需要计算不同视角或不同视点下的光源剔除结果,光源剔除运算量较大。图3示出了基于相机空间的光源剔除的一种示意图。如图3所示,相机空间被划分为多个三维格子,以三维格子为粒度进行光源剔除。由于相机空间也是基于多个视角或多个视点生成的空间,对于每个三维格子也需要不同视角或不同视点下的光源剔除结果,光源剔除运算量较大。In rendering technology, light source culling based on screen space and light source culling based on camera space are two common means to achieve delayed rendering, which can reduce the amount of calculation for shading calculation. FIG2 shows a schematic diagram of light source culling based on screen space. As shown in FIG2, the screen space is divided into multiple two-dimensional grids, and light source culling is performed with the two-dimensional grid as the granularity. On the one hand, the screen space lacks depth information, and different pixels in the same two-dimensional grid may be illuminated by different light sources. For example, the chair and the small room behind it in FIG2 may be illuminated by different light sources and the lighting results are different, which leads to errors in the light source culling results, which is not conducive to subsequent shading calculations; on the other hand, the screen space is a space generated based on multiple perspectives or multiple viewpoints. For each two-dimensional grid, the light source culling results under different perspectives or different viewpoints need to be calculated, and the amount of calculation for light source culling is large. FIG3 shows a schematic diagram of light source culling based on camera space. As shown in FIG3, the camera space is divided into multiple three-dimensional grids, and light source culling is performed with the three-dimensional grid as the granularity. Since the camera space is also a space generated based on multiple perspectives or multiple viewpoints, each three-dimensional grid also requires light source culling results under different perspectives or different viewpoints, and the amount of light source culling calculation is relatively large.
鉴于此,本申请实施例提供一种光源剔除方法,该方法中以缓存点为粒度进行光源剔除,使得不同视角或不同视点下同一缓存点处的光源剔除结果能够共享,从而无需计算每个视角或每个视点下同一缓存点处的光源剔除结果,减少光源剔除的运算量。In view of this, an embodiment of the present application provides a light source culling method, in which light source culling is performed at a cache point as the granularity, so that the light source culling results at the same cache point under different viewing angles or different viewpoints can be shared, thereby eliminating the need to calculate the light source culling results at the same cache point under each viewing angle or each viewpoint, thereby reducing the amount of computational complexity of light source culling.
接下来,结合应用场景对本申请实施例提供的方案进行详细说明。Next, the solution provided in the embodiment of the present application is described in detail in combination with the application scenario.
首先对本申请适用的渲染系统进行描述。参见图4,图4是本申请涉及的一种渲染系统的结构示意图。本申请的渲染系统用于通过渲染方法对虚拟场景的三维(或二维)模型进行渲染得到的二维图像,即渲染图像。本申请的渲染系统可以包括:一个或多个终端设备100、网络设备200以及渲染平台300。渲染平台300可以部署在云服务器上,但本申请实施例并不限定于此。渲染平台300和终端设备100一般部署在不同的数据中心内。First, the rendering system applicable to the present application is described. Referring to Figure 4, Figure 4 is a schematic diagram of the structure of a rendering system involved in the present application. The rendering system of the present application is used to render a three-dimensional (or two-dimensional) model of a virtual scene by a rendering method to obtain a two-dimensional image, that is, a rendered image. The rendering system of the present application may include: one or more terminal devices 100, a network device 200, and a rendering platform 300. The rendering platform 300 can be deployed on a cloud server, but the embodiments of the present application are not limited thereto. The rendering platform 300 and the terminal device 100 are generally deployed in different data centers.
终端设备100可以是需要实时显示渲染图像的设备,例如,可以是用于飞行训练的虚拟现实设备(virtual reality,VR)、可以是用于虚拟游戏的电脑以及用于虚拟商城的智能手机等等,此处不作具体限定。终端设备可以是高配置、高性能(例如,多核、高主频、内存大等等)的设备,也可以是低配置,低性能(例如,单核、低主频、内存小等等)的设备。在一具体的实施例中,终端设备100可以包括硬件、操作系统以及渲染应用客户端。The terminal device 100 may be a device that needs to display rendered images in real time, for example, a virtual reality device (VR) for flight training, a computer for virtual games, a smart phone for a virtual mall, etc., which are not specifically limited here. The terminal device may be a high-configuration, high-performance device (for example, multi-core, high main frequency, large memory, etc.), or a low-configuration, low-performance device (for example, single-core, low main frequency, small memory, etc.). In a specific embodiment, the terminal device 100 may include hardware, an operating system, and a rendering application client.
网络设备200用于在终端设备100通过任何通信机制/通信标准的通信网络与渲染平台300之间传输数据。其中,通信网络可以是广域网、局域网、点对点连接等方式,或它们的任意组合。The network device 200 is used to transmit data between the terminal device 100 and the rendering platform 300 through a communication network of any communication mechanism/communication standard. The communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.
渲染平台300包括一个或多个渲染节点(图4中以包括三个渲染节点为例)。渲染平台300可以通过一个或者多个计算设备来实现。多个计算设备可以构成计算设备集群。渲染节点的功能可以由一个或者多个计算设备配合实现。渲染节点自下而上可以包括渲染硬件、虚拟化服务、渲染引擎以及渲染应用服务端等。其中,渲染硬件包括计算资源、存储资源以及网络资源。计算资源可以采用异构计算架构,例如,可以采用中央处理器(central processing unit,CPU)+图形处理器(graphics processing unit,GPU)架构,CPU+AI芯片,CPU+GPU+AI芯片架构等等,此处不作具体限定。存储资源可以包括内存、显存等存储设备。网络资源可以包括网卡、端口资源、地址资源等。虚拟化服务是通过虚拟化技术将渲染节点的资源虚拟化为vCPU等,并按照用户的需要灵活地隔离出相互独立的资源以运行用户的应用程序的服务。常见地,虚拟化服务可以包括虚拟机(virtual machine,VM)服务以及容器(container)服务,VM和容器可以运行渲染引擎和渲染应用服务端。渲染引擎用于实现渲染算法。渲染应用服务端用于调用渲染引擎以完成渲染图像的渲染。The rendering platform 300 includes one or more rendering nodes (three rendering nodes are taken as an example in FIG. 4 ). The rendering platform 300 can be implemented by one or more computing devices. Multiple computing devices can constitute a computing device cluster. The functions of the rendering node can be implemented by one or more computing devices. The rendering node can include rendering hardware, virtualization services, rendering engines, and rendering application servers from bottom to top. Among them, the rendering hardware includes computing resources, storage resources, and network resources. The computing resources can adopt a heterogeneous computing architecture, for example, a central processing unit (CPU) + graphics processing unit (GPU) architecture, CPU + AI chip, CPU + GPU + AI chip architecture, etc., which are not specifically limited here. Storage resources may include storage devices such as memory and video memory. Network resources may include network cards, port resources, address resources, etc. Virtualization services virtualize the resources of rendering nodes into vCPUs, etc. through virtualization technology, and flexibly isolate independent resources according to user needs to run user applications. Generally, virtualization services may include virtual machine (VM) services and container services. VM and container may run rendering engines and rendering application servers. The rendering engine is used to implement rendering algorithms. The rendering application server is used to call the rendering engine to complete the rendering of the rendered image.
终端设备100上的渲染应用客户端和渲染平台300的渲染应用服务端可以合称为渲染应用。常见的渲染应用可以包括:游戏应用、VR应用、电影特效以及动画等等。用户通过渲染应用客户端输入操作指令,渲染应用客户端将操作指令发送给渲染应用服务端,渲染应用服务端调用渲染引擎生成渲染结果,将渲染结果发送至渲染应用客户端,然后再由渲染应用客户端将渲染结果转换成图像呈现给用户。在一可能的实现方式中,用户可通过渲染应用客户端输入光照强度阈值,渲染应用客户端将用户设置的光照强度阈值发送给渲染应用服务端,渲染应用服务端调度渲染引擎并配置该光照强度阈值,渲染引擎根据该光照强度阈值进行光源剔除,并根据光源剔除解雇生成渲染结果,将渲染结果发送至渲染应用客户端,然后再由渲染应用客户端将渲染结果转换成图像呈现给用户。The rendering application client on the terminal device 100 and the rendering application server of the rendering platform 300 can be collectively referred to as a rendering application. Common rendering applications may include: game applications, VR applications, movie special effects, and animations, etc. The user inputs an operation instruction through the rendering application client, and the rendering application client sends the operation instruction to the rendering application server. The rendering application server calls the rendering engine to generate a rendering result, sends the rendering result to the rendering application client, and then the rendering application client converts the rendering result into an image and presents it to the user. In a possible implementation, the user can input a light intensity threshold through the rendering application client, and the rendering application client sends the light intensity threshold set by the user to the rendering application server. The rendering application server schedules the rendering engine and configures the light intensity threshold. The rendering engine performs light source culling according to the light intensity threshold, and generates a rendering result according to the light source culling, and sends the rendering result to the rendering application client, and then the rendering application client converts the rendering result into an image and presents it to the user.
在一具体的实施方式中,渲染应用服务端和渲染应用客户端可以是渲染应用提供商提供的,渲染引擎可以是云服务提供商提供的。举例来说,渲染应用可以是游戏应用,游戏应用的游戏开发商将游戏应用服务端安装在云服务提供商提供的渲染平台上,游戏应用的游戏开发商将游戏应用客户端通过互联网 提供给用户下载,并安装在用户的终端设备上。此外,云服务提供商还提供了渲染引擎,渲染引擎可以为游戏应用提供计算能力。在另一种具体的实施方式中,渲染应用客户端、渲染应用服务端和渲染引擎可以均是云服务提供商提供的。In a specific implementation, the rendering application server and the rendering application client may be provided by a rendering application provider, and the rendering engine may be provided by a cloud service provider. For example, the rendering application may be a game application. The game developer of the game application installs the game application server on the rendering platform provided by the cloud service provider, and the game developer of the game application installs the game application client via the Internet. Provide it to users for download and install on their terminal devices. In addition, the cloud service provider also provides a rendering engine, which can provide computing power for the game application. In another specific implementation, the rendering application client, the rendering application server, and the rendering engine can all be provided by the cloud service provider.
一些实施例中,渲染系统中,还可以包括管理设备(图4中未示出)。管理设备可以是用户的终端设备和云服务提供商的渲染平台300之外的第三方提供的设备。例如,管理设备可以是游戏开发商提供的设备。游戏开发商可以通过管理设备对渲染应用进行管理。可以理解,管理设备可以设置于渲染平台300之上,也可以设置于渲染平台300之外,此处不作具体限定。In some embodiments, the rendering system may further include a management device (not shown in FIG. 4 ). The management device may be a device provided by a third party other than the user's terminal device and the rendering platform 300 of the cloud service provider. For example, the management device may be a device provided by a game developer. The game developer may manage the rendering application through the management device. It is understood that the management device may be disposed on the rendering platform 300 or outside the rendering platform 300, which is not specifically limited here.
接下来对本申请涉及的光源剔除方法进行详细的介绍。本申请实施例提供的光源剔除方法可以由渲染平台300执行,或者由渲染平台300中的渲染节点执行,或者由渲染节点中的渲染引擎实现。为了便于描述,后续不再对渲染系统中各个组件的图示进行描述。Next, the light source culling method involved in the present application is described in detail. The light source culling method provided in the embodiment of the present application can be executed by the rendering platform 300, or by a rendering node in the rendering platform 300, or by a rendering engine in a rendering node. For ease of description, the illustrations of the various components in the rendering system will not be described in detail later.
参见图5为本申请实施例提供的光源剔除方法的流程示意图。See FIG5 for a flow chart of a light source elimination method provided in an embodiment of the present application.
S501,渲染平台获取渲染应用的相关信息。该渲染应用包括一个或多个三维模型,以及一个或多个光源。为了便于理解,本申请实施例以多个模型和多个光源为例。该多个三维模型中的每个三维模型包括一个或多个缓存点(后文以多个缓存点为例)。渲染应用的相关信息可包括多个光源的光源参数和每个三维模型的信息。每个三维模型的信息例如可以包括该三维模型映射的缓存点的情况。S501, the rendering platform obtains relevant information of the rendering application. The rendering application includes one or more three-dimensional models, and one or more light sources. For ease of understanding, the embodiment of the present application takes multiple models and multiple light sources as an example. Each of the multiple three-dimensional models includes one or more cache points (hereinafter, multiple cache points are taken as an example). The relevant information of the rendering application may include light source parameters of multiple light sources and information of each three-dimensional model. The information of each three-dimensional model may, for example, include the situation of the cache points mapped by the three-dimensional model.
本申请实施例涉及的缓存点可以是面片、纹素点以及点云中的点中的一种或多种。在缓存点为面片时,每个三维模型的信息可包括三维模型的表面的面片划分情况,面片编号,面片的几何参数等。在缓存点为纹素点时,每个三维模型的信息可包括该三维模型的表面的纹理映射情况,纹理贴图尺寸,纹理坐标等。在缓存点为点云中的云时,每个三维模型的信息可包括三维模型的表面的点云映射情况,点云结构,点云坐标等。The cache points involved in the embodiments of the present application may be one or more of a patch, a texel point, and a point in a point cloud. When the cache point is a patch, the information of each three-dimensional model may include the patch division of the surface of the three-dimensional model, the patch number, the geometric parameters of the patch, etc. When the cache point is a texel point, the information of each three-dimensional model may include the texture mapping of the surface of the three-dimensional model, the texture map size, the texture coordinates, etc. When the cache point is a cloud in a point cloud, the information of each three-dimensional model may include the point cloud mapping of the surface of the three-dimensional model, the point cloud structure, the point cloud coordinates, etc.
在一种可能的实现方式中,渲染应用的相关信息可以是由终端设备发送给渲染平台的信息,或者也可以是由管理设备发送给渲染平台的信息,图5中以终端设备向渲染平台发送渲染应用的相关信息为例。In a possible implementation, the relevant information of the rendering application may be information sent by the terminal device to the rendering platform, or may be information sent by the management device to the rendering platform. FIG5 takes the example of the terminal device sending the relevant information of the rendering application to the rendering platform.
S502,渲染平台分别计算多个光源在目标缓存点处的多个光强度值。多个缓存点包括目标缓存点。S502, the rendering platform respectively calculates multiple light intensity values of multiple light sources at target cache points. The multiple cache points include the target cache point.
例如,渲染平台可以对多个三维模型中的每一三维模型进行表面缓存初始化,得到每一三维模型的多个缓存点;对于每一三维模型,渲染平台分别计算多个光源在待渲染的目标缓存点处的多个光照强度值。其中,目标缓存点的数量可理解为一个,也可以理解为多个。For example, the rendering platform can initialize the surface cache of each of the multiple 3D models to obtain multiple cache points of each 3D model; for each 3D model, the rendering platform calculates multiple illumination intensity values of multiple light sources at the target cache points to be rendered. The number of target cache points can be understood as one or more.
在一种可能的实现方式中,渲染平台可以目标缓存点被一个或多个光源照亮,并分别计算该一个或多个光源在该目标缓存点处的光照强度值,以减少光照强度的计算量。本申请实施例以目标缓存点被多个光源照亮为例。例如,渲染平台可以建立该目标缓存点的位图(bitmap),该位图与目标缓存点所处环境的多个光源之间存在对应关系;渲染平台根据该位图确定照亮该目标缓存点的多个光源,并分别计算该多个光源在该目标缓存点处的多个光照强度值。In one possible implementation, the rendering platform can illuminate the target cache point with one or more light sources, and respectively calculate the illumination intensity values of the one or more light sources at the target cache point to reduce the amount of illumination intensity calculation. The embodiment of the present application takes the target cache point illuminated by multiple light sources as an example. For example, the rendering platform can establish a bitmap of the target cache point, and there is a corresponding relationship between the bitmap and the multiple light sources in the environment where the target cache point is located; the rendering platform determines the multiple light sources that illuminate the target cache point based on the bitmap, and respectively calculates the multiple illumination intensity values of the multiple light sources at the target cache point.
S503,渲染平台根据多个光照强度值和光照强度阈值,从多个光源中确定至少一个目标光源。S503: The rendering platform determines at least one target light source from multiple light sources according to multiple light intensity values and light intensity thresholds.
该光照强度阈值可以是渲染系统预定义的,如渲染系统根据历史渲染结果确定的光照强度阈值。或者,该光照强度阈值也可以是用户设置的,如渲染系统可包括配置接口,该配置接口可用于接收用户设置的光照强度阈值。可选的,终端设备可以将用户设置的光照强度阈值携带在渲染应用的相关信息中发送给渲染平台。The light intensity threshold may be predefined by the rendering system, such as a light intensity threshold determined by the rendering system based on historical rendering results. Alternatively, the light intensity threshold may be set by a user, such as a rendering system may include a configuration interface, which may be used to receive the light intensity threshold set by a user. Optionally, the terminal device may carry the light intensity threshold set by the user in the relevant information of the rendering application and send it to the rendering platform.
渲染平台将多个光照强度值分别与光照强度阈值进行比较,从多个光源中确定至少一个目标光源。该至少一个目标光源中的每一目标光源在目标缓存点处的光照强度值大于或等于光照强度阈值。例如,渲染平台可以遍历每个光源,计算每个光源在目标缓存点处的光照强度值,将计算出来的光照强度值与光照强度阈值进行比较,若光照强度值大于或等于光照强度阈值,则将该光照强度值对应的光源在位图上的取值设置为第一值(如1),若光照强度值小于光照强度阈值,则将该光照强度阈值对应的光源在位图上的取值设置为第二值(如0),遍历完渲染应用的多个光源(或遍历完照亮目标缓存点的多个光源)后,位图上取值为第一值所对应的光源为目标光源。The rendering platform compares multiple illumination intensity values with the illumination intensity threshold respectively, and determines at least one target light source from the multiple light sources. The illumination intensity value of each target light source in the at least one target light source at the target cache point is greater than or equal to the illumination intensity threshold. For example, the rendering platform can traverse each light source, calculate the illumination intensity value of each light source at the target cache point, and compare the calculated illumination intensity value with the illumination intensity threshold. If the illumination intensity value is greater than or equal to the illumination intensity threshold, the value of the light source corresponding to the illumination intensity value on the bitmap is set to the first value (such as 1). If the illumination intensity value is less than the illumination intensity threshold, the value of the light source corresponding to the illumination intensity threshold on the bitmap is set to the second value (such as 0). After traversing multiple light sources of the rendering application (or traversing multiple light sources that illuminate the target cache point), the light source corresponding to the first value on the bitmap is the target light source.
在本申请实施例中,光源剔除结果是以缓存点为粒度的,该缓存点的生成与视点或视角无关,例如该缓存点可以是面片、纹素点或点云中的点中的一种或多种,由于缓存点的生成与视点或视角无关,这就意味着不同视点或不同视角下在目标缓存点处的光照强度值大于或等于光照强度阈值的目标光源相同,多个视点或多个视角可共享光源剔除结果。In an embodiment of the present application, the light source culling result is based on the granularity of a cache point, and the generation of the cache point is independent of the viewpoint or viewing angle. For example, the cache point can be one or more of a patch, a texel point, or a point in a point cloud. Since the generation of the cache point is independent of the viewpoint or viewing angle, this means that the target light source whose light intensity value at the target cache point is greater than or equal to the light intensity threshold at different viewpoints or different viewing angles is the same, and multiple viewpoints or multiple viewing angles can share the light source culling result.
S504,渲染平台基于至少一个目标光源,对目标缓存点进行着色计算,以获得第一视点对应的渲 染结果。其中,第一视点对应的可视空间中包括该目标缓存点。S504: The rendering platform performs shading calculation on the target cache point based on at least one target light source to obtain a rendering corresponding to the first viewpoint. The target cache point is included in the visible space corresponding to the first viewpoint.
在着色计算阶段,渲染平台可以基于至少一个目标光源对目标缓存点进行着色计算,不考虑多个光源中除了至少一个目标光源之外的光源对目标缓存点的影响。例如,渲染平台可以根据目标缓存点的位图上取值为第一值所对应的光源对该目标缓存点进行着色。以多个光源包括光源1、光源2、光源3和光源4为例,光源1和光源2的光照强度值大于或等于光照强度阈值,光源3和光源4的光照强度值小于光照强度阈值,如图6所示;渲染平台可根据光源1和光源2对目标缓存点进行着色计算。In the shading calculation stage, the rendering platform can perform shading calculations on the target cache point based on at least one target light source, without considering the influence of light sources other than at least one target light source on the target cache point among the multiple light sources. For example, the rendering platform can shade the target cache point according to the light source corresponding to the first value on the bitmap of the target cache point. Taking multiple light sources including light source 1, light source 2, light source 3 and light source 4 as an example, the light intensity values of light source 1 and light source 2 are greater than or equal to the light intensity threshold, and the light intensity values of light source 3 and light source 4 are less than the light intensity threshold, as shown in Figure 6; the rendering platform can perform shading calculations on the target cache point based on light source 1 and light source 2.
在本申请实施例中不同视点或不同视角下的同一个缓存点的渲染结果可以相同,也可以不同,但不同视点或不同视角下的同一个缓存点的光源剔除结果相同。在图5中以第一视点为例,该第一视点对应的可视空间中包括目标缓存点,渲染平台基于至少一个目标光源,对目标缓存点进行着色计算,得到第一视点对应的渲染结果。In the embodiment of the present application, the rendering results of the same cache point at different viewpoints or different viewing angles may be the same or different, but the light source culling results of the same cache point at different viewpoints or different viewing angles are the same. In FIG5 , taking the first viewpoint as an example, the visual space corresponding to the first viewpoint includes the target cache point, and the rendering platform performs shading calculations on the target cache point based on at least one target light source to obtain the rendering result corresponding to the first viewpoint.
S505,渲染平台存储目标缓存点与至少一个目标光源的对应关系。S505: The rendering platform stores a correspondence between a target cache point and at least one target light source.
例如,渲染平台将目标缓存点与至少一个目标光源的对应关系存储在存储器中。存储器可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。存储器也可以是非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD)等。For example, the rendering platform stores the correspondence between the target cache point and at least one target light source in a memory. The memory may include a volatile memory, such as a random access memory (RAM). The memory may also be a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
一些实施例中,存储器也可以部署于渲染平台外部,也可以部署于渲染平台内部。比如,存储器可以部署于渲染引擎内部。In some embodiments, the memory may be deployed outside the rendering platform or inside the rendering platform. For example, the memory may be deployed inside the rendering engine.
示例性的,渲染平台可以针对每个三维模型对应的多个缓存点建立光源剔除结果表。该光源剔除结果表可包括各个缓存点的编号,以及在各个缓存点处的光照强度阈值大于或等于光照强度阈值的一个或多个光源的编号。例如,光源剔除结果表可以参见表1所示。需要说明的是,渲染平台可以通过编号或索引等来唯一标识三维模型对应的缓存点,也可以通过坐标、参数等来唯一标识三维模型对应的缓存点,本申请实施例不作限定。Exemplarily, the rendering platform can establish a light source rejection result table for multiple cache points corresponding to each three-dimensional model. The light source rejection result table may include the number of each cache point, and the number of one or more light sources whose illumination intensity threshold at each cache point is greater than or equal to the illumination intensity threshold. For example, the light source rejection result table can be shown in Table 1. It should be noted that the rendering platform can uniquely identify the cache point corresponding to the three-dimensional model by number or index, or can uniquely identify the cache point corresponding to the three-dimensional model by coordinates, parameters, etc., which is not limited in the embodiments of the present application.
表1
Table 1
需要说明的是,S504和S505的执行顺序仅为一种示例,本申请实施例并不限定于此。例如,渲染平台还可以先存储目标缓存点与至少一个目标光源的对应关系,再基于该至少一个目标光源,对目标缓存点进行着色计算以获得第一视点对应的渲染结果;或者,渲染平台还可以在基于该至少一个目标光源对目标缓存点进行着色计算的同时,存储该目标缓存点与该至少一个目标光源与目标缓存点之间的对应关系。It should be noted that the execution order of S504 and S505 is only an example, and the embodiments of the present application are not limited thereto. For example, the rendering platform may first store the correspondence between the target cache point and at least one target light source, and then perform shading calculation on the target cache point based on the at least one target light source to obtain the rendering result corresponding to the first viewpoint; or, the rendering platform may also perform shading calculation on the target cache point based on the at least one target light source, and store the correspondence between the target cache point and the at least one target light source and the target cache point.
在上述实施例中,渲染平台以缓存点粒度进行光源剔除,使得不同视角或不同视点下同一缓存点处的光源剔除结果能够共享,从而无需计算每个视角或每个视点下同一缓存点处的光源剔除结果,减少光源剔除的运算量。In the above embodiment, the rendering platform performs light source culling at the cache point granularity, so that the light source culling results at the same cache point under different viewing angles or different viewpoints can be shared, thereby eliminating the need to calculate the light source culling results at the same cache point under each viewing angle or each viewpoint, thereby reducing the amount of computation for light source culling.
参见图7所示,示出了本申请实施例提供的光源剔除方法的又一种流程示意图。如图7所示,该方法可以包括如下内容。Referring to Fig. 7, another schematic flow chart of a method for eliminating light sources provided in an embodiment of the present application is shown. As shown in Fig. 7, the method may include the following contents.
S701,渲染平台接收渲染请求。该渲染请求可以来自终端设备,也可以来自管理设备,图7以渲染请求来自终端设备为例。该渲染请求可包括第二视点的相关信息,用于请求第二视点的渲染结果。第二视点的相关信息例如可以是第二视点的视点方向等,进而渲染平台可根据第二视点的相关信息确定用户的第二视点。该渲染请求还可以包括渲染应用的标识。该渲染应用的标识在渲染系统中唯一标识该渲染应用。一些场景中,渲染系统中仅包括一种渲染应用时,渲染请求中可以不携带渲染应用的标识。S701, the rendering platform receives a rendering request. The rendering request may come from a terminal device or a management device. FIG7 takes the rendering request coming from a terminal device as an example. The rendering request may include relevant information of the second viewpoint, which is used to request the rendering result of the second viewpoint. The relevant information of the second viewpoint may be, for example, the viewpoint direction of the second viewpoint, etc., and then the rendering platform may determine the second viewpoint of the user based on the relevant information of the second viewpoint. The rendering request may also include an identifier of the rendering application. The identifier of the rendering application uniquely identifies the rendering application in the rendering system. In some scenarios, when the rendering system includes only one rendering application, the identifier of the rendering application may not be carried in the rendering request.
S701为可选的步骤,图7中以虚线表示。即,渲染平台可响应于渲染请求,获取第二视点的渲染结果,在此情况下,第一视点与第二视点可以相同也可以不同;或者,渲染平台也可以在获取第一视点的渲染结果后,获取第二视点的渲染结果,以获取不同视点下的渲染结果,在此情况下,第一视点与第二视点不同。S701 is an optional step, which is indicated by a dotted line in Figure 7. That is, the rendering platform may obtain the rendering result of the second viewpoint in response to the rendering request, in which case the first viewpoint and the second viewpoint may be the same or different; or the rendering platform may obtain the rendering result of the second viewpoint after obtaining the rendering result of the first viewpoint, so as to obtain the rendering result under different viewpoints, in which case the first viewpoint and the second viewpoint are different.
其中,第二视点对应的可视空间包括图5所示流程中的目标缓存点。 The visible space corresponding to the second viewpoint includes the target cache point in the process shown in FIG. 5 .
S702,渲染平台获取目标缓存点对应的至少一个目标光源。S702: The rendering platform obtains at least one target light source corresponding to the target cache point.
渲染平台可以获取目标缓存点的光源剔除结果。例如,渲染平台通过查询光源剔除结果表获取目标缓存点对应的至少一个目标光源。例如,渲染平台可以向存储器发送读取请求,该读取请求用于读取目标缓存点的光源剔除结果,存储器响应于读取请求,将该目标缓存点对应的至少一个目标光源发送给渲染平台。The rendering platform may obtain the light source culling result of the target cache point. For example, the rendering platform obtains at least one target light source corresponding to the target cache point by querying the light source culling result table. For example, the rendering platform may send a read request to the memory, the read request is used to read the light source culling result of the target cache point, and the memory responds to the read request and sends the at least one target light source corresponding to the target cache point to the rendering platform.
S703,渲染平台基于至少一个目标光源,对目标缓存点进行着色计算,以获取第二视点的渲染结果。S703: The rendering platform performs shading calculation on the target cache point based on at least one target light source to obtain a rendering result of a second viewpoint.
在图7所示的实施例中,渲染平台根据从存储器获取的至少一个目标光源,对目标缓存点进行着色计算,得到第二视点的渲染结果,这样能够共享第一视点下该目标缓存点的光源剔除结果,无需计算第二视点下该目标缓存点的光源剔除结果,能够减少光源剔除的运算量。In the embodiment shown in FIG7 , the rendering platform performs shading calculations on the target cache point based on at least one target light source obtained from the memory to obtain a rendering result of the second viewpoint. This allows the light source culling result of the target cache point under the first viewpoint to be shared, and there is no need to calculate the light source culling result of the target cache point under the second viewpoint, thereby reducing the amount of computational effort for light source culling.
基于与上述方法相同的技术构思,本申请实施例还提供一种渲染引擎,参见图8所示,渲染引擎800用于渲染应用,该渲染应用包括多个三维模型和多个光源,每一三维模型包括多个缓存点;该渲染引擎800包括处理单元801和存储单元802。Based on the same technical concept as the above method, an embodiment of the present application also provides a rendering engine. As shown in Figure 8, the rendering engine 800 is used for rendering applications, which include multiple three-dimensional models and multiple light sources, and each three-dimensional model includes multiple cache points; the rendering engine 800 includes a processing unit 801 and a storage unit 802.
其中,处理单元801,可用于从存储单元802中获取目标缓存点,分别计算多个光源在目标缓存点处的多个光照强度值,多个缓存点包括所述目标缓存点,第一视点对应的可视空间中包括所述目标缓存点;根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源;以及基于所述至少一个目标光源,对所述目标缓存点进行着色计算,以获得所述第一视点对应的渲染结果。Among them, the processing unit 801 can be used to obtain a target cache point from the storage unit 802, and respectively calculate multiple illumination intensity values of multiple light sources at the target cache point, where the multiple cache points include the target cache point, and the visible space corresponding to the first viewpoint includes the target cache point; determine at least one target light source from the multiple light sources based on the multiple illumination intensity values and the illumination intensity threshold; and perform shading calculation on the target cache point based on the at least one target light source to obtain a rendering result corresponding to the first viewpoint.
在一种可能的实施方式中,第二视点对应的可视空间中包括所述目标缓存点,所述处理单元801进一步用于:基于所述至少一个目标光源,对所述目标缓存点进行着色计算,以获得所述第二视点对应的渲染结果。In a possible implementation, the visible space corresponding to the second viewpoint includes the target cache point, and the processing unit 801 is further used to: perform shading calculation on the target cache point based on the at least one target light source to obtain a rendering result corresponding to the second viewpoint.
在一种可能的实施方式中,在根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源后,所述存储单元802进一步用于:存储所述目标缓存点与所述至少一个目标光源的对应关系。In a possible implementation, after determining at least one target light source from the multiple light sources according to the multiple light intensity values and the light intensity thresholds, the storage unit 802 is further used to: store a correspondence between the target cache point and the at least one target light source.
在一种可能的实施方式中,所述缓存点为下述的一种或多种:面片、纹素点、点云中的点。In a possible implementation, the cache point is one or more of the following: a patch, a texel point, or a point in a point cloud.
在一种可能的实施方式中,所述缓存点位于所述三维模型的表面,不同三维模型包括的缓存点的数量不同。In a possible implementation, the cache points are located on the surface of the three-dimensional model, and different three-dimensional models include different numbers of cache points.
在一种可能的实施方式中,渲染引擎800还可以包括配置接口803(图8中用虚线表示),该配置接口803用于接收用户设置的所述光照强度阈值。In a possible implementation, the rendering engine 800 may further include a configuration interface 803 (indicated by a dotted line in FIG. 8 ), where the configuration interface 803 is used to receive the illumination intensity threshold set by a user.
在一种可能的实施方式中,所述至少一个目标光源中的每一目标光源在所述目标缓存点处的光照强度值大于或等于所述光照强度阈值。In a possible implementation manner, a light intensity value of each target light source of the at least one target light source at the target cache point is greater than or equal to the light intensity threshold.
本申请还提供一种计算设备900。如图9所示,计算设备900包括:总线902、处理器904和存储器906。可选的,计算设备900还可以包括通信接口908(图9中以虚线表示)。处理器904、存储器906和通信接口908之间通过总线902通信。计算设备900可以是服务器或终端设备。应理解,本申请不限定计算设备900中的处理器、存储器的个数。The present application also provides a computing device 900. As shown in FIG9 , the computing device 900 includes: a bus 902, a processor 904, and a memory 906. Optionally, the computing device 900 may also include a communication interface 908 (indicated by a dotted line in FIG9 ). The processor 904, the memory 906, and the communication interface 908 communicate through the bus 902. The computing device 900 may be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 900.
总线902可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线902可包括在计算设备900各个部件(例如,存储器906、处理器904、通信接口908)之间传送信息的通路。The bus 902 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, FIG. 9 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 902 may include a path for transmitting information between various components of the computing device 900 (e.g., the memory 906, the processor 904, and the communication interface 908).
处理器904可以包括中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。Processor 904 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP) or a digital signal processor (DSP).
在一些可能的实现方式中,处理器904可以包含一个或多个图形处理器。该处理器904用于执行存储在存储器906中的指令以实现前述图5或者图7对应的实施例所述的方法。In some possible implementations, the processor 904 may include one or more graphics processors. The processor 904 is configured to execute instructions stored in the memory 906 to implement the method described in the embodiment corresponding to FIG. 5 or FIG. 7 .
在一些可能的实现方式中,处理器904可以包括一个或多个中央处理器和一个或多个图形处理器。该处理器904用于执行存储在存储器906中的指令以实现前述图5或者图7对应的实施例所述的方法。In some possible implementations, the processor 904 may include one or more central processing units and one or more graphics processing units. The processor 904 is configured to execute instructions stored in the memory 906 to implement the method described in the embodiment corresponding to FIG. 5 or FIG. 7 .
存储器906可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。处理器904还可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory, ROM),快闪存储器,机械硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD)。存储器906中存储有可执行的程序代码,处理器904执行该可执行的程序代码以实现图5或者图7对应的实施例所述的方法。具体的,存储器906上存有渲染节点用于执行图5或者图7对应的实施例所述的方法的指令。The memory 906 may include a volatile memory, such as a random access memory (RAM). The processor 904 may also include a non-volatile memory, such as a read-only memory (READ-ONLY MEMORY). ROM), flash memory, hard disk drive (HDD) or solid state drive (SSD). The memory 906 stores executable program code, and the processor 904 executes the executable program code to implement the method described in the embodiment corresponding to FIG. 5 or FIG. 7. Specifically, the memory 906 stores instructions for the rendering node to execute the method described in the embodiment corresponding to FIG. 5 or FIG. 7.
通信接口908使用例如但不限于网络接口卡、收发器一类的收发模块,来实现计算设备900与其他设备或通信网络之间的通信。The communication interface 908 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or communication networks.
本申请实施例还提供了一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备执行上述图5或者图7对应的实施例所述的方法。The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the method described in the embodiment corresponding to Figure 5 or Figure 7 above.
本申请实施例还提供了一种包含指令的计算机程序产品。所述计算机程序产品可以是包含指令的,能够运行在计算设备上或被储存在任何可用介质中的软件或程序产品。当所述计算机程序产品在至少一个计算机设备上运行时,使得至少一个计算机设备执行上述图5或者图7对应的实施例所述的方法。The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computer device, the at least one computer device executes the method described in the embodiment corresponding to FIG. 5 or FIG. 7 above.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flowchart and/or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, and the combination of the process and/or box in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。 Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (17)

  1. 一种光源剔除方法,其特征在于,所述方法应用于渲染应用,所述渲染应用包括多个三维模型和多个光源,每一三维模型包括多个缓存点,所述方法包括:A light source culling method, characterized in that the method is applied to a rendering application, the rendering application includes multiple three-dimensional models and multiple light sources, each three-dimensional model includes multiple cache points, and the method includes:
    分别计算所述多个光源在目标缓存点处的多个光照强度值,所述多个缓存点包括所述目标缓存点,第一视点对应的可视空间中包括所述目标缓存点;respectively calculating a plurality of illumination intensity values of the plurality of light sources at target cache points, the plurality of cache points including the target cache point, and the visible space corresponding to the first viewpoint including the target cache point;
    根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源;determining at least one target light source from the plurality of light sources according to the plurality of light intensity values and the light intensity threshold;
    基于所述至少一个目标光源,对所述目标缓存点进行着色计算,以获得所述第一视点对应的渲染结果。Based on the at least one target light source, a shading calculation is performed on the target cache point to obtain a rendering result corresponding to the first viewpoint.
  2. 根据权利要求1所述的方法,其特征在于,第二视点对应的可视空间中包括所述目标缓存点,所述方法还包括:The method according to claim 1, characterized in that the visual space corresponding to the second viewpoint includes the target cache point, and the method further comprises:
    基于所述至少一个目标光源,对所述目标缓存点进行着色计算,以获得所述第二视点对应的渲染结果。Based on the at least one target light source, a shading calculation is performed on the target cache point to obtain a rendering result corresponding to the second viewpoint.
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源后,所述方法还包括:The method according to claim 1 or 2, characterized in that after determining at least one target light source from the multiple light sources according to the multiple light intensity values and the light intensity thresholds, the method further comprises:
    存储所述目标缓存点与所述至少一个目标光源的对应关系。The corresponding relationship between the target cache point and the at least one target light source is stored.
  4. 根据权利要求1至3中任一所述的方法,其特征在于,所述缓存点为下述的一种或多种:The method according to any one of claims 1 to 3, characterized in that the cache point is one or more of the following:
    面片、纹素点、点云中的点。Patches, texel points, points in point clouds.
  5. 根据权利要求1至4中任一所述的方法,其特征在于,所述缓存点位于所述三维模型的表面,不同三维模型包括的缓存点的数量不同。The method according to any one of claims 1 to 4 is characterized in that the cache points are located on the surface of the three-dimensional model, and different three-dimensional models include different numbers of cache points.
  6. 根据权利要求1至5中任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 5, characterized in that the method further comprises:
    提供配置接口,所述配置接口用于接收用户设置的所述光照强度阈值。A configuration interface is provided, wherein the configuration interface is used to receive the light intensity threshold set by a user.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述至少一个目标光源中的每一目标光源在所述目标缓存点处的光照强度值大于或等于所述光照强度阈值。The method according to any one of claims 1 to 6, characterized in that the light intensity value of each target light source of the at least one target light source at the target cache point is greater than or equal to the light intensity threshold.
  8. 一种渲染引擎,其特征在于,所述渲染引擎用于渲染应用,所述渲染应用包括多个三维模型和多个光源,每一三维模型包括多个缓存点,所述渲染引擎包括处理单元和存储单元;A rendering engine, characterized in that the rendering engine is used for rendering applications, the rendering application includes multiple three-dimensional models and multiple light sources, each three-dimensional model includes multiple cache points, and the rendering engine includes a processing unit and a storage unit;
    所述处理单元,用于从所述存储单元中获取目标缓存点,分别计算所述多个光源在所述目标缓存点处的多个光照强度值,所述多个缓存点包括所述目标缓存点,第一视点对应的可视空间中包括所述目标缓存点;根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源;以及基于所述至少一个目标光源,对所述目标缓存点进行着色计算,以获得所述第一视点对应的渲染结果。The processing unit is used to obtain a target cache point from the storage unit, and respectively calculate multiple illumination intensity values of the multiple light sources at the target cache points, where the multiple cache points include the target cache point, and the visible space corresponding to the first viewpoint includes the target cache point; determine at least one target light source from the multiple light sources according to the multiple illumination intensity values and the illumination intensity threshold; and perform shading calculation on the target cache point based on the at least one target light source to obtain a rendering result corresponding to the first viewpoint.
  9. 根据权利要求8所述的渲染引擎,其特征在于,第二视点对应的可视空间中包括所述目标缓存点,所述处理单元进一步用于:The rendering engine according to claim 8, wherein the visible space corresponding to the second viewpoint includes the target cache point, and the processing unit is further configured to:
    基于所述至少一个目标光源,对所述目标缓存点进行着色计算,以获得所述第二视点对应的渲染结果。Based on the at least one target light source, a shading calculation is performed on the target cache point to obtain a rendering result corresponding to the second viewpoint.
  10. 根据权利要求8或9所述的渲染引擎,其特征在于,在根据所述多个光照强度值和光照强度阈值,从所述多个光源中确定至少一个目标光源后,所述存储单元进一步用于:The rendering engine according to claim 8 or 9, characterized in that after determining at least one target light source from the multiple light sources according to the multiple light intensity values and the light intensity threshold, the storage unit is further used to:
    存储所述目标缓存点与所述至少一个目标光源的对应关系。 The corresponding relationship between the target cache point and the at least one target light source is stored.
  11. 根据权利要求8至10中任一所述的渲染引擎,其特征在于,所述缓存点为下述的一种或多种:The rendering engine according to any one of claims 8 to 10, wherein the cache point is one or more of the following:
    面片、纹素点、点云中的点。Patches, texel points, points in point clouds.
  12. 根据权利要求8至11中任一所述的渲染引擎,其特征在于,所述缓存点位于所述三维模型的表面,不同三维模型包括的缓存点的数量不同。The rendering engine according to any one of claims 8 to 11, characterized in that the cache points are located on the surface of the three-dimensional model, and different three-dimensional models include different numbers of cache points.
  13. 根据权利要求8至12中任一所述的渲染引擎,其特征在于,所述渲染引擎还包括配置接口,所述配置接口用于接收用户设置的所述光照强度阈值。The rendering engine according to any one of claims 8 to 12 is characterized in that the rendering engine also includes a configuration interface, and the configuration interface is used to receive the light intensity threshold set by a user.
  14. 根据权利要求8至13中任一项所述的渲染引擎,其特征在于,所述至少一个目标光源中的每一目标光源在所述目标缓存点处的光照强度值大于或等于所述光照强度阈值。The rendering engine according to any one of claims 8 to 13, characterized in that the light intensity value of each target light source of the at least one target light source at the target cache point is greater than or equal to the light intensity threshold.
  15. 一种计算机程序产品,其特征在于,所述计算机程序产品包括指令,当所述指令被计算机设备集群运行时,使得所述计算机设备集群执行如权利要求的1至7中任一项所述的方法。A computer program product, characterized in that the computer program product comprises instructions, and when the instructions are executed by a computer device cluster, the computer device cluster executes the method according to any one of claims 1 to 7.
  16. 一种计算机可读存储介质,其特征在于,包括计算机程序指令,当所述计算机程序指令由计算设备集群执行时,所述计算设备集群执行如权利要求1至7中任一项所述的方法。A computer-readable storage medium, characterized in that it includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method as described in any one of claims 1 to 7.
  17. 一种计算设备集群,其特征在于,包括至少一个计算设备,每个计算设备包括处理器和存储器;A computing device cluster, characterized in that it includes at least one computing device, each computing device includes a processor and a memory;
    所述至少一个计算设备的处理器用于执行所述至少一个计算设备的存储器中存储的指令,以使得所述计算设备集群执行如权利要求1至7中任一项所述的方法。 The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.
PCT/CN2023/101625 2022-11-23 2023-06-21 Light source elimination method and rendering engine WO2024109006A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211480728.X 2022-11-23
CN202211480728.XA CN118115644A (en) 2022-11-23 2022-11-23 Light source eliminating method and rendering engine

Publications (1)

Publication Number Publication Date
WO2024109006A1 true WO2024109006A1 (en) 2024-05-30

Family

ID=91195123

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/101625 WO2024109006A1 (en) 2022-11-23 2023-06-21 Light source elimination method and rendering engine

Country Status (2)

Country Link
CN (1) CN118115644A (en)
WO (1) WO2024109006A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103226839A (en) * 2013-04-22 2013-07-31 浙江大学 Three-channel high-reality-sense rendering method of transparent material
CN111260766A (en) * 2020-01-17 2020-06-09 网易(杭州)网络有限公司 Virtual light source processing method, device, medium and electronic equipment
CN111739074A (en) * 2020-06-03 2020-10-02 福建数博讯信息科技有限公司 Scene multipoint light source rendering method and device
US20220230379A1 (en) * 2021-01-19 2022-07-21 Krikey, Inc. Three-dimensional avatar generation and manipulation using shaders

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103226839A (en) * 2013-04-22 2013-07-31 浙江大学 Three-channel high-reality-sense rendering method of transparent material
CN111260766A (en) * 2020-01-17 2020-06-09 网易(杭州)网络有限公司 Virtual light source processing method, device, medium and electronic equipment
CN111739074A (en) * 2020-06-03 2020-10-02 福建数博讯信息科技有限公司 Scene multipoint light source rendering method and device
US20220230379A1 (en) * 2021-01-19 2022-07-21 Krikey, Inc. Three-dimensional avatar generation and manipulation using shaders

Also Published As

Publication number Publication date
CN118115644A (en) 2024-05-31

Similar Documents

Publication Publication Date Title
US9569885B2 (en) Technique for pre-computing ambient obscurance
WO2021228031A1 (en) Rendering method, apparatus and system
US8619078B2 (en) Parallelized ray tracing
US8243073B2 (en) Tree insertion depth adjustment based on view frustum and distance culling
US8692825B2 (en) Parallelized streaming accelerated data structure generation
US9508191B2 (en) Optimal point density using camera proximity for point-based global illumination
US9684997B2 (en) Efficient rendering of volumetric elements
US20230230311A1 (en) Rendering Method and Apparatus, and Device
WO2024037116A9 (en) Three-dimensional model rendering method and apparatus, electronic device and storage medium
CN114863014B (en) Fusion display method and device for three-dimensional model
CN116758208A (en) Global illumination rendering method and device, storage medium and electronic equipment
CN114529648A (en) Model display method, device, apparatus, electronic device and storage medium
AU2020449562B2 (en) Geometry-aware augmented reality effects with a real-time depth map
WO2023088047A1 (en) Rendering method and apparatus
CN115965735B (en) Texture map generation method and device
WO2024109006A1 (en) Light source elimination method and rendering engine
US9639975B1 (en) System and method for generating shadows
WO2023088059A1 (en) Three-dimensional model visibility data storage method and apparatus, device, and storage medium
JP2013117966A (en) Real-time global illumination rendering system
Miguel et al. Real-time 3D visualization of accurate specular reflections in curved mirrors a GPU implementation
CN116958364A (en) Data processing method and related device
CN115731331A (en) Method and related device for rendering application
CN116912416A (en) Face reduction method and device of three-dimensional model, electronic equipment and storage medium
Miguel et al. Real-Time 3D Visualization of Accurate Specular Reflections in Curved Mirrors
CN113769382A (en) Method, device and equipment for eliminating model in game scene and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23893106

Country of ref document: EP

Kind code of ref document: A1