HN user

hrydgard

446 karma
Posts1
Comments130
View on HN

Got taught this one in Sweden in the early 90s. Not too surprising though, as much of the Swedish school system used to be modeled on DDR...

Maybe a cache coherency issue, where data written by the CPU is not visible to the GPU, without some kind of explicit cache line invalidation, maybe on both sides? Caveat, I don't know much about the memory system on the XBox but this is a typical issue with homebrew code on consoles.

No Graphics API 7 months ago

Well, it is what is done on several tiler architectures, and it generally works just fine. Normally your computations of the position aren't really intertwined with the computation of the other outputs, so dead code elimination does a good job.

A new PNG spec 1 year ago

What about implementations? libpng seems pretty dead, 1.7 has been in development forever but 1.6 is still considered the stable version. Is there a current "canonical" png C/C++ library?

Function calls are very fast (unless there's really a lot of parameter copying/saving-to-stack) and if you can re-use a chunk of code from multiple places, you'll reduce pressure on the instruction cache. Inlining is not always ideal.

Not sure if you care at this point, given that you stopped working on project, but there's a better way to find the ray direction for each column than using sin/cos for every one, which will also get rid of the slightly warped look:

Calculate the two vectors from the camera at the very left and right of the screen (using your fov angles and sin/cos, that's fine). Then, to find the ray direction vectors for each column, interpolate linearly between your left and right direction vectors, and possibly normalize the resulting vectors if your ray walking algorithm requires it.

This will create a perspective that integrates tightly with sprites that you 3D project the usual way, and lines will stay straight lines.

Pack Z and 32-bit color together into a 64-bit integer, then do an atomic min (or max with reversed Z) to effectively do a Z-query and a write really, really fast.

Nice!

Could save a couple of cycles per iteration by preloading the shift amounts into several GPRs before entering the loop, instead of initializing them just before use.

I think "cover shooter mechanic" refers to ducking behind cover and a system for smoothly shooting from behind it like in Gears of War - or in Winback. This mechanic was not there in Wolfenstein 3D.

You can have a Vulkan driver that only exposes a video decoder queue and no raster/compute/copy queues, not a problem.

There is no good reason to flip the flag dynamically at runtime and apps just don't do that, so flushing the pipeline should be perfectly fine, even in an implementation of the clip control extension.

If you generate the rays the linear way instead, you don't even need any correction.

Generate two points which represent the left and right edges of the screen - you'd put them in at say 45 degrees left and right of the forward vector of the player. Then to generate the direction vector for each column of the screen, just interpolate linearly between those two points, and find the vector from the player to that intermediate point.