Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cmovq
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
61.
▲
by
cmovq
1y ago
> gl.drawArrays(gl.TRIANGLES, 0, 6); Using 2 tris for this isn’t ideal because you will get duplicate fragment invocations along the horizontal seam where the triangles meet. It is slightly more efficient to use one larger triangle exte
62.
▲
by
cmovq
1y ago
Interestingly, a complete implementation of strtol [1] is shorter than this wrapper. If you don't like strtol's API or error handling, just implement your own. [1]: https://github.com/gcc-mirror/gcc/blob&
63.
▲
by
cmovq
1y ago
> Components are stored in contiguous arrays in a SoA (Structure of Arrays) manner, which allows for fast iteration and processing Does this actually matter in Lua? Aren’t all array elements going to be pointers to heap allocated objects
64.
▲
by
cmovq
1y ago
One thing I noticed is that projects written in Rust always mention it the title (there’s one on the front page right now), compared to other languages that don’t. That probably adds to the numbers
65.
▲
by
cmovq
1y ago
I see this a lot in graphics, where people will for example say to create a view matrix you first create your camera transform and then invert it. When the better solution is to just directly construct the inverted matrix. There is almost n
66.
▲
by
cmovq
1y ago
It doesn’t.
67.
▲
by
cmovq
2y ago
This isn't new. The only C23 feature this article uses is the attribute syntax, but you could just use `__attribute((cleanup(F)))` instead.
68.
▲
by
cmovq
2y ago
PRNGs are insecure by design, why does this article frame the problem as the implementation being insecure? Applications shouldn’t use PRNGs if they need a true random source to begin with.
69.
▲
by
cmovq
2y ago
This is x86 assembly not C, but could be done just as easily in C. No kernel support either, since there isn’t one. https://github.com/stillwwater/raycaster
70.
▲
by
cmovq
2y ago
The BSP file stores faces, which define a number of edges (or vertices). Faces are used in rendering, and contain the texture being drawn. Faces also refer to a plane and a “side”. If the side is 1, the normal of the plane is flipped which
71.
▲
by
cmovq
2y ago
> I never dove into the subject enough to figure out if this plane representation was also internal to the compiled bsp format, but I suspect it is. Not exactly. The BSP format stores planes as a normal (3 floats) + distance to the origi
72.
▲
by
cmovq
2y ago
BSPs (or CSG in general) is still present even in modern engines due to how quickly it allows designers to build levels. Even when it’s only used for prototyping prior to an art pass.
73.
▲
by
cmovq
2y ago
> However, (as far as I can tell) Go’s compiler does not utilizes simd Can someone confirm this? Not even for straightforward copies?
74.
▲
by
cmovq
2y ago
Looks like it was introduced with Haswell (2013). So it’s safe to use if you’re also compiling with AVX2.
75.
▲
by
cmovq
2y ago
In games it’s common to have a tone mapping step [1] to map the HDR image to sRGB while maintaining pleasant colors. The exposure parameter is usually dynamically chosen by using the average brightness of a previous frame. [1]: http:/
76.
▲
by
cmovq
2y ago
It produces a warning for incompatible pointer types.
77.
▲
by
cmovq
2y ago
Note that the lua VM still optimizes tables that look like arrays by storing values in the array separate from the hash table [1]. [1]: https://www.lua.org/gems/sample.pdf
78.
▲
by
cmovq
2y ago
We should focus on less harmful energy production rather than limiting energy use and inhibiting progress
79.
▲
by
cmovq
2y ago
Take a look at a real engine, something like vkquake is a good reference [1]. [1]: https://github.com/Novum/vkQuake
80.
▲
by
cmovq
2y ago
It’s actually quite common to use a 24bit fixed point format for the depth buffer, leaving 8 bits for the stencil buffer. GPUs do a lot of fixed point to float conversions for the different texture and vertex formats since memory bandwidth
81.
▲
by
cmovq
2y ago
I can understand banning it. It’s important to understand std::string is more of a string builder implementation, which is rarely what you want, but people treat it as the default way to handle strings in C++. Too often I have to fix code t
82.
▲
by
cmovq
2y ago
First thing I noticed in the demo is the lasers casting shadows on the ground. Which doesn’t make any sense
83.
▲
by
cmovq
2y ago
One of the criticisms of this device is that it would have made more sense as an app on your phone. The fact that it is already implemented as just an app makes the point all the more valid. My only guess is that the physical device adds so
84.
▲
by
cmovq
2y ago
C/C++ is valid if it uses a subset of C that is also valid C++ and would compile with a C++ compiler.
85.
▲
by
cmovq
2y ago
Having separated GPU memory also has its benefits. Once the data makes it through the PCIe bus, graphics memory typically has much higher bandwidth which also doesn’t need to split with the CPU.
86.
▲
by
cmovq
3y ago
> Part of the problem is that many of the concepts OpenGL teaches you have no bearing on how modern hardware actually works This is definitely true, but newer OpenGL gives you indirect rendering and bindless textures which is about as go
87.
▲
by
cmovq
3y ago
I don’t understand why people bother with complex build systems for small C projects. Here is a C build system: cat all.c #include "foo.c" #include "bar.c" #include "main.c" clang all.c
88.
▲
by
cmovq
3y ago
I don’t know that it was the only reason, but Carmack’s push for OpenGL certainly helped. A lot of things related to 3D games are thanks to doom and Quake.
89.
▲
by
cmovq
3y ago
What surprised me about Tracy was just how easy it was to include in a C++ project. Just compile and link a single .cpp file (TracyClient.cpp)
90.
▲
by
cmovq
3y ago
I recently fixed some code that was doing the incorrect comparison with this alternative which avoids the overflow and is also branchless [1]: return (a > b) - (a < b); [1]: https://godbolt.org/z/EnqsTr1j
More ›