2

I need to output a high res image using render_highquality using plot_gg() of the rayshader/rayrender package. However, I always seem to get a strange grey noise filter over my image, how can I prevent this from happening? (this does not happen if I just use render_snapshot()

So this works (from the package examples):

library(rayshader)
library(rayrender)

volcano %>%
  sphere_shade() %>%
  plot_3d(volcano,zscale = 2)
render_snapshot(clear = TRUE,filename="p1_snap.png")

enter image description here

But this yields an unexpected result.

volcano %>%
  sphere_shade() %>%
  plot_3d(volcano,zscale = 2)
render_highquality(clear = TRUE, filename="p1_hq.png")

enter image description here

I just want the background to be white

Phil
  • 7,287
  • 3
  • 36
  • 66
L Smeets
  • 888
  • 4
  • 17
  • I don't know about this package but try playing around with the lighting parameters in the `render_highquality` function. For example, adding `lightsize = 50` as a parameter allowed me to get rid mostly of the dim/grey background that you see in the second picture. – jav Jan 03 '21 at 21:32
  • 1
    As it seems to me, `render_highquality` implements a _path-tracing_ renderer, which chooses the placement, direction, and scatter of rays pseudorandomly. In exchange, the rendering will take into account shadows, light occlusion, and global illumination very accurately. With a finite sample size, though, the image generated by any such renderer will inevitably have noise. And to reduce that noise, either a larger sample size or a specially-designed _denoiser_ is needed. – Peter O. Jan 03 '21 at 22:28
  • See also: https://stackoverflow.com/questions/43449353/why-is-my-monte-carlo-raytracing-so-noisy – Peter O. Jan 04 '21 at 03:39
  • Thank you both. This does unfortunately does not really solve my problem, but I will try rerunning with a lot more samples. – L Smeets Jan 06 '21 at 12:58
  • @LSmeets Did you ever manage to figure this out? I am searching now for a solution... – starski Apr 06 '23 at 19:22

0 Answers0