I wanted to learn more about computer graphics, so I'm writing a 3D software renderer in C. So far I have a solid implementation of triangle rasterization, perspective projection, depth buffer, clipping, texture mapping, diffuse lighting, and gamma correction. Currently struggling with shadow mapping, which is the last feature I'll add to the renderer before moving on to procedural generation of meshes and textures.
Once I'm done with this project I'm planning on making a series of YouTube videos going into the code and the algorithms.
I got this itch too when I came across tinyrenderer [1] and worked through the early lessons through shading, but didn't quite finish the texture mapping yet [2]. It was fun to work in pure C from first principles, even side-questing to write a simple TGA file reader and writer.
I'd be very interested to see your tutorial when it's done!
It's not primarily a lifestyle issue, and the problem is no longer primarily developed countries. Per-capita carbon emissions in developed countries have decreased 30% in the past 20 years, and energy demand has remained relatively constant, in fact decreasing slightly in some places due to increases in efficiency. Meanwhile, developing countries like China and India are projected to account for 35-40% of total global emissions in the next decade, far outweighing the impact of individual lifestyle choices in the West.
Of course, people should do everything they can to reduce or offset their own emissions. But the solution is going to have to be societal, keeping up with energy demand by adding more nuclear, solar, and wind to the grid.
> Meanwhile, developing countries like China and India are projected to account for 35-40% of total global emissions in the next decade, far outweighing the impact of individual lifestyle choices in the West.
Sure, but that's still mostly driven by Western demand for... Stuff. I'd like to see that share of global emissions if the West was still industrialised and didnt rely on China to be its factory
80% of China's manufacturing output is consumed domestically. Of the goods exported from China, only about 15% go to the United States. While that still represents a lot of exports in absolute terms, it's simply false to say that it's "mostly driven by Western demand for stuff".
What do you mean they have to comply? If something was already in a contract they agreed to, sure. But there is nothing legally forcing private companies to do business with the DoD, short of the government forcibly nationalizing them.
You shouldn't conflate a pop science magazine with all of modern journalism. Try a high quality outlet like The Economist. "I try not to read any news articles" screams anti-intellectualism.
The GP has a point about the state of journalism generally and the pervasive nature in which Yellow journalism is returning.
One need not be anti-intellectual to find the state of reporting to be difficult to deal with and not wanting to read it. In addition to the GP’s complaint; journalists of any ilk also tend to conflate editorializing with reporting. You see this all the way from pop science to NYTimes to Fox News and yes even the Economist.
A question is whether the more fact based reporting of the early-mid 20th Century is the exception to the tendency of Yellow journalism that existed before and seems to exist now.
I get by without modules or header files in my C++ projects by using the following guidelines:
- Single translation unit (main.cpp)
- Include all other cpp files in main
- Include files in dependency order (no forward declarations)
- No circular dependencies between files
- Each file has its own namespace (e.g. namespace draw in draw.cpp)
This works well for small to medium sized projects (on the order of 10k lines). I suspect it will scale to 100k-1M line projects as long as there is minimal use of features that kill compile times (e.g. templates).
You still organize the big file into sections to keep things together that are semantically related. For Git it mostly doesn't matter whether it's 100 small files or a single big one.
Reid Hoffman seems to be one of the few SV founders with a spine. The rest are content to do business with authoritarian regimes as long as profits keep flowing.
Why is this article flagged? It's directly relevant to the readers of HN.
This is a nuanced point that anti-science people often get wrong.
The existence of fraudulent studies, dishonest researchers, the replication crisis, etc. does not invalidate science as an institution. It just means we need to be careful about distinguishing between individual opinions and the scientific consensus. We also need to keep in mind that the consensus is never 100% correct; it's always subject to change and we need to update our beliefs as new evidence comes in.
Ironically, being anti-science is pro-science. Skepticism of institutions and consensus is the scientific method.
The main reason being scientific consensus can lag reality significantly, especially when career incentives discourage dissent. The history of science includes many cases where consensus was wrong and critics were marginalized rather than engaged.
Deference to science as an authority is the opposite.
Feynman has a quote on this:
"Science is the belief in the ignorance of experts. When someone says, 'Science teaches such and such,' he is using the word incorrectly. Science doesn't teach anything; experience teaches it. If they say to you, 'Science has shown such and such,' you might ask, 'How does science show it? How did the scientists find out? How? What? Where?' It should not be 'science has shown' but 'this experiment, this effect, has shown.' And you have as much right as anyone else, upon hearing about the experiments — but be patient and listen to all the evidence — to judge whether a sensible conclusion has been arrived at."
Somewhere there's a quote about how the old guard has to literally die out before certain new ideas can take root; even if the new idea is obviously correct.
I think we've been pampered by a few hundred years of rapid "scientific advancement" and now we're firmly in the area where things are not grade-school science fair easy to see or prove.
"A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die and a new generation grows up that is familiar with it." - Max Planck
>Ironically, being anti-science is pro-science. Skepticism of institutions and consensus is the scientific method
skepticism is necessary, but not sufficient.
if they merely nay-say institutions and then go with their gut, it's certainly not.
only when someone attempts to rationally disprove a position, offering alternate testable theories and actually performing those tests is science done.
if you suspect an institution is wrong, that's fine, but it's just a hunch until someone does a test.
I was a witness of wrong prescribing medication by doctors many time. For example Novalgin for mother releasing from hospital after painful birth. This medicament is not suitable for breastfeeding mothers!
> Skepticism of institutions and consensus is the scientific method.
Which is why one of the core tenets of practicing Science is “trust, but verify”.
Science is based on the trust of what came before.
But the fallible, ego-driven, and dishonest nature of humanity means that trust alone cannot be relied upon. Hence the “but verify”. That is why replication studies and falsification tests exist - to cull that which cannot be reliably replicated.
Unfortunately, capitalism has stepped in and f*ked up even that, when for-profit universities who rely on public funding place “publish or die” mandates on researchers. This makes any repeat experiments untenable because it takes researchers away from publishing new data. So they just cite prior papers and chase the latest shiny -- because their continued employment is predicated upon publishing.
We have perverse incentives in place that have distorted science, sure. And almost all of these distortions come directly down to a violently coercive economic system that forces you to be profitable to someone else least you suffer homelessness, destitution, and even death.
But what else is there? Belief in an insane, evil, and omnicidal sky-daddy?
Sorry, but no. We should counteract the sources of distortions by crushing capitalism and the corrosive influence of money, not switching over to systems that have always proven themselves to be supremely untrustworthy.
Skepticism needs to be calibrated based on the weight of the evidence. There's a broad spectrum from being skeptical about the latest overhyped study in subfield X to being skeptical about quantum mechanics. If you want to challenge established science, you need to bring the receipts. To quote Carl Sagan, "extraordinary claims require extraordinary evidence".
We can only have "scientific consensus" in maths (and even there there are doubts), every other science is a social science if one digs hard enough. Even particle physics.
It means we need to be careful about distinguishing scientific consensus, and truth. Science can be used to find truth, but that is the science itself, not the consensus.
The mistake is thinking of entertainment as a fungible resource. Film is its own art form. The novel is its own art form. They serve completely different purposes and each gives the audience a unique experience that can't be replicated in any other medium.
It's sad to me that people think like this. It's a very limited and superficial way to experience the world.
Giving a certain number of hours dedicated to passive entertainment, many more people prefer to watch a terrible tv show on Netflix than to read a masterpiece of literature.
It could be because the tv show is more "entertaining" (which is tautological), a desire for social conformity (people can discuss more easily with others the latest tv show than Anna Karenina), or escaping the cognitive effort required when reading literature, which is almost always greater than the one asked for when watching a movie or tv show, or a tiktok.
It's not even about quality. I consider films like There Will Be Blood or TV shows like Deadwood to be comparable in quality to the greatest works of world literature. I've also gotten a lot of joy and entertainment out of reading crappy books.
My problem is with statements like "paper is an inferior entertainment platform". To me, this is assuming that these different media are fundamentally providing the same kind of experience, which I disagree with.
I see your point about the cognitive effort of reading, though. I guess it depends on how fluently one can read, which depends on how much exposure to books one got as a kid.
The problem is that you are talking about your experience, and not about the distribution of experience of people, which is why I wrote "at the population level".
For the more intellectually sophisticated person (does not mean "better" person, to be clear), "entertainment type" is not fungible (movies as art, advertisement as investigation into the psychology of the masses, etc.) but for the vast majority of people, it is just a way to spend time.
You are referring to critically acclaimed movies and tv shows, but for the majority of people, leisure time in front of the tv is not spent bouncing between Fellini, Von Trier, PTA, Kubrick, et similia, but binge-watching the latest terrible Netflix tv show.
It is the same with food: we like to think that what prevents the masses from enjoying fine dining is the cost of the experience, but in reality, to many (myself included, most of the time), French fries with mayonnaise, a burger, and some ice cream is just a better proposition.
I disagree myself wiht the statement that paper is inferior, entertainment-wise, to tv, games, and tiktok--they all overstimulate me, I feel dirty after being on tiktok for 20 minutes and I feel as clean as a whistle after reading for 3 hours, in addition to the subtle intellectual stimulation I get from reading-- but in terms of choices made by people, books are certainly the losing party.
The comment I am responding to is referring to their own experience, which, at the population level, does not appear to be largely shared, as, at the population level (i.e., people in general, not intellectuls, not academics, all of them), it is evident that people consider tv shows, games, and tiktok superior (i.e. revealed preference) forms of entertainment with respect to books.
How was it not clear? I would prefer to engage with more substantive comments.
What's not clear to me is how aggregate preferences about entertainment media should affect my choice of entertainment media. TFA is worded to suggest that because "nobody" reads fiction, it should be dismissed when considering what to read.
I'm perfectly willing to accept that most people prefer Netflix to Umberto Eco. However, I don't. And that is one reason I reject the analysis in the article.
Sure, I don't think anybody is forcing you or anybody else to watch Netflix or play GTA instead of reading a mystery novel.
I find those types of articles and the comments following them to be starting points for broader conversations. In this case, broader than "I like to read books, and I will continue to do so".
As always: use standard libraries first, profile, then write your own if the data indicate that it's necessary. To your point, the standard library probably already uses the OS primitives under the hood, which themselves do a short userspace spin-wait and then fall back to a kernel wait queue on contention. If low latency is a priority, the latter might be unacceptable.
The following is an interesting talk where the author used a custom spinlock to significantly speed up a real-time physics solver.
> which themselves do a short userspace spin-wait and then fall back to a kernel wait queue on contention.
Yes, but sadly not all implementations... The point remains that you should prefer OS primitives when you can, profile first, reduce contention, and then only, maybe, if you reeeally know what you're doing, on a system you mostly know and control, then perhaps you may start doing it yourself. And if you do, the fallback under contention must be the OS primitive
With Windows 10 EOL, I had to decide whether to upgrade my laptop to Windows 11 or Linux. I've been a Windows user for decades, but with all the user-hostile bullshit coming out of Microsoft and the degradation of performance on Windows 11, I decided to go with Ubuntu instead.
I'm still on a Windows 11 desktop for the time being, but seriously considering switching there as well. The main thing stopping me is the undeniably better ecosystem on Windows for professional video editing and music production, with no comparable open-source options. I've spent hundreds if not thousands of dollars on high quality virtual instruments and effects plugins. But if I can manage to run these under emulation on Linux or find equivalent Linux-native versions, I will happily abandon all Microsoft products at this point.
Recommend to split your music workstation from your personal files machine to get some privacy back. Then run cleanup scripts to pare Windows down to the bone. Also Mint over Ubuntu.
Why Mint over Ubuntu? I like the Ubuntu experience out of the box. It seems to handle high-DPI and per-display UI scaling well, due to Wayland. From what I've read, Mint still uses X11.
Once I'm done with this project I'm planning on making a series of YouTube videos going into the code and the algorithms.
reply