Implementing Instant Radiosity: Enhancing VPL Radiance and Image Accumulation

P
A
3
 
 
S
p
e
c
i
f
i
c
a
t
i
o
n
Goal
Finish basic implementation of instant radiosity
Learn how to transport light in VPL
Objective
From PA2, implement following features
Apply weight to irradiance of each VPL
Accumulate images from each VPL
Apply shadow
Send a screenshot of your final image
P
r
e
r
e
q
u
i
s
i
t
e
Is there any problem in compiling PA2?
Any questions on PA2 skeleton code?
P
A
3
 
 
T
a
s
k
 
1
:
 
A
p
p
l
y
 
W
e
i
g
h
t
VPLs are generated, but their radiance is
not weighted in skeleton code
P
A
3
 
 
T
a
s
k
 
1
:
 
A
p
p
l
y
 
W
e
i
g
h
t
VPLs are generated, but their radiance is
not weighted in skeleton code
P
A
3
 
 
T
a
s
k
 
1
:
 
A
p
p
l
y
 
W
e
i
g
h
t
VPLs are generated, but their radiance is
not weighted in skeleton code
If N samples are sampled from light
sources, we need to divide image by N
Defined as 
kVplCount
 in main.h
P
A
3
 
 
T
a
s
k
 
1
:
 
A
p
p
l
y
 
W
e
i
g
h
t
Implementation
Change 
u_numLights
 from 
1
 to 
kVplCount
To reduce “popping” artifact, we clamp pixel
contribution for each VPL images
On generating VPL, divide irradiance by N
Hint: On recursive VPL tracing, manipulating
initial VPL intensity applies to every derived
VPLs as well
P
A
3
 
 
T
a
s
k
 
2
:
 
A
c
c
u
m
u
l
a
t
e
Currently PA2 only shows individual VPL
image
Change it to accumulate all VPL images
P
A
3
 
 
T
a
s
k
 
2
:
 
A
c
c
u
m
u
l
a
t
e
Accumulate VPL images one-by-one
Draw each VPL image on a framebuffer
(e.g., 
kGlsFramebufferSceneDraw
)
Accumulate them into another framebuffer
(e.g., 
kGlsFramebufferAccumulate
)
Show final accumulated image into screen
P
A
3
 
 
T
a
s
k
 
2
:
 
A
c
c
u
m
u
l
a
t
e
Pseudocode
Hint
Using 
glBlendFunc(GL_ONE, GL_ONE)
 causes
drawing image additively (= accumulation!)
into current framebuffer
for (vpl in VPLs) {
 
kGlsFramebufferSceneDraw = draw image from vpl;
 
kGlsFramebufferAccumulate += kGlsFramebufferSceneDraw;
}
kGlsFramebufferScreen = kGlsFramebufferAccumulate;
P
A
3
 
 
T
a
s
k
 
2
:
 
A
c
c
u
m
u
l
a
t
e
After task 2:
P
A
3
 
 
T
a
s
k
 
3
:
 
G
e
n
e
r
a
t
e
 
S
h
a
d
o
w
P
A
3
 
 
T
a
s
k
 
3
:
 
G
e
n
e
r
a
t
e
 
S
h
a
d
o
w
Generate shadow map from each VPL
Hint: already implemented in
perlight_generate_shadow_map()
, just call it!
Generated shadow map is stored in
kGlsCubemapFramebufferShadow
Pass it into shader that draws VPL image
Related uniform is 
u_shadowTex
P
A
3
 
 
T
a
s
k
 
3
:
 
G
e
n
e
r
a
t
e
 
S
h
a
d
o
w
P
A
3
 
 
T
a
s
k
 
3
:
 
G
e
n
e
r
a
t
e
 
S
h
a
d
o
w
The fully functional program should look
somewhat like this:
P
A
3
 
 
S
u
b
m
i
s
s
i
o
n
Submit to the following mail
cs482.fall.2015@gmail.com
Title should start with [PA2] <ID> <Name>
E.g., [PA3] 20151234 Hong GilDong
Your submission should include following:
A screenshot
 of your final image
Your code
, zipped
*You should attach the modified source code,
  
except
 CMake-generated build directory!
Submit them directly in the mail content
P
A
3
 
 
Q
u
e
s
t
i
o
n
s
?
Have a question?
Post it on a Noah board
http://noah.kaist.ac.kr/course/CS482
Good Luck!
P
A
3
 
 
U
s
e
f
u
l
 
L
i
n
k
s
Instant Radiosity Course slides
http://www.cs.cornell.edu/courses/cs6630/20
12sp/slides/Boyadzhiev-Matzen-
InstantRadiosity.pdf
Shaderific – GLSL functions
http://www.shaderific.com/glsl-functions/
Modern OpenGL tutorial
https://open.gl/
Slide Note
Embed
Share

Enhance the radiance of Virtual Point Lights (VPLs) by applying weights and implementing shadow effects. Accumulate images from VPLs to produce a final rendered image, overcoming artifacts and enhancing realism in light transport simulation.

  • Instant Radiosity
  • Virtual Point Lights
  • Radiance Weighting
  • Image Accumulation
  • Shadow Effects

Uploaded on Feb 28, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. PA3 Specification Goal Finish basic implementation of instant radiosity Learn how to transport light in VPL Objective From PA2, implement following features Apply weight to irradiance of each VPL Accumulate images from each VPL Apply shadow Send a screenshot of your final image 1

  2. Prerequisite Is there any problem in compiling PA2? Any questions on PA2 skeleton code? 2

  3. PA3 Task 1: Apply Weight VPLs are generated, but their radiance is not weighted in skeleton code ???,?? = ? ?,??,?????,????????? ? ? ? ?,??,?????,?????? ?(??) ? ?=1 3

  4. PA3 Task 1: Apply Weight VPLs are generated, but their radiance is not weighted in skeleton code ???,?? = ? ?,??,?????,????????? ? ? ? ?,??,?????,?????? ?(??) ? ?=1 4

  5. PA3 Task 1: Apply Weight VPLs are generated, but their radiance is not weighted in skeleton code ???,?? = ? ?,??,?????,????????? ? ? ? ?,??,?????,?????? ?(??) ? ?=1 If N samples are sampled from light sources, we need to divide image by N Defined as kVplCount in main.h 5

  6. PA3 Task 1: Apply Weight Implementation Change u_numLights from 1 to kVplCount To reduce popping artifact, we clamp pixel contribution for each VPL images On generating VPL, divide irradiance by N Hint: On recursive VPL tracing, manipulating initial VPL intensity applies to every derived VPLs as well 6

  7. PA3 Task 2: Accumulate Currently PA2 only shows individual VPL image Change it to accumulate all VPL images 7

  8. PA3 Task 2: Accumulate Accumulate VPL images one-by-one Draw each VPL image on a framebuffer (e.g., kGlsFramebufferSceneDraw) Accumulate them into another framebuffer (e.g., kGlsFramebufferAccumulate) Show final accumulated image into screen 8

  9. PA3 Task 2: Accumulate Pseudocode for (vpl in VPLs) { kGlsFramebufferSceneDraw = draw image from vpl; kGlsFramebufferAccumulate += kGlsFramebufferSceneDraw; } kGlsFramebufferScreen = kGlsFramebufferAccumulate; Hint Using glBlendFunc(GL_ONE, GL_ONE) causes drawing image additively (= accumulation!) into current framebuffer 9

  10. PA3 Task 2: Accumulate After task 2: 10

  11. PA3 Task 3: Generate Shadow Currently, no shadow is shown in the image The visibility term ? ?,? is not considered in drawing images Let s do that! 1) Generate shadow map from each VPL 2) On drawing VPL image, use shadow map to evaluate whether ? ?,? is 0 or 1 11

  12. PA3 Task 3: Generate Shadow Generate shadow map from each VPL Hint: already implemented in perlight_generate_shadow_map(), just call it! Generated shadow map is stored in kGlsCubemapFramebufferShadow Pass it into shader that draws VPL image Related uniform is u_shadowTex 12

  13. PA3 Task 3: Generate Shadow Evaluate ? ?,? in the shader Obtain shadow map value via texture( u_shadowTex, -shadowCubeDir.xyz ).r Compare it with fragment-to-VPL distance Is VPL closer to occluder than to our eye? Once ? ?,? is decided, multiply it into pixel value Refer to following link about shadow mapping: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/ http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/ 13

  14. PA3 Task 3: Generate Shadow The fully functional program should look somewhat like this: 14

  15. PA3 Submission Submit to the following mail cs482.fall.2015@gmail.com Title should start with [PA2] <ID> <Name> E.g., [PA3] 20151234 Hong GilDong Your submission should include following: A screenshot of your final image Your code, zipped *You should attach the modified source code, except CMake-generated build directory! Submit them directly in the mail content 15

  16. PA3 Questions? Have a question? Post it on a Noah board http://noah.kaist.ac.kr/course/CS482 Good Luck! 16

  17. PA3 Useful Links Instant Radiosity Course slides http://www.cs.cornell.edu/courses/cs6630/20 12sp/slides/Boyadzhiev-Matzen- InstantRadiosity.pdf Shaderific GLSL functions http://www.shaderific.com/glsl-functions/ Modern OpenGL tutorial https://open.gl/ 17

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#