CN110176055B - Self-adaptive method for simulating real-time global illumination in 3D virtual engine - Google Patents

Self-adaptive method for simulating real-time global illumination in 3D virtual engine Download PDF

Info

Publication number
CN110176055B
CN110176055B CN201910453097.4A CN201910453097A CN110176055B CN 110176055 B CN110176055 B CN 110176055B CN 201910453097 A CN201910453097 A CN 201910453097A CN 110176055 B CN110176055 B CN 110176055B
Authority
CN
China
Prior art keywords
light source
point light
global illumination
point
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910453097.4A
Other languages
Chinese (zh)
Other versions
CN110176055A (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.)
Chongqing University
Original Assignee
Chongqing University
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 Chongqing University filed Critical Chongqing University
Priority to CN201910453097.4A priority Critical patent/CN110176055B/en
Publication of CN110176055A publication Critical patent/CN110176055A/en
Application granted granted Critical
Publication of CN110176055B publication Critical patent/CN110176055B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Abstract

The invention relates to a self-adaptive method for simulating real-time global illumination in a 3D virtual engine, and belongs to the technical field of simulation. An adaptive method for simulating real-time global illumination in a 3D virtual engine, the method comprising the steps of: s1: simulating real-time global illumination of a point light source; s2: simulating real-time global illumination of a light gathering source; s3: global illumination is adaptively simulated. On the basis of ensuring the authenticity of a 3D virtual scene, the invention obviously reduces the performance overhead of virtual simulation software for increasing the real-time global illumination function, and can adaptively adjust the simulation effect according to different operation environments.

Description

Self-adaptive method for simulating real-time global illumination in 3D virtual engine
Technical Field
The invention belongs to the technical field of simulation, and relates to a self-adaptive method for simulating real-time global illumination in a 3D virtual engine.
Background
Most 3D virtual engine platforms provide a function of calculating real-time illumination for developed virtual simulation software, but the function consumes huge calculation amount, and in an environment with low computing power, such as Web-based virtual simulation software, software is jammed or even cannot run due to calculation of real-time illumination. However, real-time illumination of the light source is not calculated in the virtual simulation software, so that the 3D virtual scene lacks reality.
Disclosure of Invention
In view of the above, the present invention aims to provide an adaptive method for simulating real-time global illumination in a 3D virtual engine.
In order to achieve the purpose, the invention provides the following technical scheme:
an adaptive method for simulating real-time global illumination in a 3D virtual engine, the method comprising the steps of:
s1: simulating real-time global illumination of a point light source;
s2: simulating real-time global illumination of a light-gathering source;
s3: global illumination is adaptively simulated.
Further, the step S1 specifically includes:
the Blinn-phong illumination model was modified according to lambert's law:
Cspecular=(Clight·Mspcular)max(0,n·l);
wherein Cspcalr is the intensity of the reflected light; clight is the light intensity of a light source; mspericular is the material reflection coefficient; the vector n is a unit vector in the normal direction; vector l is the unit vector of the inverted ray;
respectively leading out a ray in the six directions of up, down, left, right, front and back, detecting collision, obtaining the position of a collision point when the ray detects a contact object, generating a point light source at the position of the collision point, and obtaining the illumination intensity of the point light source according to a formula; obtaining the direction of the reflected ray according to the unit vector of the ray and the unit vector of the normal direction, leading out a reflected ray from the direction, and generating a point light source again; the point light source generating operation is performed three times in total, and six point light sources are generated each time.
Further, the step S2 specifically includes:
according to the angle of the light-gathering source, a ray is led out from the center of the light emitted by the light-gathering source, the generation of point light source operation is sequentially executed three times according to the method in the step S1 to simulate global illumination, but only one point light source is generated in each step of operation.
Further, the step S3 specifically includes:
according to the method for simulating the global illumination by the point light source and the light-gathering source in the steps S1 and S2, the operation of generating the point light source is carried out for three times to simulate the global illumination every time one light source is added in the scene;
defining a set PointLight to store all added point light sources, and defining three sets, namely FirstPointLight, seconddPointLight and ThirdPointLight respectively, which are used for storing six point light sources generated by each step of operation when the point light sources are added; defining a set SpotLight to store all added SpotLight sources; three sets are defined, namely, firstSpotLight, secondSpotLight and third spotlight, respectively, which are respectively used for storing one point light source generated in each operation when the poly light source is added.
The invention has the beneficial effects that: on the basis of ensuring the authenticity of the 3D virtual scene, the invention obviously reduces the performance overhead of virtual simulation software for increasing the real-time global illumination function, and can adaptively adjust the simulation effect according to different operation environments.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Drawings
For the purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made to the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a schematic diagram of real-time global illumination of a simulated point source;
FIG. 2 is a schematic diagram of real-time global illumination of a simulated spotlight source;
fig. 3 is a flow chart of a method for adaptively simulating global illumination.
Detailed Description
The following embodiments of the present invention are provided by way of specific examples, and other advantages and effects of the present invention will be readily apparent to those skilled in the art from the disclosure herein. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention in a schematic way, and the features in the following embodiments and examples may be combined with each other without conflict.
Wherein the showings are for the purpose of illustrating the invention only and not for the purpose of limiting the same, and in which there is shown by way of illustration only and not in the drawings in which there is no intention to limit the invention thereto; to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "front", "rear", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not an indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes, and are not to be construed as limiting the present invention, and the specific meaning of the terms may be understood by those skilled in the art according to specific situations.
Referring to fig. 1 to 3, an adaptive method for simulating real-time global illumination in a 3D virtual engine is disclosed.
1. Real-time global illumination of simulated point light sources
The Blinn-phong illumination model was modified according to lambert's law (the intensity of the reflected light is proportional to the cosine of the angle between the surface normal and the light source direction): cspecular = (sight · Mspcular) max (0,n · l).
(Cspcalalr: intensity of illumination after reflection;
clight: illumination intensity of light source
Mspecular: material reflection coefficient
And a vector n: unit vector of normal direction
Vector l: unit vector of the inverted ray)
And respectively leading out a ray in six directions of upper, lower, left, right, front and back, detecting collision, acquiring the position of a collision point when the ray detects a contact object, generating a point light source at the position of the collision point, and obtaining the illumination intensity of the point light source according to the formula in the text. The reflected ray direction is obtained from the unit vector of the ray and the unit vector of the normal direction, a reflected ray is led out from the direction, and the point light source is generated again according to the method. The operation of generating point light sources is performed three times in total, and six point light sources are generated each time.
2. Real-time global illumination of simulated spotlight sources
According to the angle of the light-gathering source, a ray is led out from the center of the light emitted by the light-gathering source, the generation of the point light source operation is sequentially executed three times according to the method to simulate global illumination, but only one point light source is generated in each step of operation.
3. Adaptive simulation global illumination method flow
According to the method for simulating the global illumination by the point light source and the light-gathering source, the operation of generating the point light source is carried out for three times when one light source is added in a scene so as to simulate the global illumination.
Defining a set PointLight to store all added point light sources, and defining three sets, namely FirstPoint light, seconddPointLight and ThirdPointLight respectively, which are used for storing six point light sources generated by each step of operation when adding the point light sources. A set SpotLight is defined to store all the added SpotLight sources. Three sets are defined, namely, firstSpotLight, secondSpotLight and third spotlight, which are respectively used for storing one point light source generated in each operation when the poly light source is added.
Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered by the claims of the present invention.

Claims (1)

1. An adaptive method for simulating real-time global illumination in a 3D virtual engine, characterized by: the method comprises the following steps:
s1: simulating real-time global illumination of a point light source;
s2: simulating real-time global illumination of a light gathering source;
s3: adaptively simulating global illumination;
the step S1 specifically comprises the following steps:
the Blinn-phong illumination model was modified according to lambert's law:
Cspecular=(Clight ▪Mspcular)max(0,n·l);
wherein Cspcalr is the intensity of the reflected light; clight is the light intensity of the light source; mspecular is a material reflection coefficient; the vector n is a unit vector in the normal direction; vector l is the unit vector of the inverted ray;
respectively leading out a ray in six directions of up, down, left, right, front and back, detecting collision, acquiring the position of a collision point when the ray detects a contact object, generating a point light source at the position of the collision point, and obtaining the illumination intensity of the point light source according to a formula; obtaining the direction of the reflected ray according to the unit vector of the ray and the unit vector of the normal direction, leading out a reflected ray from the direction, and generating a point light source again; generating point light source operation is executed three times in total, and six point light sources are generated each time;
the step S2 specifically includes:
according to the angle of the light-gathering source, a ray is led out from the light-emitting center position of the light-gathering source, the generation of a point light source operation is sequentially executed three times according to the method in the step S1 to simulate global illumination, but only one point light source is generated in each step of operation;
the step S3 specifically comprises the following steps:
according to the method for simulating the global illumination by the point light source and the light-gathering source in the steps S1 and S2, the operation of generating the point light source is carried out for three times when one light source is added in the scene so as to simulate the global illumination;
defining a set PointLight to store all added point light sources, and defining three sets, namely FirstPoint light, seconddPointLight and ThirdPointLight respectively, which are used for storing six point light sources generated by each step of operation when adding the point light sources; defining a set SpotLight to store all added SpotLight sources; defining three sets, namely FirstSpotLight, seconddSpotLight and ThirdSpotLight respectively, which are used for storing a point light source generated by each operation when a poly light source is added;
s3 specifically comprises the following steps:
s31: adding a light source in the scene;
s32: storing the light source into a corresponding set, and setting the length of a PointLight set as n and the length of a SpotLight set as m;
s33: judging whether the length of the set ThirdPointLight is equal to 6n or not and whether the length of the set ThirdSpotLight is equal to m or not;
s331: if yes, three times of point light source generating operation is executed, the point light sources generated each time are respectively stored in the corresponding three sets, and the operation enters S34;
s332: if not, judging whether the length of the set SecondPointLight is equal to 6n or not and whether the length of the set SecondSpotLight is equal to m or not;
s3321: if yes, executing two point light source generating operations, respectively storing the point light sources generated each time into the corresponding two sets, and entering S34;
s3322: if not, executing one point light source generating operation, respectively storing the generated point light sources into corresponding sets, and entering S34;
s34: judging whether the frequency value is greater than 60;
s341: if so, sequentially checking the lengths of six sets, namely, firstPoint light, firstSpotlight, seconddPointlight, seconddSpotlight, thirdPointlight and ThirdSpotlight, and according to the type of the light source corresponding to the set, when the length x of one set is less than 6n or m, performing a point light source generating operation on the light source stored from x or x/6 in the Pointlight or Spotlight set once, only generating the point light source corresponding to the set and storing the point light source in the set until the frequency value is less than 60 or all the set lengths are equal to 6n or m;
s342: if not, judging whether the frequency value is greater than 30;
s3421: if so, sequentially checking the lengths of the six sets, namely, firstPoint light, firstSpotlight, seconddPointlight, seconddSpotlight, thirdPointlight and ThirdSpotlight, and deleting 6 or 1 point light sources sequentially from the tail end of the set when the length of one set is greater than 0 according to the type of the light source corresponding to the set until the frequency value is greater than 30 or all the sets are empty;
s3422: if not, the process is ended.
CN201910453097.4A 2019-05-28 2019-05-28 Self-adaptive method for simulating real-time global illumination in 3D virtual engine Active CN110176055B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910453097.4A CN110176055B (en) 2019-05-28 2019-05-28 Self-adaptive method for simulating real-time global illumination in 3D virtual engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910453097.4A CN110176055B (en) 2019-05-28 2019-05-28 Self-adaptive method for simulating real-time global illumination in 3D virtual engine

Publications (2)

Publication Number Publication Date
CN110176055A CN110176055A (en) 2019-08-27
CN110176055B true CN110176055B (en) 2023-04-18

Family

ID=67695784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910453097.4A Active CN110176055B (en) 2019-05-28 2019-05-28 Self-adaptive method for simulating real-time global illumination in 3D virtual engine

Country Status (1)

Country Link
CN (1) CN110176055B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2057605A2 (en) * 2006-07-24 2009-05-13 Michael Bunnell System and methods for real-time rendering of deformable geometry with global illumination
CN106157264A (en) * 2016-06-30 2016-11-23 北京大学 Large area image uneven illumination bearing calibration based on empirical mode decomposition
CN112116693A (en) * 2020-08-20 2020-12-22 中山大学 Biomolecule visualization ray tracing rendering method based on CPU

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0459761A3 (en) * 1990-05-31 1993-07-14 Hewlett-Packard Company Three dimensional computer graphics employing ray tracking to compute form factors in radiosity
US20090102843A1 (en) * 2007-10-17 2009-04-23 Microsoft Corporation Image-based proxy accumulation for realtime soft global illumination
KR101475779B1 (en) * 2008-06-02 2014-12-23 삼성전자주식회사 Method for 3D Image Processing
US8811767B2 (en) * 2011-03-15 2014-08-19 Mitsubishi Electric Research Laboratories, Inc. Structured light for 3D shape reconstruction subject to global illumination
CN102346918B (en) * 2011-09-30 2013-08-21 长春理工大学 Method for drawing three-dimensional animation scene only containing object change
CN102819860B (en) * 2012-08-16 2015-03-11 北京航空航天大学 Real-time global illumination method for sub-surface scattering object on the basis of radiosity
JP6729571B2 (en) * 2015-06-12 2020-07-22 ソニー株式会社 Information processing apparatus, information processing method, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2057605A2 (en) * 2006-07-24 2009-05-13 Michael Bunnell System and methods for real-time rendering of deformable geometry with global illumination
CN106157264A (en) * 2016-06-30 2016-11-23 北京大学 Large area image uneven illumination bearing calibration based on empirical mode decomposition
CN112116693A (en) * 2020-08-20 2020-12-22 中山大学 Biomolecule visualization ray tracing rendering method based on CPU

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
William A. Stokes等.Perceptual illumination components: a new approach to efficient, high quality global illumination rendering.acm transactions on graphics.2004,23(3),742–749. *
Xinrun Chen等.A virtual reality experiment system for an introductory computer hardware course.Computer Applications in Engineering Education.2021,第29卷(第6期),1437-1949. *
吴文珍 ; 李全忠 ; 王海峰 ; 田媛媛 ; .油田虚拟现实系统中的光照模型算法研究及应用.长江大学学报(自然科学版)理工卷.2008,5(第01期),195-197. *
李杨 ; 周果 ; 李淳 ; 邱显杰 ; 王兆其 ; .基于三角形自适应细分的有效光照烘焙方法.计算机学报.2013,36(第12期),2499-2511. *
袁璐 ; .基于立即辐射度的实时全局光照算法.现代计算机(专业版).2018,(第02期),63-66. *

Also Published As

Publication number Publication date
CN110176055A (en) 2019-08-27

Similar Documents

Publication Publication Date Title
Krivanek et al. Practical global illumination with irradiance caching
CN102243770B (en) Method for quickly drawing realistic rendering of naval battlefield based on OSG
EP2076888B1 (en) Pixel color determination in a ray tracing image processing system
US6690372B2 (en) System, method and article of manufacture for shadow mapping
US8139780B2 (en) Using ray tracing for real time audio synthesis
US11494970B2 (en) Importance sampling for determining a light map
US8018453B2 (en) Deferred acceleration data structure optimization for improved performance
KR101572618B1 (en) Apparatus and method for simulating lidar
CN111583371B (en) Neural network-based participatory medium multiple scattering drawing method and system
US7589725B2 (en) Soft shadows in dynamic scenes
JP5695746B2 (en) Mipmap level selection method and texture mapping system using the same
CN110543013B (en) Simplified construction method of optical system for regulating and controlling light distribution free-form surface
CN111027407B (en) Color image hand posture estimation method for shielding situation
CN112446943A (en) Image rendering method and device and computer readable storage medium
CN102074041B (en) Method for drawing planar caustic effect of 3D virtual scene produced by specular reflection
CN110176055B (en) Self-adaptive method for simulating real-time global illumination in 3D virtual engine
CN105335996A (en) Light irradiation effect calculation method and device
CN106096321B (en) In conjunction with the indoor and outdoor sound transmission analogy method of Ray-Tracing Method and acoustic beam tracing
Zhang et al. Close the optical sensing domain gap by physics-grounded active stereo sensor simulation
US20150161816A1 (en) Simulating Sub-Surface Scattering of Illumination for Simulated Three-Dimensional Objects
CN111773685A (en) Method and device for dynamically generating game role visual field
JP7131090B2 (en) Image generation device, image generation method, and image generation program
CN114882168B (en) Digital twinning method and device of touch sensor based on vision
CN115115747A (en) Illumination rendering method and device, electronic equipment and storage medium
CN112204622A (en) Rendering device, learning device, rendering method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant