Better HN
topnewbestaskshowjobs
Log inSign up

ThatOtherPerson

94 karma · joined Nov 19, 2013 (13y ago) · 34 submissions

Submissions

comment 8y ago · link · parent

Yeah, you have to simulate the attenuation from different directions - HRTFs (head related transfer functions)[1] are used to do this. They're already supported by some games, and you have to use them for VR audio, since the user is in control of the camera position and angle.

[1] https://en.wikipedia.org/wiki/Head-related_transfer_function

comment 8y ago · link · parent

That's already possible - Apex[0] provides a shim for running golang and Rust, and I'm running headless chrome on Lambda to take screenshots right now (see [1] for an example).

[0]: http://apex.run/#runtime

[1]: https://github.com/sambaiz/puppeteer-lambda-starter-kit

comment 9y ago · link · parent

What happens if you need to alter the color of a texture that's been loaded? For example, if you want to do diffuse shading on a sphere with a texture mapped to it. Do you first need to convert the texture pixel back to linear space, apply the shading, and then correct for gamma?

comment 9y ago · link · parent

I thought about that, but some of the results I found on Google suggest that output from WebGL shaders is supposed to be in a linear color space [0] [1]. Then again, some of the comments here [2] suggest that you do have to do gamma correction manually.

Incidentally, I didn't know to do gamma correction until I came across [3], which explained why the output from my raytracers always looked a little off ;)

[0] http://stackoverflow.com/questions/10843321/should-webgl-sha...

[1] https://www.khronos.org/webgl/public-mailing-list/archives/1...

[2] https://www.shadertoy.com/view/Xdl3WM

[3] http://blog.johnnovak.net/2016/09/21/what-every-coder-should...

comment 9y ago · link · parent

This is pretty cool. I've written a couple of toy ray tracers, but always in a language that runs on a CPU, so it's interesting to see how you would do it on a GPU. And I noticed that this is from the Ken Perlin, which is cool - I'm mostly just used to seeing his name as the "Perlin" in Perlin noise.

There's one thing I'm curious about - does anyone know why he's taking the square root of the color to produce the final pixel color?

comment 10y ago · link · parent

How you do in technical interviews often has little to do with how good of a programmer you are. Modern technical interviews (in Silicon Valley, at least) tend to focus on a certain category of computer science and mathematical questions, rather than skills that would actually benefit an employer.

On the bright side, something of an industry has been built up around preparing people for tech company interviews (similar to the SAT prep industry). Check out Gayle McDowell's Cracking the Coding Interview[0], CodeKata[1], or Interview Cake[2].

[0] https://www.amazon.com/Cracking-Coding-Interview-Programming...

[1] http://codekata.com/

[2] https://www.interviewcake.com/

comment 11y ago · link · parent

Could you use emscripten and just run bash in the browser?

comment 11y ago · link · parent

Read the bar at the bottom:

    Lovingly (and satirically) created by your friends at test double. Designed by Derek Briggs.
It's not meant to be serious, although I'm not sure what the point is.

Edit: It seems to be (perhaps unintentionally) clickbait for programmers. We can't seem to resist visiting a website that claims to rate our code quality.

comment 11y ago · link · parent

You can only ask yes/no questions.

comment 11y ago · link · parent

It looks like a video projected on a transparent screen, similar to the variant of Pepper's Ghost used in several concerts recently.

comment 11y ago · link · parent

The sharp sign (♯) [1] is actually a different symbol than the number sign (#) [2].

[1] https://en.wikipedia.org/wiki/Sharp_%28music%29

[2] https://en.wikipedia.org/wiki/Number_sign

comment 11y ago · link · parent

It's been my opinion for a while that the "meaning" in a work of art or in the sentences we use to communicate is found where it differs from the established pattern. For example, this very sentence follows the same general outline of thousands of other sentences. The actual meaning is found where it breaks with the pattern.

Another simple example would be image macros. They often follow a very strict pattern; the new information the user wishes to convey is where the pattern is broken.

In the same way, stories often follow a number of tropes. These tropes help to establish some basic information about the story, but what really makes it interesting is when the story breaks from the pattern and does something new.

comment 12y ago · link · parent

Not everybody targets all their code for the web.

comment 12y ago · link · parent

It's an improvement in the sense that it's more general; you can loop through any container that implements that protocol, which most (if not all) of the STL containers do. For example,

    template <class T>
    void foo(T arr)
    {
        for (auto it = arr.begin(); it != arr.end(); ++it)
        {
            std::cout << *it << std::endl;
        }
    }
You could pass a `std::map<int>` to `foo`, or a `std::list<string>`, or a `std::vector<char>`. You could even create your own classes and give them to `foo`, as long as they implement the `begin`/`end` protocol.

It's certainly more verbose than necessary, but it can be convenient.

comment 12y ago · link · parent

He says he stored the map data as a single PNG. So, each pixel specifies what tile type that area of the map is.

comment 12y ago · link · parent

Check out pandoc [1], it will let you write documents in Markdown + LaTeX for equations and then convert it to LaTeX, a PDF, or several other document formats.

Also, even though Markdown tends to be fairly easy to write, there are many edge cases where you can't really be sure what the result is unless you try it.

[1]: http://johnmacfarlane.net/pandoc/

comment 12y ago · link · parent

I've gotten to the point where I just tune those out. I wouldn't have even known there was an advertisement on that page if you hadn't pointed it out.
12