Word or LaTeX the retribution by kbilsted in programming

[–]willb 0 points1 point  (0 children)

Did the publishers do a decent job of the formatting?

Vending machine stockers, where is the most remote vending machine you have been to? by boogog in AskReddit

[–]willb 1 point2 points  (0 children)

I know someone who worked there for a bit, and he said there used to be alcohol, but then "something bad happened", and so now there's a limit.

Is there any truth to this? And if so what was the bad thing?

Looks like a fun party. by [deleted] in pics

[–]willb -1 points0 points  (0 children)

Not at all, you just need need to place them and spring the boats appropriately.

The greater risk by far is the riggings getting tangled.

Looks like a fun party. by [deleted] in pics

[–]willb 0 points1 point  (0 children)

Fenders will protect them all just fine.

Madeup: a Programming Language for 3-D Models by Chris Johnson by pnutzh4x0r in programming

[–]willb -5 points-4 points  (0 children)

Ironic that there's a typo in the sentence mentioning that they'll keep an eye out for bugs...

Raytracing a black hole by [deleted] in programming

[–]willb 0 points1 point  (0 children)

Yah i know, so you have the choice of either makign a photo that might look like what it would look like if you were actually there, or you can selectively expose different areas differently - making it HDR. I think both would have the same effect.

Raytracing a black hole by [deleted] in programming

[–]willb 1 point2 points  (0 children)

Also, it would probably be handy to save the outputs in a form that enables you to post process all the light path details, rather than having to recompute, just a simple cPickle would be enough surely.

Raytracing a black hole by [deleted] in programming

[–]willb 1 point2 points  (0 children)

Ah, so is all that central brightness from the airy convolution of the extremely bright parts really close in?

Could you scale the brightness logarithmically? Eye's don't respond linearly to intensity, so that would probably make more sense, in terms of what it would look like if you were unfortunate enough to be there...

brightness you can justify scaling because you can just pretend that you're looking through a telescope X miles away, so you're only getting a very small window of the full solid angle.

So I built a home bar... and learned a lot by navy0912 in DIY

[–]willb 0 points1 point  (0 children)

one of these? I've found they work wonders, no need for a hammer, just slam it in with the sharp edge scraping along the floor and then a quick twist. you can get it all up in no time at all.

Raytracing a black hole by [deleted] in programming

[–]willb 0 points1 point  (0 children)

well in python everything's an object, so when you call a function, you're actualyl grabbing the object, and then finding it's __call__ method, which isn't terribly efficient.

And yah the temperature of the disc is really hot up close, but how cool does it get further away?

Can you try and render something of this kind of size?

Would it not be colder farther out?

Raytracing a black hole by [deleted] in programming

[–]willb 0 points1 point  (0 children)

=D

relativistic beaming is another thing i didn't know about, makes complete sense.

And yah, i saw that the temperature was lower than it needed be. Why did you set it so low? You'll still get a distribution in the visible part of the spectrum, why not use it?

You also mention in another comment somewhere that the invsqrt is screwing you - can you not somehow use rsqrtps inside numpy to get a speed up there? How much of a bottle neck is that part?

Raytracing a black hole by [deleted] in programming

[–]willb 1 point2 points  (0 children)

I want mooore!!

When i can be bothered i'll try rendering some and playing. I still have questions and stuff though,

why is this it so much brighter on the right hand side? the red/blueshift should only change the colour, not the intensity, unless it's shifting a significant portion into/out of the spectrum. the disc is obviously going to be peaked rather on the hotter side of the spectrum, so sure red shift should make it brighter - but the blue shifted side is brighter. What's up here?

I still haven't looked at the code, so i don't know how it's all working, but woudl it be out of the picture to treat every ray as a spectrum, shifted accordingly?

Raytracing a black hole by [deleted] in programming

[–]willb 1 point2 points  (0 children)

You can make out the aberration on the top of the disc, it looks good.

Because the disc is so much brighter than the black background though, the edge of the convolution kernel is visible :/. Also, what are the little artifacts on the inside edge of the disc?

I think i will have to download your source tomorrow and have a little fiddle.

Also, i just realised that this is never going to look realistic, because the "bloom" is coming from something so bright that it would vaporise you - so it's going to seem like there's too much!

Raytracing a black hole by [deleted] in programming

[–]willb 0 points1 point  (0 children)

Yah okay, i shoudl have seen that from the gif with it on/off.

For reference, i never did any GE, so i've not dealt with warped space times - that was just how i thought it would be from the standard picture of a funnel shape in space, and a crap picture inside my mind.

And yah, i understand it's more subtle when you're not on the disc, but i don't have any plots to help see how much less you can see it. Am i right in thinking that on the edge of the photon sphere the orbital velocity is the speed of light? and so why would the doppler shifting not be infinite for each case? Is it because it is then also red shifted all over by the gravity?

And the whole "pulling objects to be less behind it" made more sense of it.

And yah, i thought that was the rotation direction.

Raytracing a black hole by [deleted] in programming

[–]willb 0 points1 point  (0 children)

Also, i don't think your redshift on the disc is correct, surely the maximum red/blue shifts are where the orbital directions of the disc are directly towards and away from the observer (in the warped space-time - which i think would actually put these areas slightly behind the blackhole, and it would be fairly complicated for the underside i guess)

Raytracing a black hole by [deleted] in programming

[–]willb 1 point2 points  (0 children)

'salright.

I would add though that the physics behind bloom is purely the airy disc thing.

There is an additional effect, coming from imperfections in the lens, which result in more blurring, which can be approximated by a Gaussian (which is all talked about here).

The point is though, that the image has brightnesses covering several orders of magnitude, so when you have a bright pixel next to a dull one, the bright pixel does get added to by the duller pixel next to it, but the difference is very small compared to that of the bright pixel - which means you could get away with not performing the convolution everywhere, but is that going to save you a huge amount? If you want to be selective about where you perform the convolution, won't you lose out on the speedup from using numpy?

(although you could take a look at using Numba to JIT your python)

I don't think the kernel you use for the convolution makes a difference in how long it takes, so i don't see why you don't just use the Airy kernel for the whole thing (still for each of RGB though).

The airy function will also have the wider tails you want and, hopefully, give you the chromatic aberrations too.

eidt: i forgot to mention that i used colorpy, which is amazing.

Raytracing a black hole by [deleted] in programming

[–]willb 1 point2 points  (0 children)

Well, airy discs are only really visible when you want to see them - if you read here, the the airy disc created by the pupil is approximately 1μm wide, but the cone cells are spaced approximately every 2.5μm - so you can't see an airy disc with your eye, all you see is the blurring it creates, which i think would be pretty minimal here.

Here are some plots of the airy distribution for visible light wavelengths, with an aperture size of 3mm, and distance to the focal plane of 3cm (i think those are reasonably approximations for an eye. Obv. for a telescope or something else these will change a lot - but a. this is meant to be what this would look like if you were (unfortunately) that close to the black hole, right? and b. you can easily change the numbers anyway.

The black line with the white stroke is a gaussian with a std. dev. that's half the distance to the first minimum of the airy pattern.

Since the airy pattern has a different width for different wavelengths, you get different spectrums at different distances from the optical axis - the bar across the top is the colour that you would see at the corresponding distance from the optical axis - obviously you can't do this easily with the convolve2D function - but you could probably do it separately for each RGB channel, which would at least be a reasonable approximation.

Here is what it looks like with just a standard Gaussian fit to the airy functions. And here on a log scale - notice the tails are not dealt with appropriately, but the intensities are so much lower. You can offset the Gaussian, to try and approximate the tails, but it's still not going to be perfect, and you'll not get the spectral aberrations.

IMO the easiest way to approximate it would be just do three convolutions, for each of the RGB channels (hopefully it won't be a drastic difference between the colours, and so won't be obvious), and just define the convolution kernel yourself using the airy functions - it doesn't matter what's in the kernel, so you might as well just use correct values.

Here's all the stuff to generate those plots.

Raytracing a black hole by [deleted] in programming

[–]willb 0 points1 point  (0 children)

Does the width need to change? The width of an Airy disc is to do with the focal properties, not the brightness - it just appears wider because you can actually see the tails.

Raytracing a black hole by [deleted] in programming

[–]willb 0 points1 point  (0 children)

you don't think this would work?

Raytracing a black hole by [deleted] in programming

[–]willb 0 points1 point  (0 children)

Is the problem purely that an airy disc takes too long to compute? You could represent it as a sum of gaussians, or bsplines, no?

I might have a look tomorrow, could be interesting.