mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: reduce progress update rate for path_tracing.v (less string interpolations/mallocs)
This commit is contained in:
@ -532,8 +532,10 @@ fn ray_trace(w int, h int, samps int, file_name string, scene_id int) Image {
|
|||||||
|
|
||||||
// OpenMP injection point! #pragma omp parallel for schedule(dynamic, 1) shared(c)
|
// OpenMP injection point! #pragma omp parallel for schedule(dynamic, 1) shared(c)
|
||||||
for y := 0; y < h; y++ {
|
for y := 0; y < h; y++ {
|
||||||
term.cursor_up(1)
|
if y & 7 == 0 || y + 1 == h {
|
||||||
eprintln('Rendering (${samps * 4} spp) ${(100.0 * f64(y)) / (f64(h) - 1.0):5.2f}%')
|
term.cursor_up(1)
|
||||||
|
eprintln('Rendering (${samps * 4} spp) ${(100.0 * f64(y)) / (f64(h) - 1.0):5.2f}%')
|
||||||
|
}
|
||||||
for x in 0 .. w {
|
for x in 0 .. w {
|
||||||
i := (h - y - 1) * w + x
|
i := (h - y - 1) * w + x
|
||||||
mut ivec := unsafe { &image.data[i] }
|
mut ivec := unsafe { &image.data[i] }
|
||||||
|
Reference in New Issue
Block a user