1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: vfmt examples/*.v

This commit is contained in:
Delyan Angelov
2021-02-23 19:43:44 +02:00
parent 0fa2f6d52c
commit 9e06af8bf9
18 changed files with 191 additions and 162 deletions

View File

@ -474,8 +474,11 @@ fn radiance(r Ray, depthi int, scene_id int) Vec {
mut tmp := Vec{}
if depth > 2 {
// Russian roulette
tmp = if rand_f64() < pp { radiance(refl_ray, depth, scene_id).mult_s(rp) } else { radiance(Ray{x, tdir},
depth, scene_id).mult_s(tp) }
tmp = if rand_f64() < pp {
radiance(refl_ray, depth, scene_id).mult_s(rp)
} else {
radiance(Ray{x, tdir}, depth, scene_id).mult_s(tp)
}
} else {
tmp = (radiance(refl_ray, depth, scene_id).mult_s(re)) +
(radiance(Ray{x, tdir}, depth, scene_id).mult_s(tr))