PDA

View Full Version : Adding grain in post


Simon Wicker
09-11-2005, 04:37 AM
Hi all,

Dann Stubbs mentioned that I once posted a 'how to' on adding film grain to a render in that 'other thread'. I thought I'd pass it on again in case anyone is interested as the original has, I'm sure, disappeared into the mists of the past.

Most compositing apps have an add grain button now that attempts to analyze the grain in a piece of live action and then you can apply that grain to your renders (i.e. after effects, combustion and shake) but there is no harm in knowing the manual way of doing it.

I'll talk about Photoshop but the technique is usable in most apps. The first thing to do is to get yourselves a piece of footage from a real camera that you are matching to. In the visual effects world this would be the live action plate that your render would be dropped into, but even if you are just doing a still and would like to make it look more photorealistic it is still a very good idea to try and track down a real photographic image that matches your shot (so you have something physically accurate to match to). Have a look in Photoshop at how the grain in this real image is distributed. The best way to do this is to check each of the RGB channels individually in the channel palette. All of the channels will have a different distribution of grain, amount, size, etc. The blue channel is generally the most grainy, red and green the least grainy. There will also be a change in the granularity of the highlights, midtones and shadows. Keep this image handy as reference and open up your cinema render.

In photoshop create a new layer above your render, fill it with 50% grey and call it something obvious like 'Grain'. Change the blend mode of your grain layer to HardLight. HardLight mode is great because they grey will become transparent but any noise that you add to this layer will either be screened or multiplied with the render layer below depending on its brightness so you can experiment non-destuctively with what looks best. Now with the grain layer still selected go to the channels palette and then individually (and with reference to the degree of grain present in your live action plate) use the add noise filter to affect each of the RGB channels separately - you will click on each channel one at a time to make it active and then run add noise on just that channel. You can also blur each channel separately (often the blue channel is grain is very clumpy so you may need to blur this channel and then adjust the levels to bring the contrast back). Once you have matched each of the RGB channels individually you can then copy your base render and paste that into a layer mask attached to the grain layer. Adjusting the levels on this layer mask will tweak how much of the grain appears in the shadows, midtones and highlights (although obviously to supress the grain in the highlights you should invert the colour of the layer mask).

Hopefully that will be enough to get people started, I'm sure there are other recipes. Other things to remember when comping a render over liveaction or other photographic plate are things like edge blur (where you may need to run an edge detect on your alpha channel and use that to subtly blur the edges of your render into the background), adding light wrap from the background so that strong lights in the bg bleed into your foreground cg, and adding bloom to the brighter parts of your cg so that it mimics the halation you get when film and CCD records an overexposed image.

Cheers, Simon W.

MJV
09-11-2005, 05:00 AM
Thanks for that. I never thought of going to such lengths to add grain or splitting it up between channels. In video the red channel is always the noisiest by a good margin, with green being the cleanest. I guess that's why green is used for keys.

JoelOtron
09-11-2005, 05:45 AM
Hope you dont mind Simon, but heres another old post of yours I refer to from time to time on faking GI via AO. Maybe this is the Simon Says thread?


http://forums.cgsociety.org/showthread.php?s=&threadid=129843&highlight=simon+occlusion

Janine
09-11-2005, 11:17 AM
Hi Simon,

I've added this to the 3D Fluff tutorial section (http://forum.3dfluff.com/forumdisplay.php?f=10). Hope you don't mind! :)

JamesMK
09-11-2005, 12:39 PM
That's useful stuff, Simon - thanks a lot for this micro-tut :thumbsup:

ThirdEye
09-11-2005, 11:34 PM
thanks for sharing your knowledge Simon

chris_b
09-12-2005, 02:53 AM
Thanks for sharing Simon :) Excellent high-quality information.

Edge Blending and Light Wrap are definitely a crucial part of the comp process.
Regarding Light Wrap, there is an excellent Shake tutuorial here (the technique is fully achievable in any other compositing app). There's also a pretty elegant channel lighting hookup and some AO compositing tips. One other thing I'd really like to look into is re-lighting using Normal Map passes.... the new features in AR 2.5 (AO, 32-bit OpenEXR, Normal Maps, Shake script output) make C4D ideal for this kind of multi-pass compositing workflow.


Light Wrap Tutorial (http://www.highend2d.com/shake/tutorials/general/130-4.html)

LucentDreams
09-12-2005, 02:57 AM
Hi Simon,

I've added this to the 3D Fluff tutorial section (http://forum.3dfluff.com/forumdisplay.php?f=10). Hope you don't mind! :)

I"d add his GI one too, I know I was using it as guide when testing 9.5's AO.

dann_stubbs
09-12-2005, 11:34 PM
Hi all,

Dann Stubbs mentioned that I once posted a 'how to' on adding film grain to a render in that 'other thread'. I thought I'd pass it on again in case anyone is interested as the original has, I'm sure, disappeared into the mists of the past.

Most compositing apps have an add grain button now that attempts to analyze the grain in a piece of live action and then you can apply that grain to your renders (i.e. after effects, combustion and shake) but there is no harm in knowing the manual way of doing it.



thanks simon, i had made a text file to save of the AO post but for some reason did not have this one.

dann

Blur1
09-14-2005, 02:51 AM
Thanks for sharing Simon :) Excellent high-quality information.

Edge Blending and Light Wrap are definitely a crucial part of the comp process.
Regarding Light Wrap, there is an excellent Shake tutuorial here (the technique is fully achievable in any other compositing app). There's also a pretty elegant channel lighting hookup and some AO compositing tips. One other thing I'd really like to look into is re-lighting using Normal Map passes.... the new features in AR 2.5 (AO, 32-bit OpenEXR, Normal Maps, Shake script output) make C4D ideal for this kind of multi-pass compositing workflow.


Light Wrap Tutorial (http://www.highend2d.com/shake/tutorials/general/130-4.html)


A quick and easy way is to download the SexyLight macro for Shake. You can give it any 8 bit normal map render from any 3D software and it will allow parallel light relighting. Good for adding rim lights etc.

The GI engine enhancements in 9.5 look great, but since there is such a user-friendly AO implementation now, it would be nice if a bent normal pass/environment map lookup was also offered (for GI approximation), to round out the ambient lighting/occlusion solution in line with how Hayden Landis/ILM sussed it out.

From the screen grab of the new Shake project output, it seems it just bungs all the passes into a multilayer node, which is highly irrelevant to how you may want to comp together all the custom passes you mention. But at least it does a quick slap comp for you.

Can you render multichannel EXR files from Cinema 9.5? also, is it possible to customise the Shake script that Cinema creates? ie. it's just a text file.

Michael

chris_b
09-14-2005, 01:17 PM
Yeah.... currently you just get a multilayer node. You can edit the script though, in simpletext or whatever else. Regarding multi-channel OpenEXR... that would be amazing, but I don't think it is in the current implementation. Don't have 9.5 yet so I might be wrong. If you can't, then I suspect there are still some issues with multi-channel OpenEXR that complicate things on the programming end. With OpenEXR now though, this should be something that becomes availble before long.

Does Shake 4 natively support multi-channel OpenEXR? I thought it was RGBAZ (iff) only.
I would guess that to take advantage of the additional channels, you'd need a custom scripted file-in node (like the Photoshop importer). I think DF supports this out of the box...

I agree that a bent normal pass option would be good. It was the first thing I looked for
in the demo. There is a handy environment lighting hookup, but no bent normal. Maybe Simon Wicker could comment on whether he makes use of bent normals and whether they are really recessary for a day to day AO / multi-pass based workflow.

It is a step in the right direction though and I guess saves you the file-in time. Also, Thanks for the tip re: sexy light. I'll definitely have a look.

Blur1
09-14-2005, 02:11 PM
Shake 4 does the RGBAZ thing but it lets you import a fat EXR file and choose which 5 channels you can view. So it just means you need to dupe the filein and change the channels being accessed. Having said that I don't have access to a 3D renderer that does multichannel EXR files anyway...just a matter of time I guess before Cinema does.
Re: the C4D>Shake project output, so we could specify our own script? That sounds fun...

As far as bent normals lookups go, I would say if you want ambient lighting from an environment map but can't afford a GI calculation then it's useful, and it's used all the time.
If you are using VRay then perhaps you just render GI. I worked on a job where everything was VRay rendered GI and looked amazing (Cartoon Network rebranding) but for film/HD pipelines I think less expensive methods are still order of the day....perhaps not for long. For matte painting you could render true GI and bake it in with a camera map.
Turtle, mentalRay, PRMan and derivatives, they all do bent normal lookups. I've been doing them in Shake with some success, but just experimenting.

chris_b
09-14-2005, 02:31 PM
Ahhh.... very cool. So you just use mulitple file-ins with arbitrary channel lookups nice.
Regarding bent-normals again, I guess the environment option in the new AO is doing exactly that (providing ambient lighting from a user specified environement map). I guess that Maxon decided to name it more intuitively than 'bent normal' which probably doesn't mean much to most people.

Can't wait till my 9.5 disks arrive!

Blur1
09-14-2005, 10:06 PM
Ahhh.... very cool. So you just use mulitple file-ins with arbitrary channel lookups nice.
Regarding bent-normals again, I guess the environment option in the new AO is doing exactly that (providing ambient lighting from a user specified environement map). I guess that Maxon decided to name it more intuitively than 'bent normal' which probably doesn't mean much to most people.

Can't wait till my 9.5 disks arrive!

Looking forward to checking that out....I have the demo

Simon Wicker
09-14-2005, 11:14 PM
with regards to the bent normals i have to say i have never ever used a bent normals pass when compositing AO, so while they are probably useful in a pure cg composite scenario most of my matte paintings still just use cg as an element and there will be a lot of post work in photoshop to tweak lighting and atmosphere. in this situation i am often just using the AO as a matte for a piece of paint or an adjustment layer.

cheers, simon w.

dann_stubbs
09-17-2005, 12:14 AM
Hi all,

Dann Stubbs mentioned that I once posted a 'how to' on adding film grain to a render in that 'other thread'. I thought I'd pass it on again in case anyone is interested as the original has, I'm sure, disappeared into the mists of the past.

Most compositing apps have an add grain button now that attempts to analyze the grain in a piece of live action and then you can apply that grain to your renders (i.e. after effects, combustion and shake) but there is no harm in knowing the manual way of doing it.

hey may be irrelevant now with your new post - but i found the .txt file i saved from the first time you posted about grain - i had save this one with "simon" first so it was not in the "add grain" section of the list i looked at where i save all my 3d tips - i saved it on November 24, 2004 - it was a reply to flingster from you simon.

here it is just for grins and maybe comparison to the new post - this one was much shorter

----------------

November 24, 2004

flingster, most of the compositing applications have a grain tool that allows you to sample an area of an original image and then apply that grain to your composited image automatically (combustion/shake). the 'seed' value for the grain is keyframeable so your grain can be animated easily.

photoshop has an add noise command that can be used to add grain to a synthetic noise free image. the trick to it here is to check your target grain type and how each channel looks in the original image (because film stocks have a different grain pattern in each RGB channel) and then apply differing amounts of noise/blur to your synthetic image so that each channel mimics the appropriate look to the grain in the original.

a final trick you can use in photoshop and after effects is to create a layer that is 50% grey, set it to hard light (so it goes transparent) and then apply your noise to that layer. this is a non destuctive method (because the noise is held on a separate layer) so it is easier to adjust blur/opacity etc to get the correct result. hardlight mode correctly applies the colour and lightness of the grain.

cheers, simon w.

----------------

CGTalk Moderation
09-17-2005, 12:14 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.