IRay: Grainy pictures

Tips, techniques and tutorials about creation tools.

IRay: Grainy pictures

Postby Mortze » Thu, 18Jan11 23:28

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!
User avatar
Mortze
legend of the South Seas
 
Posts: 592
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: IRay: Grainy pictures

Postby JFR » Fri, 18Jan12 00:31

Mortze wrote:... grainy renders (or noisy, same thing) ...

Speaking from a professional photography viewpoint, noise and grain are not the same thing at all. However, I will grant you that the ultimate effect on the viewer of 3D renders is effectively the same.

Sorry, I am known to be a bit pedantic at times. I can't help it sometimes. [img]images/icones/icon15.gif[/img]

Your discussion and point are right on.
JFR
star of the reef
 
Posts: 273
Joined: Tue, 16Feb16 06:59
sex: Masculine

Re: IRay: Grainy pictures

Postby Mortze » Fri, 18Jan12 00:36

JFR wrote:Speaking from a professional photography viewpoint, noise and grain are not the same thing at all. However, I will grant you that the ultimate effect on the viewer of 3D renders is effectively the same.

Of course, it's two completely different things. One is calculations turned into colour, the other is lack of luminosity, film quality or a simple after effect. :)
User avatar
Mortze
legend of the South Seas
 
Posts: 592
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: IRay: Grainy pictures

Postby JFR » Fri, 18Jan12 00:54

Mortze wrote:
JFR wrote:Speaking from a professional photography viewpoint, noise and grain are not the same thing at all. However, I will grant you that the ultimate effect on the viewer of 3D renders is effectively the same.

Of course, it's two completely different things. One is calculations turned into colour, the other is lack of luminosity, film quality or a simple after effect. :)

Grain is technically a visual representation of the grains of silver in the film emulsion while noise is as you described, although (again) in photography it is an artifact from the digital sensor.

Ok, you set me off this time, you tease. :lol:

I'm finished, now.
JFR
star of the reef
 
Posts: 273
Joined: Tue, 16Feb16 06:59
sex: Masculine

Re: IRay: Grainy pictures

Postby MaxCarna » Fri, 18Jan12 06:37

Mortze,

This is a nice discussion. Just to add a point about memory

I had an experience, but I'm not sure if I reached the right conclusions. I was rendering internal night scenes in a machine with 16gb RAM and I was having grainy renders in many pictures. I hasn't worried about this resource, but the log was saying that I was processing the whole scene on gpu.

I had to buy a new computer and decided to invest on RAM, building a 64gb machine. All grainy was gone with all the same settings.

This make me believe that even processing on the gpu only, the memory is heavily used and when it reaches the limit, the interactions stop and look like the scene is done.

Digging into some Daz settings, I found one thing in "Render Settings" tab, optimization. Instancing Optimization has default value of Speed, you can changed it to Memory.

I believe that this change can help with grainy renders when the memory is not so big. It will take more time but the result should be better. Just a guess

About the interation number, the place to configure that would be Render Setttings->Progressive Rendering->Max Samples? Probably has to change Max Time too?
User avatar
MaxCarna
lagoon predator
 
Posts: 160
Joined: Wed, 16Jun15 06:01
sex: Masculine

Re: IRay: Grainy pictures

Postby Sarchx » Fri, 18Jan12 07:40

About the iteration number, Daz will stop when it reaches either max time or max samples. Whichever comes first.

Interesting observation about the ram, but since you rendered it on a new pc, I think it might be because you previously reached max time, before the max iterations - and with the new one, it either finished or reached max iterations.
Was the gpu upgraded in the process ?

The graininess is a pain to deal with - period.
I've had some luck to remove it with camera settings, but it made the image lighter.

Perhaps a workable solution could be, to render it with more light, and remove brightness in post work ?
Sarchx
User avatar
Sarchx
great white shark
 
Posts: 88
Joined: Thu, 16Jun09 16:44
sex: Masculine

Re: IRay: Grainy pictures

Postby JFR » Fri, 18Jan12 08:58

Noise responds best to perfect exposure. Attempting to adjust exposure (lighten or darken) in post-processing always increases noise. It is possible to reduce or remove noise in post but at the expense of sharpness.
JFR
star of the reef
 
Posts: 273
Joined: Tue, 16Feb16 06:59
sex: Masculine

Re: IRay: Grainy pictures

Postby Mortze » Fri, 18Jan12 15:43

DAZ will stop rendering if you reach the Standard iteration numbers or Standard rendering time, which one comes first. But you can change those values to have DAZ render for days.

Changing the camera settings to avoid grains is pointless. The lack of, or wrong data, is there. When you change the brightness in an editing software you'll see the grains reappear. The only solution to avoid grain is to either to give the computer more computation power (more and better GPUs) or give the computer more time.
Unless I'm missing something.

I don't think RAM is important when it comes to GPU calculations. It helps in terms of loading huge scenes, but I doubt it helps in any calculation. That's the processor's job only.
User avatar
Mortze
legend of the South Seas
 
Posts: 592
Joined: Wed, 14Oct29 02:34
sex: Masculine

Re: IRay: Grainy pictures

Postby MaxCarna » Fri, 18Jan12 19:23

Sarchx wrote:Interesting observation about the ram, but since you rendered it on a new pc, I think it might be because you previously reached max time, before the max iterations - and with the new one, it either finished or reached max iterations.
Was the gpu upgraded in the process ?


No, same gpus, two Geforce 1070 8gb.

I observed that the RAM consumption achieved 34gb in one scene on the new machine.

Mortze wrote:I don't think RAM is important when it comes to GPU calculations. It helps in terms of loading huge scenes, but I doubt it helps in any calculation. That's the processor's job only.


I thought that, but I have noticed a considerable increase in RAM usage during rendering, the cpu remains idle. The scene is already loaded before the renderization begins.

I can't say how the process is using this memory
User avatar
MaxCarna
lagoon predator
 
Posts: 160
Joined: Wed, 16Jun15 06:01
sex: Masculine

Re: IRay: Grainy pictures

Postby Sarchx » Sat, 18Jan13 13:33

Thanks btw. Mortze, for explaining it, in a language that's understandable.

Just thinking out loud (haven't tried or tested anything.);
Have anyone experimented with dark lighting (i.e. black/dark grey/dark blue) in opposing directions to the actual lighting ?
Could that help to "trick" the GPU into knowing what colour those areas should be ?
Sarchx
User avatar
Sarchx
great white shark
 
Posts: 88
Joined: Thu, 16Jun09 16:44
sex: Masculine

Re: IRay: Grainy pictures

Postby Ehlanna » Sun, 18Jan14 02:41

I don't do that many dark scenes, so no real experience to speak of. However, I might suggest upping the overall intensity of the light within the render and toning it down in postwork. I am also fairly sure I have seen suggested rendering to a larger dimension then reducing the dimensions in post, along with the intimation that render size (with Iray at least) does not affect render time that much.
User avatar
Ehlanna
star of the reef
 
Posts: 383
Joined: Thu, 10Apr22 23:00
Location: Looking out the screen at you ... ;)

Re: IRay: Grainy pictures

Postby Mortze » Mon, 18Jan15 01:10

Ehlanna wrote:I don't do that many dark scenes, so no real experience to speak of. However, I might suggest upping the overall intensity of the light within the render and toning it down in postwork. I am also fairly sure I have seen suggested rendering to a larger dimension then reducing the dimensions in post, along with the intimation that render size (with Iray at least) does not affect render time that much.


That should theoretically help, but it's very tricky.
You need to be very good at understanding lighting ratio https://en.wikipedia.org/wiki/Lighting_ratio and https://www.adorama.com/alc/understanding-and-using-lighting-ratios-in-studio-portraiture-1 because you'll need to match those ratios in DAZ to those you want in your final picture that you edit in Photoshop or similar software. I certainly don't have that skill.

The second part, rendering to higher resolution and reducing it in Photoshop is a technique to save rendering time. It won't help with the grains. At higher resolution you'll simply have more grains appearing.
User avatar
Mortze
legend of the South Seas
 
Posts: 592
Joined: Wed, 14Oct29 02:34
sex: Masculine


Return to The workshop of creators

Who is online

Users browsing this forum: LIZARDGOD, MaxCarna and 1 guest

eXTReMe Tracker