Live data from Hacker News

KABOOM in 180 lines of bare C++

github.com

21–30 of 68 posts

Re: KABOOM in 180 lines of bare C++

#22
post #8

Earlier quoted context omitted.

> The use of GitHub to show diffs of each step is quite effective. Little off-topic, but that's one of the reasons I like to use Magit on Emacs, you can see the diff of each commit interactively and intuitively. [1]: https://magit.vc/

Git can show you the diff of any commit as well, though I guess maybe the interactivity you mentioned is important. Anyhow, with just git. Diff of most recent commit: git show HEAD Diff of preceding commit: git show HEAD^ Diff of commit before that again git show HEAD^^ Of course you don’t want to type ^ 200 times. Fortunately you don’t have to. Diff of commit three steps back before most recent: git show HEAD~3 Or y…

Alternatively, you can use `tig` which allows you to browse the commit log, diffs, and blames interactively. It's a terminal ui tool.

Re: KABOOM in 180 lines of bare C++

#24

This technique (distance field sphere tracing) was popularized in a big way on the community https://www.shadertoy.com/

Inigo Quilez created that site, he could be said to have been the one who really popularised it all. He has a bunch of articles on his site about distance fields:

https://www.iquilezles.org/www/articles/distfunctions/distfu...

https://iquilezles.org/www/articles/raymarchingdf/raymarchin...

He also has videos on YouTube, some of which show the creation of a scene starting from the basics.

Re: KABOOM in 180 lines of bare C++

#25
Add in some lookup-tables from experimental nuclear interaction probability tables and you've got yourself a Monte Carlo radiation transport system capable of simulating in precise geometric detail all sorts of systems. This was indeed one of the early uses of computers back in the 1950s.

For example: https://en.wikipedia.org/wiki/Monte_Carlo_N-Particle_Transpo...

Re: KABOOM in 180 lines of bare C++

#26

Earlier quoted context omitted.

Very interesting indeed! Off-topic: May I suggest that you switch to using imgur instead of the image host you chose? The ads on imgur are much less intrusive.

Imgur doesn't work on the old iPod I was using while my phone charged. It never loads fully, but TBF I never upgrade iOS past 2 major versions. So iOS 7 and the first "plain" image host search result it is... :-) Edit: Found the image link on my own site: https://www.friendlyskies.net/images/266.jpg

It'd work if people just simply posted the direct image, so you don't have to load their massively bloated website. Then again a direct link wouldn't support them through their monitization methods (ads), but if I'm already running an ad blocker..

Re: KABOOM in 180 lines of bare C++

#29
post #18

Wow, this is very similar to the way I use procedural 3D textures and displacement maps to draw planets and things. So much so that I don't even see the explosion, just a growing planet (really, just tweak the mapped color gradient a bit). Example: https://www.friendlyskies.net/images/266.jpg So much of 3D graphics is "hmm, this random thing I just made slightly resembles an $X". "OK, so let's say I just created a me…

That's a common trick in PC 4k intros. Despite the apparent variety, most 4k intros rely on a single effect, maybe two. There isn't enough space for more. The only things that change are the parameters. Interestingly, the technique used here is signed distance field raymarching. A technique that is used by maybe 90% of all 4k intros today. So basically, write the code in GLSL instead of C, add music, play a bit with…

For reference http://www.pouet.net/prodlist.php?order=release&type%5B%5D=4...

The effects make the difference, besides artistic direction, so materials, blur (bokeh), the sdf geometries (often just mere balls and cubes, but perhaps a twister or a nice water surface or a fractal) just for starters. Just from my outside perspective.

Re: KABOOM in 180 lines of bare C++

#30

Earlier quoted context omitted.

Imgur doesn't work on the old iPod I was using while my phone charged. It never loads fully, but TBF I never upgrade iOS past 2 major versions. So iOS 7 and the first "plain" image host search result it is... :-) Edit: Found the image link on my own site: https://www.friendlyskies.net/images/266.jpg

It'd work if people just simply posted the direct image, so you don't have to load their massively bloated website. Then again a direct link wouldn't support them through their monitization methods (ads), but if I'm already running an ad blocker..

While I argued for Imgur over using the hosting site the parent to mine used with regards to intrusiveness of ads I should note something important about Imgur with regards to the bloat you mentioned.

The image subdomain servers of Imgur, i.imgur.com, look at the referer of your request and will conditionally redirect you to the web app.

Basically, direct links to images will only give you the image directly if the page you came from is on their whitelist.

Reddit is on said whitelist but I don’t think HN is.

And to further complicate the matter keep in mind that browser caching might make it look to you as though a direct link you posted somewhere is really direct, but to those who haven’t visited the image already they will be redirected the first time they visit that direct link.

For example, here is a direct link to an image hosted on Imgur: https://i.imgur.com/6O265V5.jpg

For me it will look this direct link serves the image only, even when I click my own link in this comment after I’ve posted the comment and am visiting it with HN as referer.

But if HN is not on their whitelist then you and everyone else clicking the link in my comment will be redirected to their web app, provided you didn’t happen to have the image in your cache already.

Edit: Yup, visited the link in this comment from another computer and am indeed redirected as I expected.

Edit 2: Am also redirected even on the device I posted from when following the link in my comment. So even browser caching didn’t stop that in this case.

Post reply on HN