Skip to Main Content
WebGL Insights
book

WebGL Insights

by Patrick Cozzi
August 2015
Intermediate to advanced content levelIntermediate to advanced
416 pages
16h 58m
English
A K Peters/CRC Press
Content preview from WebGL Insights
266 17. Real-Time Volumetric Lighting for WebGL
Considering two points, P
0
and P
1
, any point on the edge (P
1
–P
0
) may be given using
the following parametric equation:
P(t) = P
0
+ t * (P
1
P
0
)
where t = [0,1].
We can solve this equation for (t), for a plane with normal (H) and distance (d) from
origin by plugging in the plane equation
H · P(t) + d = 0
and then solving for parameter (t), which gives
()
=
−−
0
10
t
dHP
PP
(17.2)
is parameter (t) gives the intersection point for one edge (P
1
–P
0
). We iterate over all
edges from the current vertex by using the edge table and obtain all intersection points.
ese points are then used to generate t
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL

James L. Williams

Publisher Resources

ISBN: 9781498716079