CN103035027A - Illumination rendering method for fixed light source - Google Patents

Illumination rendering method for fixed light source Download PDF

Info

Publication number
CN103035027A
CN103035027A CN2012105178162A CN201210517816A CN103035027A CN 103035027 A CN103035027 A CN 103035027A CN 2012105178162 A CN2012105178162 A CN 2012105178162A CN 201210517816 A CN201210517816 A CN 201210517816A CN 103035027 A CN103035027 A CN 103035027A
Authority
CN
China
Prior art keywords
light source
fixed light
stage
diffuse
rendering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012105178162A
Other languages
Chinese (zh)
Other versions
CN103035027B (en
Inventor
王延樑
郭鹏
谢胜蓝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Creatoo Network Technology Co ltd
Original Assignee
Shanghai Chuangtu Network Science & Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Chuangtu Network Science & Technology Development Co Ltd filed Critical Shanghai Chuangtu Network Science & Technology Development Co Ltd
Priority to CN201210517816.2A priority Critical patent/CN103035027B/en
Publication of CN103035027A publication Critical patent/CN103035027A/en
Application granted granted Critical
Publication of CN103035027B publication Critical patent/CN103035027B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The invention relates to an illumination rendering method for a fixed light source. The method comprises a preprocessing stage and a real-time rendering stage. In the preprocessing stage, the diffusion grains of all object models in a scene is traversed in sequence, processing to the diffusion grains is carried out, and the color pattern information corresponding to each pixel point of the diffusion grains of the object models is acquired. In the real-time rendering stage, the illumination effect generated by a fixed light source is calculated according to the color pattern information corresponding to each pixel point of the object models, and the illumination rendering is carried out. Compared with the prior art, the illumination rendering method for the fixed light source transfers most computational process from the real-time rendering stage to the preprocessing stage, greatly reduces the computation amount of the real-time rendering stage, effectively saves the computing resource of a graphics processing unit (GPU), and improves rendering efficiency.

Description

A kind of irradiation rendering method for fixed light source
Technical field
The present invention relates to a kind of information processing method, especially relate to a kind of irradiation rendering method for fixed light source.
Background technology
Illumination calculation is the larger part of the operand in the 3d render process.Because the at present restriction of hardware computing power is to support multiple light courcess in real-time 3d scene.For addressing this problem, that uses at present has several modes such as summit illumination, pixel light photograph, deferred lighting.
Summit illumination is based on summit computing illumination result, and then the illumination result with the summit carries out interpolation in triangle, and it is less that advantage is that calculated amount compares, but may cause the problem that lighting effect is discontinuous and lose high optical information in a lot of situations.
It is to carry out illumination calculation in every pixel that pixel is looked after, and directly obtains the illumination result, and calculated amount increases with the resolution of playing up, over-extraction sample situation and scene organization formula, so calculated amount is larger, but effect is more accurate.Because calculated amount is large, can not support too many light source.
Deferred lighting is that the information that illumination is relevant stores in the buffer zone identical with playing up target resolution, utilizes these information calculations illumination result after scene rendering is finished, and effect is more accurate.Calculated amount is directly proportional with the resolution of playing up target and quantity of light source in this manner.
Summary of the invention
Purpose of the present invention is exactly to provide a kind of irradiation rendering method for fixed light source for the defective that overcomes above-mentioned prior art existence, the method with most computation process from the real-time rendering phase transition to pretreatment stage, large senior general has lacked the operand with the real-time rendering stage, effectively save the calculation resources of GPU, improved rendering efficiency.
Purpose of the present invention can be achieved through the following technical solutions:
A kind of irradiation rendering method for fixed light source, the method comprises the steps:
Pretreatment stage travels through the diffuse texture of all objects model in the scene successively, and described diffuse texture is processed, and obtains the color mode information that each pixel is corresponding on the object model diffuse texture;
The real-time rendering stage, according on the object model every color mode information corresponding to each pixel, calculate the lighting effect that fixed light source produces, carry out illumination and play up.
Described color mode information adopts the form of RGBA to carry out record.
Described pretreatment stage specifically may further comprise the steps:
1) travels through successively the diffuse texture of all objects model in the scene, obtain the corresponding diffuse texture of each object model;
2) each pixel on the traversal object model diffuse texture obtains coordinate, normal and the material information of this homologue body Model position, pixel place;
3) according to step 2) in color mode information corresponding to each pixel of information calculations that obtains.
In the described color mode information, the information of R, G, three passages of B calculates according to following formula:
K RGB = min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K d cos θ
In the formula, C 0, C 1, C 2Be three fixed coefficients, d be fixed light source to the distance of irradiation position, θ is the incident angle of light, K dBe diffuse-reflection factor;
The information of A channel calculates according to following formula:
K A = min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K s
In the formula, C 0, C 1, C 2Be three fixed coefficients, d is that fixed light source is to the distance of irradiation position, K sBe specularity factor.
Described real-time rendering is in the stage, and the lighting effect that fixed light source produces calculates by following formula:
I = I p K RGB + I p K A cos n α = I p min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K d cos θ + I p min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K s cos n α
In the formula, I pBe incident intensity, C 0, C 1, C 2Be three fixed coefficients, d is that fixed light source is to the distance of irradiation position, K dBe diffuse-reflection factor, θ is the incident angle of light, K sBe specularity factor, α is the angle of direction of visual lines and mirror-reflection light direction, and n is the constant relevant with the body surface smoothness.
Compared with prior art, most of computation process of the illumination result of fixed light source is from the real-time rendering phase transition to pretreatment stage among the present invention, larger minimizing at the operand in real-time rendering stage, thereby improved the efficient of real-time rendering, can save more GPU arithmetic capability to realize the smooth degree of more effect or raising real-time rendering, be particularly suitable for processing the effect of fixed position dynamic light sources a large amount of in the urban landscape.
Description of drawings
Fig. 1 is process flow diagram of the present invention;
Fig. 2 is the synoptic diagram of light reflection.
Embodiment
The present invention is described in detail below in conjunction with the drawings and specific embodiments.
Embodiment
As shown in Figure 1, a kind of irradiation rendering method for fixed light source, the method comprises following pretreatment stage and two stages of real-time rendering.
Pretreatment stage:
Travel through successively the diffuse texture of all objects model in the scene, described diffuse texture is processed, obtain the color mode information that each pixel is corresponding on the object model diffuse texture.
Concrete process is:
1) travels through successively the diffuse texture of all objects model in the scene, obtain the corresponding diffuse texture of each object model, if the same part of a diffuse texture is used by a plurality of object models, need to be broken down into different diffuse texture and process respectively;
2) each pixel on the traversal object model diffuse texture obtains coordinate, normal and the material information of this homologue body Model position, pixel place.
3) according to step 2) in color mode information corresponding to each pixel of information calculations that obtains, color mode information adopts the form of RGBA to carry out record among the present invention.
Since illumination generally by surround lighting, diffuse, specular light, therefore wherein under actual conditions, surround lighting is generally definite value, and only relevant with the characteristic of body surface, only needs diffusing and specular light calculates.Diffuse and to be expressed as I d=I pK dCos θ, wherein, I pBe incident intensity, K dBe diffuse-reflection factor, θ is the incident angle of light, and specular light can represent I s=I pK sCos nα, wherein, I pBe incident intensity, K sBe specularity factor, α is the angle of direction of visual lines and mirror-reflection light direction, and n is the constant relevant with the body surface smoothness, and the surface is more smooth, and n is larger, and described angular relationship as shown in Figure 2.Because in practice, incident intensity can reduce with the increase of distance, actual intensity I p' with incident intensity I in theory pBetween have a following relation:
I p ′ = min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) I p
In the formula, C 0, C 1, C 2Be three fixed coefficients, d is that fixed light source is to the distance of irradiation position.
Therefore, in color mode information, the information of R, G, three passages of B calculates according to following formula:
K RGB = min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K d cos θ
Because mirror-reflection only partly is reduced to for light intensity, rather than for three color components of RGB, so the information of A channel calculates according to following formula:
K A = min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K s
Pretreatment stage is finished.
The real-time rendering stage, according on the object model every color mode information corresponding to each pixel, calculate the lighting effect that fixed light source produces, carry out illumination and play up.The lighting effect that fixed light source produces can calculate by following formula:
I = I p K RGB + I p K A cos n α = I p min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K d cos θ + I p min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K s cos n α
Most of computation process of the illumination result of fixed light source is from the real-time rendering phase transition to pretreatment stage among the present invention, larger minimizing at the operand in real-time rendering stage, thereby improved the efficient of real-time rendering, can save more GPU arithmetic capability to realize the smooth degree of more effect or raising real-time rendering, be particularly suitable for processing the effect of fixed position dynamic light sources a large amount of in the urban landscape.

Claims (5)

1. an irradiation rendering method that is used for fixed light source is characterized in that the method comprises the steps:
Pretreatment stage travels through the diffuse texture of all objects model in the scene successively, and described diffuse texture is processed, and obtains the color mode information that each pixel is corresponding on the object model diffuse texture;
The real-time rendering stage, according on the object model every color mode information corresponding to each pixel, calculate the lighting effect that fixed light source produces, carry out illumination and play up.
2. a kind of irradiation rendering method for fixed light source according to claim 1 is characterized in that, described color mode information adopts the form of RGBA to carry out record.
3. a kind of irradiation rendering method for fixed light source according to claim 2 is characterized in that described pretreatment stage specifically may further comprise the steps:
1) travels through successively the diffuse texture of all objects model in the scene, obtain the corresponding diffuse texture of each object model;
2) each pixel on the traversal object model diffuse texture obtains coordinate, normal and the material information of this homologue body Model position, pixel place;
3) according to step 2) in color mode information corresponding to each pixel of information calculations that obtains.
4. a kind of irradiation rendering method for fixed light source according to claim 3 is characterized in that, in the described color mode information, the information of R, G, three passages of B calculates according to following formula:
K RGB = min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K d cos θ
In the formula, C 0, C 1, C 2Be three fixed coefficients, d be fixed light source to the distance of irradiation position, θ is the incident angle of light, K dBe diffuse-reflection factor;
The information of A channel calculates according to following formula:
K A = min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K s
In the formula, C 0, C 1, C 2Be three fixed coefficients, d is that fixed light source is to the distance of irradiation position, K sBe specularity factor.
5. a kind of irradiation rendering method for fixed light source according to claim 4 is characterized in that, described real-time rendering is in the stage, and the lighting effect that fixed light source produces calculates by following formula:
I = I p K RGB + I p K A cos n α = I p min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K d cos θ + I p min ( 1 , 1 C 0 + C 1 d + C 2 d 2 ) K s cos n α
In the formula, I pBe incident intensity, C 0, C 1, C 2Be three fixed coefficients, d is that fixed light source is to the distance of irradiation position, K dBe diffuse-reflection factor, θ is the incident angle of light, K sBe specularity factor, α is the angle of direction of visual lines and mirror-reflection light direction, and n is the constant relevant with the body surface smoothness.
CN201210517816.2A 2012-12-05 2012-12-05 A kind of irradiation rendering method for fixed light source Active CN103035027B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210517816.2A CN103035027B (en) 2012-12-05 2012-12-05 A kind of irradiation rendering method for fixed light source

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210517816.2A CN103035027B (en) 2012-12-05 2012-12-05 A kind of irradiation rendering method for fixed light source

Publications (2)

Publication Number Publication Date
CN103035027A true CN103035027A (en) 2013-04-10
CN103035027B CN103035027B (en) 2016-08-03

Family

ID=48021892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210517816.2A Active CN103035027B (en) 2012-12-05 2012-12-05 A kind of irradiation rendering method for fixed light source

Country Status (1)

Country Link
CN (1) CN103035027B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991717A (en) * 2017-03-16 2017-07-28 珠海市魅族科技有限公司 A kind of image processing method being applied under three-dimensional scenic and system
CN108986200A (en) * 2018-07-13 2018-12-11 北京中清龙图网络技术有限公司 The preprocess method and system of figure rendering
CN109901905A (en) * 2019-02-28 2019-06-18 网易(杭州)网络有限公司 Picture color modulator approach, device, equipment and computer readable storage medium
CN109961500A (en) * 2019-03-27 2019-07-02 网易(杭州)网络有限公司 Rendering method, device, equipment and the readable storage medium storing program for executing of Subsurface Scattering effect
WO2022042003A1 (en) * 2020-08-31 2022-03-03 华为技术有限公司 Three-dimensional coloring method and apparatus, and computing device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1967568A (en) * 2006-11-20 2007-05-23 山东大学 A new threshold segmentation method of color invariance of colored image
CN101354794A (en) * 2008-09-10 2009-01-28 汕头超声仪器研究所 Light irradiation analogy method of real time three-dimensional image based on pattern processor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1967568A (en) * 2006-11-20 2007-05-23 山东大学 A new threshold segmentation method of color invariance of colored image
CN101354794A (en) * 2008-09-10 2009-01-28 汕头超声仪器研究所 Light irradiation analogy method of real time three-dimensional image based on pattern processor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杨爽: "真实感图形技术中光照模型的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
林楠,俞勇: "使用体渲染进行的快速全局照明", 《计算机辅助设计与图形学学报》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991717A (en) * 2017-03-16 2017-07-28 珠海市魅族科技有限公司 A kind of image processing method being applied under three-dimensional scenic and system
CN106991717B (en) * 2017-03-16 2020-12-18 珠海市魅族科技有限公司 Image processing method and system applied to three-dimensional scene
CN108986200A (en) * 2018-07-13 2018-12-11 北京中清龙图网络技术有限公司 The preprocess method and system of figure rendering
CN109901905A (en) * 2019-02-28 2019-06-18 网易(杭州)网络有限公司 Picture color modulator approach, device, equipment and computer readable storage medium
CN109961500A (en) * 2019-03-27 2019-07-02 网易(杭州)网络有限公司 Rendering method, device, equipment and the readable storage medium storing program for executing of Subsurface Scattering effect
WO2022042003A1 (en) * 2020-08-31 2022-03-03 华为技术有限公司 Three-dimensional coloring method and apparatus, and computing device and storage medium

Also Published As

Publication number Publication date
CN103035027B (en) 2016-08-03

Similar Documents

Publication Publication Date Title
CN112316420B (en) Model rendering method, device, equipment and storage medium
CN103035027A (en) Illumination rendering method for fixed light source
CN100478994C (en) High dynamic range material color applying drawing method
CN101882323B (en) Microstructure surface global illumination real-time rendering method based on height map
US20080278491A1 (en) System and method for rendering computer graphics utilizing a shadow illuminator
CN102254340A (en) Method and system for drawing ambient occlusion images based on GPU (graphic processing unit) acceleration
TWI552113B (en) System, method, and computer program product for tiled deferred shading
CN103198513B (en) Film later stage synthesis antialiasing method
CN105261059A (en) Rendering method based on indirect reflection highlight calculation in screen space
KR101619875B1 (en) System for rendering realistic facial expressions of three dimension character using general purpose graphic processing unit and method for processing thereof
CN105122310A (en) Intra-frame timestamps for tile-based rendering
CN110033509B (en) Method for constructing three-dimensional face normal based on diffuse reflection gradient polarized light
US10497150B2 (en) Graphics processing fragment shading by plural processing passes
CN103679802A (en) Method for drawing surface of SPH (smoothed particle hydrodynamics) fluid in real time on basis of screen spaces
CN112819941A (en) Method, device, equipment and computer-readable storage medium for rendering water surface
CN101840585A (en) Method for rendering three-dimensional object into two-dimensional image
CN103679818B (en) A kind of real-time scene method for drafting based on virtual surface light source
Cabeleira Combining rasterization and ray tracing techniques to approximate global illumination in real-time
US20180225865A1 (en) Method and apparatus for real-time rendering of images of specular surfaces
Ferraz et al. Benchmarking vulkan vs opengl rendering on low-power edge gpus
CN114022599A (en) Real-time indirect gloss reflection rendering method for linearly changing spherical distribution
Zhu et al. A novel radiometric projector compensation algorithm based on Lambertian reflection model
Chen et al. Configurable pixel shader workload reduction technique for mobile GPUs
Zhang et al. The Study and Implementation of Phong Shading Algorithm Parallelization
CN116563448A (en) Skin rendering method and device on mobile platform

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Zhabei District 200072 Shanghai 777 Canton Road No. 12 lane two building A-27 room

Patentee after: SHANGHAI CREATOO NETWORK TECHNOLOGY CO.,LTD.

Address before: Zhabei District 200072 Shanghai 777 Canton Road No. 12 lane two building A-27 room

Patentee before: Shanghai Chuangtu Network Technology Development Co.,Ltd.

CP01 Change in the name or title of a patent holder
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A lighting rendering method for fixed light sources

Effective date of registration: 20230321

Granted publication date: 20160803

Pledgee: Agricultural Bank of China Limited Shanghai Huangpu Sub branch

Pledgor: SHANGHAI CREATOO NETWORK TECHNOLOGY CO.,LTD.

Registration number: Y2023310000076

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Granted publication date: 20160803

Pledgee: Agricultural Bank of China Limited Shanghai Huangpu Sub branch

Pledgor: SHANGHAI CREATOO NETWORK TECHNOLOGY CO.,LTD.

Registration number: Y2023310000076

PC01 Cancellation of the registration of the contract for pledge of patent right