[9th Juny]
VladVP wrote:LeCom wrote:Ah kk, so you mean abusing the GPU as a CPU, not using the GPU's rendering algorithms for drawing voxels. That's something different, indeed.
Well, I don't really know much about that; how useful it could be depends on what the GPU can do. In general, usually many games have problems with GPUs not supporting a super new command used in the game(the reason why openspades with OpenGL doesn't run on many PCs at all), so adding complex stuff that depends on special commands might be a problem.
However, I had the idea of moving the shading code from gline to hrend, so a lot of slow stuff is on 1 small spot, which would make accelerating measures, like SIMD or your idea, more effective and easy to add. The slowest functions are hrend****, gline and dmulrethigh, (whose bit shift is useless btw and the subtraction can be replaced by a comparison), others don't matter; dmulrethigh in gline can be replaced by prediction, so we can almost cross both out, leaving hrend**** 's RGB pixel operations as the worst performance eater. GPU commands probably could be added, but I think that SSE would accelerate the Voxlap rendering quite a lot (as SIMD is the best to accelerate RGB commands), and every old rig has SSE. As I said, maybe it's possible to use it for screen anti-aliasing.
Oh, one important thing you are probably forgetting is that modern PCs that support such GPU stuff already achieve a very good performance on .75, just because technology improved over time, especially RAM. DDR3 probably can double the framerate compared to DDR2.
I didn't say we had to use it. I said that we could use it as a last resort if everything else fucks up in terms of performance.
Yeah, you're right. I must have forgot that you only want it as a last option, sorry.
VladVP wrote:LeCom wrote:Right now, I really only have one important question that I can't answer on myself: Wtf does drawboundcube do? Or at least, how does it find out the x and y screen position, or the x, y and z position of the kv6 voxel?
Listen, when you stumble upon someone else's code that is impossible to understand, you rewrite the shite. No bullshit. If you are confused about how something works, try converting the assembly to pseudocode function consisting of consistent expressions. Trust me, as long as you know what the inputs represent, it becomes fully clear what exactly it does.
Well, I have absolutely no experience with ASM. I could try reverse-engineering "normal" x86 assembly, but more than half of that function is using MMX/SSE commands, and reverse-engineering SIMD is harder. Also, my problem IS that I don't know what every input should be; I know what the arguments are for, however, it is accessing weird global arrays whose entries seem to represent something different each. It's actually possible to understand how Voxlap works, as long as it's written in C.
But you can kinda forget that crap, I just wrote a function that draws a pixel for every block of a kv6 sprite (from one side, no rotation), so it's possible to access the kv6 voxel data. I think it's better to write my own kv6 raycaster, than trying to get that half working shit running. That may be a bit slower and look crappy, but it might be possible to improve it.
_____________________________________________________________________________________________________________
[10th Juny]
***Progress***
Ok, so I made it render KV6, but it is still far from being ready.

KV6_Renderer.png (51.1 KiB) Viewed 11849 times
I have to add KV6 rotation (some math shit), and make it not render blocks that are behind other blocks (you see a grey line in the intel, which actually shouldn't be rendered). It's actually not as slow as I thought, even that version, which is supposed to be extremely slow, and it looks as good (I mean bad) as Voxlap's kv6 renderer ^^