Scene multipoint light source rendering method and device

文档序号:1128853 发布日期:2020-10-02 浏览:21次 中文

阅读说明:本技术 一种场景多点光源渲染方法及装置 (Scene multipoint light source rendering method and device ) 是由 林进浔 黄明炜 于 2020-06-03 设计创作,主要内容包括:本发明提供的一种场景多点光源渲染方法及装置,通过创建第一渲染贴图,生成颜色贴图;创建第二渲染贴图,生成方向贴图;根据所述方向贴图和颜色贴图进行像素的着色计算,在实际渲染时采用预结算渲染贴图的方式,不仅解决了前向渲染管线计算量大的问题,还解决了延迟渲染中传输带宽消耗大的问题。(The invention provides a scene multipoint light source rendering method and a scene multipoint light source rendering device, wherein a color map is generated by creating a first rendering map; creating a second rendering map, and generating a direction map; and performing pixel coloring calculation according to the direction map and the color map, and adopting a mode of precalculating the rendering map during actual rendering, thereby solving the problem of large calculation amount of a forward rendering pipeline and the problem of large transmission bandwidth consumption in delayed rendering.)

1. A scene multipoint light source rendering method is characterized by comprising the following steps:

s1, creating a first rendering map, and generating a color map;

s2, creating a second rendering map, and generating a direction map;

and S3, performing pixel coloring calculation according to the direction map and the color map.

2. The scene multipoint light source rendering method of claim 1, wherein step S1 is preceded by:

s01, acquiring data information of all point light sources in the current scene;

and S02, calculating the vertex cache and the index cache of each point light source according to the data information, and generating a patch model of each point light source.

3. The scene multipoint light source rendering method of claim 1, wherein the data information comprises a position, an illuminated area, and a point color of a point light source.

4. The scene multipoint light source rendering method according to claim 2, wherein step S1 specifically is:

and creating a first rendering map, and rendering the facet model of each point light source into the first rendering map one by one to obtain a color map containing the final color value of the superimposed colors of all the point light sources.

5. The scene multipoint light source rendering method according to claim 2, wherein step S2 specifically is:

and creating a corresponding number of second rendering maps according to a preset rule, and rendering the facet models of each point light source into the second rendering maps one by one to obtain a direction map containing the direction of each pixel light source.

6. A scene multipoint light source rendering apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of:

s1, creating a first rendering map, and generating a color map;

s2, creating a second rendering map, and generating a direction map;

and S3, performing pixel coloring calculation according to the direction map and the color map.

7. The scene multipoint light source rendering apparatus according to claim 6, further comprising before step S1:

s01, acquiring data information of all point light sources in the current scene;

and S02, calculating the vertex cache and the index cache of each point light source according to the data information, and generating a patch model of each point light source.

8. The scene multipoint light source rendering apparatus of claim 6, wherein the data information comprises a position, an illuminated area and a point color of a point light source.

9. The scene multipoint light source rendering device according to claim 7, wherein step S1 is specifically:

and creating a first rendering map, and rendering the facet model of each point light source into the first rendering map one by one to obtain a color map containing the final color value of the superimposed colors of all the point light sources.

10. The scene multipoint light source rendering device according to claim 7, wherein step S2 is specifically:

and creating a corresponding number of second rendering maps according to a preset rule, and rendering the facet models of each point light source into the second rendering maps one by one to obtain a direction map containing the direction of each pixel light source.

Technical Field

The invention relates to the field of computer graphic images, in particular to a scene multipoint light source rendering method and device.

Background

The traditional scene multipoint light source rendering method comprises the following steps:

1. forward rendering: in the conventional forward rendering scheme, each illuminant needs a separate rendering channel for calculation when each object is rendered, and when a large number of objects and illuminants exist in a scene, a large amount of performance consumption is generated, which is a performance burden hard to bear for a PC or a mobile platform, and if n objects and m illuminants exist, the number of final rendering channels is n × m.

2. And (3) delayed rendering: the delayed rendering is proposed to solve a large amount of illumination calculation in the scheme, the delayed rendering scheme is to write information such as inherent color, normal, highlight, AO and the like into a geometric cache, so that calculation of object-by-light source in the traditional forward rendering is avoided, if n objects exist in a scene and m lights exist in the scene, the number of final rendering channels is n + m, although the problem of calculation amount is solved, a large amount of transmission bandwidth consumption is brought, and the efficiency on a mobile platform is low.

Therefore, a scene multipoint light source rendering method and device are needed, which can solve the problem of large calculation amount of a forward rendering pipeline and the problem of large transmission bandwidth consumption in delayed rendering.

Disclosure of Invention

Technical problem to be solved

In order to solve the above problems in the prior art, the present invention provides a scene multipoint light source rendering method and apparatus, which can solve the problem of large computation amount of a forward rendering pipeline and the problem of large transmission bandwidth consumption in delayed rendering.

(II) technical scheme

In order to achieve the purpose, the invention adopts a technical scheme that:

a scene multipoint light source rendering method comprises the following steps:

s1, creating a first rendering map, and generating a color map;

s2, creating a second rendering map, and generating a direction map;

and S3, performing pixel coloring calculation according to the direction map and the color map.

In order to achieve the purpose, the invention adopts another technical scheme as follows:

a scene multipoint light source rendering apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps when executing the program of:

s1, creating a first rendering map, and generating a color map;

s2, creating a second rendering map, and generating a direction map;

and S3, performing pixel coloring calculation according to the direction map and the color map.

(III) advantageous effects

The invention has the beneficial effects that: generating a color map by creating a first rendering map; creating a second rendering map, and generating a direction map; and performing pixel coloring calculation according to the direction map and the color map, and adopting a mode of precalculating the rendering map during actual rendering, thereby solving the problem of large calculation amount of a forward rendering pipeline and the problem of large transmission bandwidth consumption in delayed rendering.

Drawings

Fig. 1 is a flowchart of a scene multipoint light source rendering method according to an embodiment of the present invention;

fig. 2 is a schematic structural diagram of a scene multipoint light source rendering apparatus according to an embodiment of the present invention.

[ description of reference ]

1: a scene multipoint light source rendering device;

2: a memory;

3: a processor.

Detailed Description

For the purpose of better explaining the present invention and to facilitate understanding, the present invention will be described in detail by way of specific embodiments with reference to the accompanying drawings.

Referring to fig. 1, a scene multipoint light source rendering method includes the steps of:

s01, acquiring data information of all point light sources in the current scene, wherein the data information comprises the positions, the lighting areas and the point colors of the point light sources;

specifically, a rectangular area is formed according to the position of each point light source and the illumination area, whether the point light sources intersect with the rectangle of the window is calculated, and the point light sources which have no influence on the current window are removed;

and S02, calculating the vertex cache and the index cache of each point light source according to the data information, and generating a patch model of each point light source.

According to the invention, the color, direction and intensity information of the point light source is preprocessed in the rendering process, the point light source is pre-rendered on a few rendering targets, and then a way of pre-calculating the rendering map is adopted in the actual rendering, so that the problem of large calculation amount of a forward rendering pipeline is solved, and the problem of large transmission bandwidth consumption in delayed rendering is also solved.

S1, creating a first rendering map, and generating a color map;

step S1 specifically includes:

and creating a first rendering map, and rendering the facet model of each point light source into the first rendering map one by one to obtain a color map containing the final color value of the superimposed colors of all the point light sources.

S2, creating a second rendering map, and generating a direction map;

step S2 specifically includes:

and creating a corresponding number of second rendering maps according to a preset rule, and rendering the facet models of each point light source into the second rendering maps one by one to obtain a direction map containing the direction of each pixel light source.

Specifically, the creating of the second rendering maps of the corresponding number according to the preset rule specifically includes:

if the current device supports floating point textures, two second rendering maps are created;

if the current device does not support floating-point textures, four second rendering maps are created;

and S3, performing pixel coloring calculation according to the direction map and the color map.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种结合多尺度注意力的深层网络肺部纹理识别方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!