IRay: Grainy pictures

For those who use IRay, or any global illumination rendering engine, grainy renders (or noisy, same thing) are always a nuisance to the quality of your final product.
It's imperative to understand what causes it. I'm no expert in the matter but I've read a few books and forums about it and here's what I understand:
The computer (GPU in the case of IRay) makes its calculations by shooting a ray, per pixel, from the camera, into the scene. That ray will cross the scene and if it hits a geometry (an object) it will calculate it's colour based on the geometry's texture, and the light's parameters (intensity, angle and colour) that hit the geometry at that point.
For each pixel in the picture, a calculation has to be done. That means your picture resolution will dictate, at the start, how many pixels (meaning rays) should be shot from the camera. The more pixels, the more calculations it will do, enhancing the rendering times.
That said, if a geometry has a simple texture, and it's hit by a bright light, the calculations will be simple.
But most scenes aren't, because:
1/ there are many geometries involved in a simple game scene (a character, her hair, her clothes, the bed, the walls, the ceiling, the floor);
2/ each geometry usually has several different textures;
3/ the geometries, and their textures, will influence each other;
4/ realistic lighting means realistic shadows
Global Illumination algorythms will try to calculate how light (and shadows) interact like in real life. There's one thing called colour bleeding that happens when an object colour reflects on another nearby object. If you're standing next to a red painted wall you'll notice that the part of your body that faces the wall will have some red hint. The light will bounce on the wall, and the wall will absorb every colour but red (simple physics folks) and will act as if it was projecting red light. That's colour bleeding. That happens all around you every second, and Global Illumination mimics it. That means more computation.
Now, back to the rays.
If the scene is simple the calculations won't be hard to do. The render time will be quick.
But if a scene is not strongly illuminated, like a simple room inside a house, where the only light source is a window (perhaps like the room you're in right now) the calculations will be much harder.
In shadowed scenes, like corners, behind a furniture, the GPU will have to calculate many many things, like the wall geometry, its texture, every colour bleeding coming from every geometry in the room (even that jar at the other side of the room that is not in the camera shot) and because there isn't much light striking that place the GPU won't be sure about the exact colour to define that pixel. The GPU tries randomly to guess that colour and since it's a guess shot the pixel next to it won't be the exact same colour. That's why you get grains (or noise). Because the GPU puts some pixels there that are a bit more green and red or yellow or blue, and results in nonconformity.
The only solution is to allow the GPU more time to calculate. Basically you tell the computer to repeat each ray. That is called an Iteration.
DAZ Studio STANDARD iteration number is 5000. That means that each ray (pixel) is recalculated 4999 times.
If the scene is simple, the picture gets neat after less that that. The GPU gets to a point where his guesses all come to the same result value. You try 300 times and get the same colour. Certainly it's that colour. and the render ends. That's what happen in simple renders, who render for a few seconds to a few minutes.
But for complex scenes, or poorly lit scenes 5000 might not be enough. Perhaps 10000 will do, perhaps only 20000.
Each time it recalculates it takes render time.
If it's still grainy it's because the GPU can't figure out exactly what's the colour values for the pixels in that area. It's telling it needs more time.
We are in 2018 yes, and I will tell you that in 2018 there are freelancers like myself who will make 1 (ONE) render in 24h, 48h even 72h to avoid the grainess. That's what might take for a potent GPU. You don't see that in professional productions because they use render farms. Lots of dedicated GPUs doing only one render.
I could do grainless I suppose, if I waited 24h for a particular complex picture. But that's not something I can afford if I want to deliver a (completed) game in less than a year. That's a choice I make. I use complex scenes because I have an artistic direction. Some other creators have their other directions and do perhaps simple pictures, or have technical know-how that I lack to counter this limitation.
I'll be glad to hear and discuss techniques and ideas to reduce or counter grain in renders. Let's hear some!
It's imperative to understand what causes it. I'm no expert in the matter but I've read a few books and forums about it and here's what I understand:
The computer (GPU in the case of IRay) makes its calculations by shooting a ray, per pixel, from the camera, into the scene. That ray will cross the scene and if it hits a geometry (an object) it will calculate it's colour based on the geometry's texture, and the light's parameters (intensity, angle and colour) that hit the geometry at that point.
For each pixel in the picture, a calculation has to be done. That means your picture resolution will dictate, at the start, how many pixels (meaning rays) should be shot from the camera. The more pixels, the more calculations it will do, enhancing the rendering times.
That said, if a geometry has a simple texture, and it's hit by a bright light, the calculations will be simple.
But most scenes aren't, because:
1/ there are many geometries involved in a simple game scene (a character, her hair, her clothes, the bed, the walls, the ceiling, the floor);
2/ each geometry usually has several different textures;
3/ the geometries, and their textures, will influence each other;
4/ realistic lighting means realistic shadows
Global Illumination algorythms will try to calculate how light (and shadows) interact like in real life. There's one thing called colour bleeding that happens when an object colour reflects on another nearby object. If you're standing next to a red painted wall you'll notice that the part of your body that faces the wall will have some red hint. The light will bounce on the wall, and the wall will absorb every colour but red (simple physics folks) and will act as if it was projecting red light. That's colour bleeding. That happens all around you every second, and Global Illumination mimics it. That means more computation.
Now, back to the rays.
If the scene is simple the calculations won't be hard to do. The render time will be quick.
But if a scene is not strongly illuminated, like a simple room inside a house, where the only light source is a window (perhaps like the room you're in right now) the calculations will be much harder.
In shadowed scenes, like corners, behind a furniture, the GPU will have to calculate many many things, like the wall geometry, its texture, every colour bleeding coming from every geometry in the room (even that jar at the other side of the room that is not in the camera shot) and because there isn't much light striking that place the GPU won't be sure about the exact colour to define that pixel. The GPU tries randomly to guess that colour and since it's a guess shot the pixel next to it won't be the exact same colour. That's why you get grains (or noise). Because the GPU puts some pixels there that are a bit more green and red or yellow or blue, and results in nonconformity.
The only solution is to allow the GPU more time to calculate. Basically you tell the computer to repeat each ray. That is called an Iteration.
DAZ Studio STANDARD iteration number is 5000. That means that each ray (pixel) is recalculated 4999 times.
If the scene is simple, the picture gets neat after less that that. The GPU gets to a point where his guesses all come to the same result value. You try 300 times and get the same colour. Certainly it's that colour. and the render ends. That's what happen in simple renders, who render for a few seconds to a few minutes.
But for complex scenes, or poorly lit scenes 5000 might not be enough. Perhaps 10000 will do, perhaps only 20000.
Each time it recalculates it takes render time.
If it's still grainy it's because the GPU can't figure out exactly what's the colour values for the pixels in that area. It's telling it needs more time.
We are in 2018 yes, and I will tell you that in 2018 there are freelancers like myself who will make 1 (ONE) render in 24h, 48h even 72h to avoid the grainess. That's what might take for a potent GPU. You don't see that in professional productions because they use render farms. Lots of dedicated GPUs doing only one render.
I could do grainless I suppose, if I waited 24h for a particular complex picture. But that's not something I can afford if I want to deliver a (completed) game in less than a year. That's a choice I make. I use complex scenes because I have an artistic direction. Some other creators have their other directions and do perhaps simple pictures, or have technical know-how that I lack to counter this limitation.
I'll be glad to hear and discuss techniques and ideas to reduce or counter grain in renders. Let's hear some!