Live data from Hacker News

Physically based rendering from first principles

imadr.me

71–80 of 97 posts

Re: Physically based rendering from first principles

#71
post #12

Earlier quoted context omitted.

Thanks for the constructive criticism! A few points I'd like to discuss: Let's suppose the aim of the article was indeed to learn PBR from first principles, what would it look like? Quantum electrodynamics? I think there is merit in exploring different physical models for fun and scientific curiosity (like I mentioned in the first chapter). I (personally) feel that it's boring to just dump equations like Snell's law…

Sure! And I appreciate the response. I hope I didn't come off as too mean, it can be hard to find that balance in text, especially while criticizing. I really do not want to discourage you, and I think you should keep going. Don't let mistakes stop you. > Let's suppose the aim of the article was indeed to learn PBR from first principles, what would it look like? I think you shouldn't go that route, but the most hones…

    > But the thing is that there's a weird relationship between computation and accuracy. I like to explain this looking at a Taylor Series as an example. Our first order approximation is usually easy to calculate and can usually get us a pretty good approximation (not always true btw). Usually much more than 50% accurate. Second order is much more computationally intensive and it'll significantly increase your accuracy but not as much as before. The thing is accuracy converges much like a log-like curve (or S-curve) while computation increases exponentially.
This is something I've been thinking about a lot lately that I'd like to better understand. Are there any examples in physics or machine learning that you can think of that have more specific figures?

Re: Physically based rendering from first principles

#72
post #65

The discussion of the difference between metal and non-metal is a bit unclear. When he says that metal has no "diffuse reflection" but non-metals do, I think what he might mean is that metals have no subsurface scattering. Rough (not mirror-like) reflections do certainly also look "diffuse".

Yes, in rendering when we talk about “diffuse” reflection we implicitly mean fuzzy reflections due to light penetrating the material and exiting a small distance away from the entry point (less than a pixel far)

The term subsurface scattering is used for light that exits further away (more than a pixel) like in simulations of human skin

However that part of the article isn’t clear enough and warrants a rewrite

Re: Physically based rendering from first principles

#73
post #54

Earlier quoted context omitted.

Mostly because it is like trying to teach people how to swim in the deep end. It's definitely possible but not a great idea for the majority of people. Do you really want to start learning physics from String Theory? You could, but it isn't a great idea. Even if you replace ST with an alternative proposed ToE.

Thanks for answering and: Valid point. I like about GA that it's not initially presented with the "added note" other theories are contradicting already with it which is giving me a hard time learning physics so far. So to answer the question: Well, i think if you come with relational database experience which is n-dim - learning string theory first is ... not that stupid. Maybe encouraging people to try this route wo…

  > learning string theory first is ... not that stupid
I disagree, it would be stupid to start with ST. I think you're making judgements without fully understanding what the conclusions entail. This requires so much more complexity that doesn't matter for 99.9% of things. We leverage emergence because it allows us to drop complexity at different levels.

For a different look maybe check out Wolfram's Metamathematics, since it's arguably a candidate for a ToE. Or think about learning math by stating at ZF set theory. I think you might think this is fine at the beginning but are going to quickly hit a wall.

And remember that GA also has lots of limitations. Don't forget that just because you're advancing doesn't mean you've gotten to the beginning.

Re: Physically based rendering from first principles

#74

Earlier quoted context omitted.

The author went down to the electromagnetic wave theory of light. How much more “first principles” could this article be!?

Agreed - OP's criticism is way over the top. This blog post is very much "first principles" for the layperson. It's not the level of "first principles" that a trained physicist would expect (where there would be rigorous derivations involving dielectric functions and the like), but it's great for a layperson who wants to understand why the world looks the way it does.

So then, why use that phrase and not a more accurate one?

Re: Physically based rendering from first principles

#75

Earlier quoted context omitted.

Yeah he abuses a lot of phrases... He does provide a master class on psuedointellectualism though. Drops enough vernacular that layman think he's smart and even enough that experts might think they're in good company if they don't pay too close attention. But I think the biggest clue that it's fake is how dismissive he is of nuance and detail. It's such a classic defense from psuedointellectuals because they know if…

> Meanwhile, look at any two nerds arguing. It's always nuanced and over minute things that they'll always insist are very important (because often it is, but only at that level). Sorry, but no, nerds are huge bikeshedders, and often miss the forest for the trees. I think this also explains how dismissive you are of experts who have actually worked with Musk and don't seem to share your low opinion of his expertise i…

  > nerds are huge bikeshedders
How can you judge if it is bikeshedding or actual warranted issues if you don't have expertise?

Think about it this way, every big problem can be broken down into a bunch of much smaller problems, right? That's generally how we solve things. So obviously small problems come together to create big problems. The main difference between an expert and a novice is the ability to see how these small things interact. So, how do you, as a non-expert, know if the nuance is unimportant or important?

  > how dismissive you are of experts who have actually worked with Musk and don't seem to share your low opinion of his expertise in certain areas.
Experts currently working with him or experts who used to work with him? I think you're using a really weird bias. People that are paid by him are suckups? Why is that surprising? Especially when he's known for firing people who are critical of him. Did you forget that whole thing when he bought twitter[0]? Not to mention the other founders of Tesla talking about how he was not an actual founder or SpaceX employees saying he doesn't understand rockets, or AI people saying he doesn't understand AI. But of course he doesn't, he's been promising fully autonomous self-driving cars "next year" since like 2014. No sane ML expert will tell you such a thing is possible, even now. Sure, your Reddit Armchair expert will make the claim, but who cares, they don't actually know anything.

[0] https://www.businessinsider.com/elon-musk-twitter-fire-staff...

Re: Physically based rendering from first principles

#76

Earlier quoted context omitted.

> Meanwhile, look at any two nerds arguing. It's always nuanced and over minute things that they'll always insist are very important (because often it is, but only at that level). Sorry, but no, nerds are huge bikeshedders, and often miss the forest for the trees. I think this also explains how dismissive you are of experts who have actually worked with Musk and don't seem to share your low opinion of his expertise i…

> I think this also explains how dismissive you are of experts who have actually worked with Musk and don't seem to share your low opinion of his expertise in certain areas. It is difficult to get a man to understand something, when his salary depends on his not understanding it. --- I think there's also something of a "gell-mann amnesia" effect going on here. I could buy him being a manufacturing genius or whatever…

I think it is more that he fires people who criticize him. That happened when he bought Twitter, so I'm not surprised people are cautious.

Good use of Gell-Mann Amnesia too. I have started using it as a litmus test of sorts. When I encounter a new source I'll go look for something I have domain expertise in. If it seems accurate enough, I'll tend to trust domains I don't have expertise in. If it is inaccurate, I just don't trust them. Actually this is also a strategy I suggest people use with chatbots, as sometimes small details can be critical while other times they are inconsequential. Since the chatbots are not great at nuances this tends to be a good check, but the difficulty is ensuring you prompt as naively as you would in a subject you're less knowledgeable in.

Re: Physically based rendering from first principles

#77
post #45

Earlier quoted context omitted.

Lol apparently reasoning by analogy is first principles to him -- see human drivers using only vision therefore no lidar somehow being "first principles".

Maybe I missed it, but I've never seen him claim that using only vision is "first principles" thinking. However, relying only on vision can make sense once you realize that roads and signage and everything is literally designed around vision. Any system that does not prioritize vision cannot deal with unexpected obstacles, like new signage. If your vision is good enough to see obstacles and understand signage, the ad…

Lidar is cheap now.

But no, roads are not designed with just vision in mind. Designers use tecture not just for grip but to help communicate things to the driver. There's many subtler ones, but the most obvious one is the grooves you often find on the edge of highways that are used to warn you if you're veering off. This vibrates the car and creates a loud noise. That's two more senses that you're constantly using while driving even if you don't recognize it. Sure, I wouldn't rely on smell, but it is also a useful sense for some diagnostics and may help in some edge cases. But my point is that we're not just vision based creatures. You think about vision more, but the others are very important.

Re: Physically based rendering from first principles

#78

Earlier quoted context omitted.

Sure! And I appreciate the response. I hope I didn't come off as too mean, it can be hard to find that balance in text, especially while criticizing. I really do not want to discourage you, and I think you should keep going. Don't let mistakes stop you. > Let's suppose the aim of the article was indeed to learn PBR from first principles, what would it look like? I think you shouldn't go that route, but the most hones…

> But the thing is that there's a weird relationship between computation and accuracy. I like to explain this looking at a Taylor Series as an example. Our first order approximation is usually easy to calculate and can usually get us a pretty good approximation (not always true btw). Usually much more than 50% accurate. Second order is much more computationally intensive and it'll significantly increase your accuracy…

I'm not sure what you exactly mean. But if you are interested in the problem in general I think any book on computational physics will make you quickly face this constraint. There's a reason people love first order methods like Euler but why second or higher order methods are needed in other situations. Or maybe you could look at second order gradient descent methods as they apply to machine learning (add "Hessian" to your search). You'll see there's some tradeoffs involved. And let's just note that through first order methods alone you may not be able to even reach the same optima that second order methods can. Or you could dig into approximation theory.

But I think first I'd just do some Taylor or Fourier expansions of some basic functions. This can help you get a feel of what's going on and why this relationship holds. The Taylor expansion one should be really easy. Clearly the second derivative is more computationally intensive than the first, because in order to calculate the second derivative you have to also calculate the first, right?

Mind you there are functions where higher order derivatives are easier to calculate. For example, the 100th derivative of x is just as easy to calculate as the second. But these are not the classes of functions we're usually trying to approximate...

Re: Physically based rendering from first principles

#79

Earlier quoted context omitted.

> But the thing is that there's a weird relationship between computation and accuracy. I like to explain this looking at a Taylor Series as an example. Our first order approximation is usually easy to calculate and can usually get us a pretty good approximation (not always true btw). Usually much more than 50% accurate. Second order is much more computationally intensive and it'll significantly increase your accuracy…

I'm not sure what you exactly mean. But if you are interested in the problem in general I think any book on computational physics will make you quickly face this constraint. There's a reason people love first order methods like Euler but why second or higher order methods are needed in other situations. Or maybe you could look at second order gradient descent methods as they apply to machine learning (add "Hessian" t…

Touching on what you were saying about accuracy converging like a log-like curve while computation increases exponentially, do you have an example where increasing computational resources by ten times leads to, say, only a 20% improvement in accuracy?

Re: Physically based rendering from first principles

#80
post #28

Earlier quoted context omitted.

I wrote everything from scratch in javascript and webgl. You can check the entire source code of the article here: https://imadr.me/pbr/main.js Beaware though, it's a 8000+ lines of code js file that is very badly organized, it's by no mean a reference for good quality code. However I find writing everything by hand easier in the long term than using already existing libraries for example. The code includes all the m…

How long did it take you to write that code / this article? I'm a big fan of zero-dependency code (or at the very least with any dependency vendored/hosted locally), it means this page will still work and look as it does today in 25 years time. I don't know if TS runs natively in browsers yet, but v8 / NodeJS does support it (just strips off Typescript specific tokens).

I took me about 3 months working on it on and off, it amounts to about 3 weeks of full time work. For my other projects I'm just writing everything to a single typescript file and compiling it with tsc, works like a charm and zero dependencies!
Post reply on HN