Dirt lens in Cycles

Hey Guys !

Is there a way to do a dirt lens effect in cycles (compositor) which reacts with light sources ? :smiley:
Havent found much in google etc. ._.

Cheers <3

A dirt lens effect? What do you mean?
Do you have an example?

Carl Irwin has a neat solution to compositing dirty lens effects onto stuff https://www.youtube.com/watch?v=Wf5wHXZ6CJU here is one example theres heaps more as well as downloadable files.

Thanks for reply guys <3
To answer you first vincent, i mean an effect like this:


Where light passes through some dirt and stuff in the camera lens, which then gets lighted up to create more photorealism i guess. Atleast that what i thought when people used alot of it in renders :smiley:

The thing is, that i would actually like to insert kind of an dirt lens texture in post process to be say, in the compositor. The thing however is, that im not able to let it react with light sources in the scene, so instead of showing up only within heated light, the texture itself is shown on the whole screen :S

I hope u can follow my weird explanation :smiley:

Cheers !

A component of Carl’s lens flare kit is a dirty lens effect. Don’t recall of the top of my head how it works and may need to be linked to geometry in the scene, but you could make this with key effects in the compositor (isolating the brightest part of the image)

Sigh…

In my photographer days, I spent so much time cleaning lenses, putting lens-caps on, and tossing out photographs because they had a tiny speck of lens-dirt in some corner. All such photographs are absolutely unpublishable in a magazine.

The same was true, by the way, of lens flare.

If you do want the effect, it’s easy to do with the compositor. Bloop some spots onto a grayscale image. Use that image as a source (with an RGB node) to create a color of the desired shade, modulate it by (say) camera orientation, and also use that same source to alter hue-and-saturation of the image over which the spot layer will be overlaid, according to the density of the spot. The same basic ideas can be used to simulate the presence of glass, as in fact I wrote a little “micro-tutorial” here many years ago.

About the only place where I might actually do it is in a shot like this, where the camera’s supposed to be mounted on the outside of an airplane and/or looking through a window. Such a lens or window simply can’t be clean.

There’s no reason to “do this in Cycles,” by the way. Do it as an after-effect. You can do it in seconds, adjust it as you please, and you won’t be able to tell any difference. Always keep the job-description of any renderer as simple as you can make it.

The slang word is “‘faking’ it.” Don’t try to mimic physical reality: create something “much more cheaply” that looks like … looks just enough (and no more) like … the physical reality that you know will already be familiar to the audience. The audience will “see” what they expect to see; even will insist that they saw it.

@sundialsvc4 Last paragraph is excellent advice!

Nothing wrong with verisimilitude, but you do need to recognise when enough is enough.

This would be a cool effect for maybe someone staring out of an car / airplane window (where you would pick up on the dirt of the clear plate in front of you). I like it!

Thanks for responses guys !

With doing in “Cycles” i acutally meant to make the effect with volumetric light and using an light pass (which acutally isnt existing atm ._.) to combine the image through the Compositor and than using an grayscale image with black dots (as u mentioned) to filter the light with dots.

I know i know, terrible explanation but the only source of help i found was avaiable on youtube, where that guy used halo from the Blender Internal to make the effect. Atleast it worked there. I kind of tried to replicate the effect with cycles but i havent found an solution yet ._.

I would love to try out ur method #sundialsvc4 but i cant really follow ur instruction clearly :S

For interest, here is a link for the tutorial :https://www.youtube.com/watch?v=W2jZRFTwDlw