Computer graphics in Game development - Fall 2023
Computer graphics in Game development - Fall 2023
Lo(X,ωo)=Le(X,ωo)+∫SLi(X,ωi)fX,n(ωi,ωo)∣ωi⋅n∣dωi
where X is a position on the object or surface,
ωo is a direction toward the eye or camera,
Lo(X,ωo) is all outgoing light from the position,
Le(X,ωo) is emitted light [1]
Lo(X,ωo)=Le(X,ωo)+∫SLi(X,ωi)fX,n(ωi,ωo)∣ωi⋅n∣dωi
where n is normal to surface at X position,
S is a unit hemisphere among n with center in X,
Li(X,ωi) is a light coming from ωi direction,
fX,n(ωi,ωo) is the bidirectional reflectance distribution function (BRDF) [1]
L(P)=Ka+lights∑[KdN⋅L+Ks(V⋅R)Ns]
where R=2(N⋅L)N−L [3]
Ld=kdImax(0,n⋅l)
where Ld - diffusely reflected light,
kd - material’s diffuse coefficient,
n - surface normal,
l - direction toward the light [4]
Principles: create an image in the most effective way, immersive experience principle
Laws: rendering quation, Lambertian shading law
Variables: diffuse color, light color, num of lights
lights
array of ray_tracing_renderer
closest_hit_shader
of raytracer
to implement Lambertian shading modelTODO: Lab: 2.03 Lambertian shading
Collect images before and after the experiment
Before adding the light source to the final point on the point X, we should cast a ray from the point X towards the light source. If any object occludes the shadow ray, the point X is on shadow and the light should not be added the light source
Principles: create an image in the most effective way, immersive experience principle
Laws: rendering quation, Lambertian shading law
Variables: num of rays, num of triangles
trace_ray
method of raytracer
to use any_hit_shader
shadow_raytracer
in ray_tracing_renderer
any_hit_shader
and miss_shader
for shadow_raytracer
closest_hit_shader
of raytracer
to cast shadows rays and to ignore occluded lightsTODO: Lab: 2.04 Shadow rays
1. Kajiya J.T. The rendering equation // SIGGRAPH Comput. Graph. New York, NY, USA: Association for Computing Machinery, 1986. Vol. 20, № 4. P. 143–150.
2. Fernando R. GPU gems: Programming techniques, tips and tricks for real-time graphics. Pearson Higher Education, 2004.
3. Phong B.T. Illumination for computer generated pictures // Commun. ACM. New York, NY, USA: Association for Computing Machinery, 1975. Vol. 18, № 6. P. 311–317.
4. McGuire M. The graphics codex. 2.14 ed. Casual Effects, 2018.