8
$\begingroup$

Is it possible to create a lens shader with EEVEE/Cycles ?

I'd like to have the control over the camera position and the ray direction per sample. This allows to simulate various conventional lens distortions (which I'm not interested in) and other deforming effects. Houdini and Arnold supports a camera lens shader, someone also used it to run across the objects and bake textures.

Some other ideas include run a particle simulation, and assign each particle to a pixel in the image as if it were a camera looking from that particle. Or you can just use an ordinary object to sample the space around. You can mix perspective and orthographic in different parts of the image, blending between them, or even zoom only part of the image. This thread shows how to set it up and one possible use that this kind of level of control gives you.

https://www.sidefx.com/tutorials/lens-shaders-for-gamedev/

I insist that I'm not trying to replicate this specific effect, I'm looking for this level of control per pixel.

$\endgroup$
8
  • 1
    $\begingroup$ If I'm not mistaken OSL scripts might also allow this $\endgroup$ Commented Jul 6, 2020 at 17:13
  • $\begingroup$ i'll look into that thank you $\endgroup$
    – menoz
    Commented Jul 7, 2020 at 9:06
  • 1
    $\begingroup$ i've seen the question has been marked as duplicated, it's not. I've already seen that other question and that answer doesn't allow to edit the camera position per pixelas i am asking here. $\endgroup$
    – menoz
    Commented Jul 7, 2020 at 9:11
  • 1
    $\begingroup$ I have no Idea about OSL scripts, but else then them see this maybe: blender.stackexchange.com/a/126669/60759 Using baking functionality might replicate what you need in Cycles. $\endgroup$ Commented Jul 7, 2020 at 10:49
  • $\begingroup$ It sounds like what you may want is Ray Marching with Signed Distance Fields. This Gumroad shader implements a variant of them math described in this article. $\endgroup$ Commented Sep 25, 2021 at 21:56

0

You must log in to answer this question.