XaiJu
entagma
entagma

patreon


AHTYA10 - Pathtracing and Adaptive Sampling in Redshift 3D

Here comes the last video about Redshift in the AHTYA series.  This time we have a look at pathtracing. After some theory about primary and secondary rays, we dive into Redshift to setup the adaptive sampler. While Redshift can be set up easily by just increasing the number of primary rays, it's often beneficial to spend some time, tweaking the secondary ray settings. That leads to faster render times.

AHTYA10 - Pathtracing and Adaptive Sampling in Redshift 3D

Comments

Hi Manuel. Redshift is using a pathtracing algorithm as many other render engines like Octane, Cycles and Karma. It does not really compute passes. Instead it works like this. First a primary (eye) ray is shot into the scene from the camera origin through the center of the pixel that the render engine wants to compute the color for. This ray then is intersected against all the geo in the scene. If it hits something the closest hit is stored. This is your shading point. The geometric point ant which the shading has to be evaluated. Now the renderer looks up the material of the object found and executes it. Inside it finds a BSDF. This is a mathematical (statistical) model of the physical light/matter interaction that occurs in our world. This model is then evaluated and returns a color. This color is the color of the pixel. Now, if more complicated effects take place at the shading point (global illumination, reflectinon, shadow, refraction, etc) the renderer might need more info. Thus it shoots another ray from the shading point to the next surface that might influence the color of the pixel. And from there again, and again until it reaches the Background, light or it hits the ray depth threshold. The secondary samples determine how many additional rays are shot to gather the secondary effects. For DOF to get noise free these secondary rays do not contribute. It is only the eye rays. So yes, your are correct. If you up the eye rays you can reduce the secondary rays and still have the same amount of total rays. Hope this helps, thanx Manuel

Entagma

Hello Manu. Manu here too! First of all, great tutorial. I really appreciate the technical explanations on this series. Second, I'd like to apologize in advance because this is gonna be a really long comment ^_^' I have a few questions on sampling. I did some google and redshift docs research but I'm not sure if I really understood what I found. Please correct me if at any point if there's anything wrong. Here I go: 1) Renderers (or Redshift at least) compute the final image divided by shading parts (BSDFs I think), right? For instance, there's an image/component that is only specular reflections, another that's only refractions, another that's only diffuse reflections (a mix of direct lightning, GI and material diffuse color?), and so forth for every effect. Like render passes in linear space but with a greater color depth I guess, and at pixel level instead of the whole image. And then the engine adds every one of those pixel passes (or images, idk but it doesn't make a difference I think) one on top of the other in order to get the final pixel color (the beauty pass). That is, the final color for each pixel . Is this correct? So this leads me to... 2) This means that those min and max samples per pixel, always computed according to the threshold, are computed for every pixel of single one of those components, right? So samples from a light would never be computed in the same element than, lets say, reflection samples Here's an example with default sampling values (4 min samples and 16 max samples, with a thresh of 0.01) and assuming there are only 3 components that make the beauty pass. I have a cube and a sphere. Cube has a material with 32 samples on reflection, and sphere has a material with 64 samples on reflection. Pixel 1 is a pixel that shows the surface of the cube. For pixel 1 of my final image I have to compute pixel 1.diffuse, pixel 1.reflection and pixel 1.refraction separately and then add all of them together. That means that pixel 1.reflection will get 4 to 16 primary samples, always considering the threshold (but measured only within that reflection pass, not in the beauty pass), and (4 to 16)*32 secondary samples, because that's the samples value set for the material of the cube, right? Now, in the same rendering, there's Pixel 3, that shows the surface of the sphere, which has a material with 64 samples on reflection. So pixel 3.reflection would have 4 to 16 primary samples and (4 to 16)*64 secondary samples computed, right? 3) One last question regarding DOF and samples. Without DOF the image was clean, which means that the total amount of secondary rays was enough to clean noise from reflections, GI and any other secondary ray related effect, is that correct? Max primary samples were set to 32 at that point. So, when adding DOF and increasing max primary samples to 512 (which is 32*16), would it be technically accurate to reduce reflection, refraction, GI, etc... samples dividing by 16 whatever value they were set to? Thank you for reading this far. Please feel free to simply not answer if you don't feel like. I realize that this comment is way too long. Cheers

Manuel Stein

This was incredibly helpful

Johan Nilsson


More Creators