# US 2024/0005592 A1 · Image rendering method and apparatus, device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0005592 A1
- Document ID: US20240005592A1
- Status: Published application
- Kind: A1
- Application number: 18/348,101
- Filed: 2023-07-06
- Published: 2024-01-04
- Earliest claimed: 2022-01-26
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Liming XU; Dong DONG
- Web page: https://patentgrep.com/patent/US20240005592A1

## CPC

- G06T 15/506: {Illumination models}
- G06T 15/04: Texture mapping
- G06T 15/80: Shading
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

An image rendering method includes: acquiring a project scene, materials of an object in the project scene including a light source material, and the light source material being a material that is endowed with a light source attribute by setting a corresponding shading model to be a custom grid light source shading model; searching object grids with the light source material from the project scene, and performing light source structure conversion on the object grids with the light source material to obtain light source grids, the object grids being grids used for forming the object in the project scene; and using each of the light source grids as a light source, to perform direct illumination rendering on each of pixels of the image representing the project scene, and fusing a direct illumination rendering result of each of the light source grids for each of the pixels to obtain a rendered target image.

## Claims

### Claim 1

An image rendering method, executed by a terminal, the method comprising:
acquiring a project scene, materials of an object in the project scene including a light source material, and the light source material being a material that is endowed with a light source attribute by setting a corresponding shading model to be a custom grid light source shading model;
searching object grids with the light source material from the project scene, and performing light source structure conversion on the object grids with the light source material to obtain light source grids, the object grids being grids used for forming the object in the project scene; and
using each of the light source grids as a light source, to perform direct illumination rendering on each of pixels of an image representing the project scene, and fusing a direct illumination rendering result of each of the light source grids for each of the pixels to obtain a rendered target image.

### Claim 2 (depends on 1)

The method according to claim 1, wherein a same object in the project scene includes a plurality of grid regions of a same material, the grid regions of the same material are regions including a plurality of adjacent object grids of the same material in the same object, and searching the object grids comprises:
searching, from the grid regions of the same material in the project scene, the grid regions of the same material with the light source attribute, to obtain self-luminous grid regions of the same material, each of the object grids included in the self-luminous grid regions of the same material being the object grid of the light source material; and
performing light source structure conversion on the object grids of the light source material in the self-luminous grid region of the same material, to obtain the light source grids.

### Claim 3 (depends on 2)

The method according to claim 2, wherein performing the light source structure conversion comprises:
acquiring, for each of the self-luminous grid regions of the same material, a calculation scheduling instruction corresponding to the self-luminous grid region of the same material; and
enabling a calculation shader according to the calculation scheduling instruction, to execute a plurality of threads in the calculation shader, and performing light source structure conversion in parallel on the object grids of the light source material in the self-luminous grid region of the same material, to obtain the light source grids.

### Claim 4 (depends on 3)

The method according to claim 3, wherein enabling the calculation shader comprises:
enabling the calculation shader according to the calculation scheduling instruction, so that the calculation shader enables the threads of which the quantity is the same as the quantity of the object grids in the self-luminous grid region of the same material; and
performing light source structure conversion in parallel on the object grids of the light source material in the self-luminous grid region of the same material through the enabled threads, of which the quantity is the same as the quantity of the object grids in the self-luminous grid region of the same material, to obtain the light source grids,
each of the object grids in the self-luminous grid region of the same material corresponding to one thread.

### Claim 5 (depends on 1)

The method according to claim 1, wherein using the each of the light source grids as the light source comprises:
using each of the light source grids as the light source, and determining radiant illumination information of the light source grid; and
performing, based on the radiant illumination information of each of the light source grids, direct illumination rendering on each of the pixels of the image representing the project scene.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the radiant illumination information includes a radiant color value; and determining radiant illumination information of the light source grid comprises:
in response to that the light source grid is a solid color light source grid, using a self-luminous color value corresponding to the solid color light source grid as the radiant color value of the solid color light source grid, the self-luminous color value being a color value preset in a grid light source shading model corresponding to the solid color light source grid.

### Claim 7 (depends on 5)

The method according to claim 5, wherein the radiant illumination information includes a radiant color value; and determining the radiant illumination information of the light source grid comprises:
in response to that the light source grid is a texture light source grid, determining an average color value of texture colors in the texture light source grid, to obtain the radiant color value of the texture light source grid.

### Claim 8 (depends on 7)

The method according to claim 7, wherein determining the average color value of texture colors comprises:
in response to that the light source grid is a texture light source triangular grid, determining the length of each of edges in the texture light source triangular grid;
determining the length of the shortest edge of the texture light source triangular grid, and determining a first texture information change rate of the texture light source triangular grid in a texture space;
determining, according to the corresponding lengths of two long edges of the texture light source triangular grid, a second texture information change rate of the texture light source triangular grid in the texture space, the two long edges being two edges except the shortest edge of the texture light source triangular grid; and
determining, according to the first texture information change rate and the second texture information change rate corresponding to the texture light source triangular grid, the average color value of the texture colors in the texture light source triangular grid, to obtain the radiant color value of the texture light source triangular grid.

### Claim 9 (depends on 8)

The method according to claim 8, wherein determining the average color value of the texture colors comprises:
using the first texture information change rate and the second texture information change rate corresponding to the texture light source triangular grid as parameters of a level determination function, to obtain a corresponding level of texture mapping;
using a texture color value corresponding to the level of the texture mapping as the average color value of the texture colors in the texture light source triangular grid, to obtain the radiant color value of the texture light source triangular grid,
the level determination function being a function that is pre-built and used for determining the level of the texture mapping.

### Claim 10 (depends on 5)

The method according to claim 5, wherein performing the direct illumination rendering comprises:
determining, for each of the light source grids, a direct illumination contribution value of the light source grid to each of the pixels of the image representing the project scene; and
determining, according to the direct illumination contribution value and the radiant illumination information, a rendering illumination value contributed by the light source grid to each of the pixels of the image representing the project scene; and
fusing the direct illumination rendering result comprises:
fusing the rendering illumination value of each of the light source grids for each of the pixels, to obtain the rendered target image.

### Claim 11 (depends on 10)

The method according to claim 10, wherein determining the direct illumination contribution value of the light source grid comprises:
sampling, for each of the light source grids, points in the light source grid according to a probability density distribution function, to obtain sampling points in the light source grid;
determining, for each of the pixels of the image representing the project scene, a first contribution coefficient of each of the sampling points relative to the pixel according to location information corresponding to each of the sampling points and location information of a camera;
determining, according to the included angle between incident light of each of the sampling points to the pixel and a normal of the pixel, a second contribution coefficient of each of the sampling points relative to the pixel;
determining, according to a probability density distribution function value for sampling each of the sampling points, a third contribution coefficient of each of the sampling points relative to the pixel; and
determining, according to the first contribution coefficient, the second contribution coefficient and the third contribution coefficient of each of the sampling points relative to the pixel, the direct illumination contribution value of the light source grid to the pixel in the project scene.

### Claim 12 (depends on 11)

The method according to claim 11, wherein determining the third contribution coefficient comprises:
determining, for each of the light source grids, the center of gravity and the grid area of the light source grid;
determining, for each of the pixels of the image representing the project scene, a distance between the center of gravity of the light source grid and the pixel in the project scene;
determining, based on the distance and the grid area of the light source grid, a first solid angle of the light source grid relative to the pixel; and
determining, according to the first solid angle, a probability density distribution function value for sampling each of the sampling points, and using the probability density distribution function value for sampling each of the sampling points as the third contribution coefficient of the sampling point relative to the pixel.

### Claim 13 (depends on 10)

The method according to claim 10, wherein determining the direct illumination contribution value comprises:
determining, for each of the pixels of the image representing the project scene, a vector of each of edges formed by the pixel and each of vertexes of the light source grid;
determining, according to the vector of each of the edges, a normal vector of each of planes, where the pixel is located, of a polygonal pyramid formed by the pixel and the vertexes of the light source grid;
determining, according to the normal vector of each of the planes where the pixel is located, a second solid angle of the light source grid relative to the pixel; and
using the second solid angle as the direct illumination contribution value of the light source grid to the pixel in the project scene.

### Claim 14 (depends on 1)

The method according to claim 1, wherein performing the light source structure conversion comprises:
performing light source structure conversion on the object grids of the light source material, to obtain initial light source grids;
determining the grid areas and the radiant illumination information of the initial light source grids;
determining, for each of the initial light source grids, luminous flux of the initial light source grid, according to the grid area and the radiant illumination information of the initial light source grid; and
sampling, according to the luminous flux of the initial light source grids, the initial light source grids to obtain the light source grids.

### Claim 15

An image rendering apparatus, the apparatus comprising: a memory storing computer program instructions; and a processor coupled to the memory and configured to execute the computer program instructions and perform:
acquiring a project scene, materials of an object in the project scene including a light source material, and the light source material being a material that is endowed with a light source attribute by setting a corresponding shading model to be a custom grid light source shading model;
searching object grids with the light source material from the project scene, and performing light source structure conversion on the object grids with the light source material to obtain light source grids, the object grids being grids used for forming the object in the project scene; and
using each of the light source grids as a light source, to perform direct illumination rendering on each of pixels of an image representing the project scene, and fusing a direct illumination rendering result of each of the light source grids for each of the pixels to obtain a rendered target image.

### Claim 16 (depends on 15)

The apparatus according to claim 15, wherein a same object in the project scene includes a plurality of grid regions of a same material, the grid regions of the same material are regions including a plurality of adjacent object grids of the same material in the same object, and searching the object grids includes:
searching, from the grid regions of the same material in the project scene, the grid regions of the same material with the light source attribute, to obtain self-luminous grid regions of the same material, each of the object grids included in the self-luminous grid regions of the same material being the object grid of the light source material; and
performing light source structure conversion on the object grids of the light source material in the self-luminous grid region of the same material, to obtain the light source grids.

### Claim 17 (depends on 16)

The apparatus according to claim 16, wherein performing the light source structure conversion includes:
acquiring, for each of the self-luminous grid regions of the same material, a calculation scheduling instruction corresponding to the self-luminous grid region of the same material; and
enabling a calculation shader according to the calculation scheduling instruction, to execute a plurality of threads in the calculation shader, and performing light source structure conversion in parallel on the object grids of the light source material in the self-luminous grid region of the same material, to obtain the light source grids.

### Claim 18 (depends on 15)

The apparatus according to claim 15, wherein using the each of the light source grids as the light source includes:
using each of the light source grids as the light source, and determining radiant illumination information of the light source grid; and
performing, based on the radiant illumination information of each of the light source grids, direct illumination rendering on each of the pixels of the image representing the project scene.

### Claim 19 (depends on 15)

The apparatus according to claim 15, wherein performing the light source structure conversion includes:
performing light source structure conversion on the object grids of the light source material, to obtain initial light source grids;
determining the grid areas and the radiant illumination information of the initial light source grids;
determining, for each of the initial light source grids, luminous flux of the initial light source grid, according to the grid area and the radiant illumination information of the initial light source grid; and
sampling, according to the luminous flux of the initial light source grids, the initial light source grids to obtain the light source grids.

### Claim 20

A non-transitory computer-readable storage medium storing computer program instructions executable by at least one processor to perform:
acquiring a project scene, materials of an object in the project scene including a light source material, and the light source material being a material that is endowed with a light source attribute by setting a corresponding shading model to be a custom grid light source shading model;
searching object grids with the light source material from the project scene, and performing light source structure conversion on the object grids with the light source material to obtain light source grids, the object grids being grids used for forming the object in the project scene; and
using each of the light source grids as a light source, to perform direct illumination rendering on each of pixels of the image representing the project scene, and fusing a direct illumination rendering result of each of the light source grids for each of the pixels to obtain a rendered target image.
