|
![](/i/fill.gif) |
On 10/06/2016 08:33 AM, scott wrote:
>> That sounds quite complex. (In particular, it seems to require me to
>> actually design a real lens assembly, and implement real refraction.)
>
> Yes I realised that later too, Google didn't seem to throw up any real
> data on proper lens design (for pretty obvious reasons), only very
> simple examples. Still it might be interesting, and you never know if
> you made it slick enough one of the big lens manufacturers may show some
> interest in you or your code.
Pfft. I doubt anything I'll ever do will be "slick". But maybe I can
make something interesting.
(Would be nice if ShaderToy would let you add sliders to control your
shader!)
>> I was thinking more along the lines of a camera entity that fires rays
>> in a pattern that matches a theoretical ideal lens. But I need to figure
>> out the equations for that first...
>
> Look through the POV source? :-)
Any idea where in the 25,000,000 LoC I should start looking?
(You never know, maybe there's a file named camera.c or something...)
>> Yeah, not just a random number per pixel, but *multiple* random numbers!
>> Multiple, statistically-independent numbers... This is not trivial.
>
> Exactly, poor RNGs in these sorts of things can cause some bizarre
> artefacts.
There's a couple of StackOverflow questions about this. It seems the
best results are obtained by using an integer hash function... yet
ShaderToy seems to not support bitwise integer operations, so that's
kind of not an option.
That said, there's a widely used sin-based method, which gives awful
results. But if you iterate it a few times... it's not *too* bad.
Still waiting on how you average consecutive frames.
Post a reply to this message
|
![](/i/fill.gif) |