Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 11, 2022 10:04:34 GMT -5
Yeah, and lossless data compression is just another type of lossy compression when the coefficent of data loss equals zero for all possible inputs.
|
|
|
Post by ketmar on Mar 12, 2022 0:51:22 GMT -5
@vigilantdoomer, there is no way to properly render voxel objects without converting them to 3d models (at least without radically bumping GPU requirements, and writing a brand new shader-based voxel engine). so voxels are converted to 3d models, hence they treated like any other 3d models, and described as such. i see it as a nice thing, because there is no need to learn different syntaxes to add different kind of 3d objects to the game.
the only bad decision was choosing XML for model description format. but that's what Janis did, and i don't feel like introducing another syntax will help (i have to keep XML format anyway, to not break compatibility with the existing Vavoom projects).
|
|
|
Post by ketmar on Mar 14, 2022 4:34:59 GMT -5
dammit! it's hard to live in two houses! so here's the screenshot: something GZDoom cannot do without DECORATE magic. k8vavoom can do it only with model definitions. this is 2-voxel objects: each lamp has a translucent "glass" object, and both voxels attached to one sprite frame. technically GZDoom can do this too, but you cannot describe this with VOXELDEF (nor with MODELDEF). Vavoom model definition is way more flexible and powerful. the only negative side is XML format. ;-)
|
|
Lobo
Doomer
Posts: 594
|
Post by Lobo on Mar 14, 2022 5:54:06 GMT -5
Did you ever get around to defining a range of frames instead of having to do them one by one? For md2 models I mean.
|
|
|
Post by ketmar on Mar 14, 2022 6:39:51 GMT -5
Did you ever get around to defining a range of frames instead of having to do them one by one? For md2 models I mean. sure. with end index, inclusive: <frame index="0" end_index="7" /> defines 8 frames. counted: <frame index="0" count="8" /> defines the same 8 frames. also, in the current HEAD, you can omit model name in "state" tag, if you have only one model defined.
|
|
Lobo
Doomer
Posts: 594
|
Post by Lobo on Mar 14, 2022 12:42:29 GMT -5
Excellent!
Need to experiment with it one of these days.
|
|
|
Post by ketmar on Mar 15, 2022 13:13:01 GMT -5
so, i implemented Very Experimental Voxel Optimiser. before (look at the FPS number): after (look at the FPS number again): the price for that is The Infamous Space Ants. i.e. voxel models can have occasional flickering white pixels. there is nothing i can do with it: adding more vertices to get rid of "space ants" will bring FPS down to unoptimised mode again. but optimisation level is selectable from the video options menu (requires engine restart), so you can trade quality for speed, as usual. for those who are interested: normal conversion method (used by DelphiDoom, and i believe by GZDoom too) is to create one quad for each visible voxel side. this gives the perfect image quality, but even the simple object like armor has ~4800 triangles. in optimised model, the engine tries to merge horizontal or vertical quad runs, so the same armor model has only ~1400 (or ~1300 with even more optimisations) triangles. but this optimisation creates T-junctions, and hence Space Ants. adding vertices at each T-junction will bring vertex and triangle numbers almost back to the unoptimised numbers, so Space Ants will not go anywhere. they aren't that much noticeable, though.
|
|
|
Post by ketmar on Mar 16, 2022 15:04:15 GMT -5
fun fact: most KVX objects has some invisible voxel faces marked as visible. Boss Cube from reikall, for example, is empty inside, but its contour voxels marked as "visible from inside", and the engine has to create triangles for the faces the player could never see anyway. i implemented visible face recalculation algorithm, and the result is:
before: 11065 unique vertices, 5556 triangles
after: 9587 unique vertices, 4820 triangles
it may not look like a big improvement, but using this algo i managed to get almost +2 FPS on the test scene.
|
|
|
Post by ketmar on Mar 17, 2022 13:44:17 GMT -5
good optimisations can make wonders! t-junction fixing time on quite a big voxel model decreased from 28 seconds to 31 milliseconds. it is basically O(n) now (where `n` is the total number of edges).
it is also now possible to change voxel optimisation mode without restarting the engine.
|
|
|
Post by DooMAD on Mar 17, 2022 18:27:10 GMT -5
Nice work. Glad to see more projects carrying the metaphorical torch.
|
|
|
Post by ketmar on Mar 17, 2022 18:46:18 GMT -5
Nice work. Glad to see more projects carrying the metaphorical torch. thank you! by the way, i created Doom Voxel Project conversion for k8vavoom (as you may already guessed from the screenshots ;-). it is still WIP, but i should stabilize the things for the next public build. i see that you have some… relation ;-) to DVP site, so maybe you'll be able (and willing, of course) to upload that voxel pack when it will be ready?
|
|
|
Post by DooMAD on Mar 18, 2022 18:15:03 GMT -5
i see that you have some… relation ;-) to DVP site, so maybe you'll be able (and willing, of course) to upload that voxel pack when it will be ready? Yeah, sure. I'm pretty lazy and never seem to get around to updating the site of my own volition. But when someone gives me a nudge to do something then I usually do it. Keep me posted.
|
|
|
Post by ketmar on Mar 18, 2022 20:25:43 GMT -5
i simply can't stop. tried Yet Another Voxel Conversion Algo, which is slightly slower on startup (still almost instant for DVP voxels, tho ;-), and managed to make triangle count even smaller: it can cut from 100 up to 1000 triangles sometimes.
if you're interested, even the simpliest k8vavoom converter is much better than the one in GZDoom. GZDoom is able to merge only voxels in vertical runs ("slabs") that have the same color. even the most simple k8vavoom converter creates one quad for any number of slab voxels regardless of color. more advanced converter can create such runs in 4 directions, not only vertical. and the new algo is able to merge voxels on any plane into even bigger quads. i believe that this is the best (almost) real-time voxel -> 3d mesh converter among all existing "retro" 3d engines. because i am smart as… ahem, nevermind.
|
|
|
Post by ketmar on Mar 19, 2022 13:32:34 GMT -5
just for fun: standalone converter (my testbed), in "ultra" mode, with t-junction fixer. the famous Voxlap test scene, fully converted: some stats: loading: _vox00/untitled.vxl (with normals) xsiz=1024; ysiz=1024; zsiz=256 loaded in 938ms; grid size: 1024x1024x256 fixed 1825756 voxels optimised in 32.244 building slabs... *** created compressed voxel data; 33584853 bytes for 1024x1024x256 ATLAS: resized from 8x8 to 16x16 ATLAS: resized from 16x16 to 16x32 ATLAS: resized from 16x32 to 32x32 ATLAS: resized from 32x32 to 256x64 ATLAS: resized from 256x64 to 256x256 ATLAS: resized from 256x256 to 256x512 ATLAS: resized from 256x512 to 512x512 ATLAS: resized from 512x512 to 1024x1024 ATLAS: resized from 1024x1024 to 1024x2048 ATLAS: resized from 1024x2048 to 2048x2048 *** ultra conversion done in 1:54.856 basic conversion: 498462 quads (996924 tris). converted in 2:00.767; optlevel is 4/4 color texture size: 2048x2048 498462 quads, 996924 tris, 1993848 unique vertices (of 1993848) OpenGL data created in 1.021 334031 unit quads found. 1993848 edges found (996924 tris, 1993848 verts)... vox dims: (-733,-610,-141)-(290,413,109) grid size: (1024,1024,251) 180130 t-fix vertices added (180130 unique). rebuilt model: 1188394 tris, 2179648 vertices. t-junctions fixed in 420ms fixed tris: 1188394
|
|
kvsari
Doomer
I like mapping.
Posts: 327
|
Post by kvsari on Mar 19, 2022 20:12:56 GMT -5
just for fun: standalone converter (my testbed), in "ultra" mode, with t-junction fixer. the famous Voxlap test scene, fully converted: some stats: loading: _vox00/untitled.vxl (with normals) xsiz=1024; ysiz=1024; zsiz=256 loaded in 938ms; grid size: 1024x1024x256 fixed 1825756 voxels optimised in 32.244 building slabs... *** created compressed voxel data; 33584853 bytes for 1024x1024x256 ATLAS: resized from 8x8 to 16x16 ATLAS: resized from 16x16 to 16x32 ATLAS: resized from 16x32 to 32x32 ATLAS: resized from 32x32 to 256x64 ATLAS: resized from 256x64 to 256x256 ATLAS: resized from 256x256 to 256x512 ATLAS: resized from 256x512 to 512x512 ATLAS: resized from 512x512 to 1024x1024 ATLAS: resized from 1024x1024 to 1024x2048 ATLAS: resized from 1024x2048 to 2048x2048 *** ultra conversion done in 1:54.856 basic conversion: 498462 quads (996924 tris). converted in 2:00.767; optlevel is 4/4 color texture size: 2048x2048 498462 quads, 996924 tris, 1993848 unique vertices (of 1993848) OpenGL data created in 1.021 334031 unit quads found. 1993848 edges found (996924 tris, 1993848 verts)... vox dims: (-733,-610,-141)-(290,413,109) grid size: (1024,1024,251) 180130 t-fix vertices added (180130 unique). rebuilt model: 1188394 tris, 2179648 vertices. t-junctions fixed in 420ms fixed tris: 1188394
That's impressive! I played around with voxlapp and the other voxel demos from Kevin Silverman many years ago. It's cool to see this show up again.
|
|
|
Post by ketmar on Mar 19, 2022 20:24:11 GMT -5
thank you! just in case: this isn't any "voxel engine", this is the development testbed for voxel model -> polygon model converter for k8vavoom. of course, nobody would use such huge voxel models in Doom, but hey, if i can make my conversion code fast on THIS… i love to test my algos on data nobody in their sane mind will feed to them. ;-)
fun fact: my old GT 720 GPU can easily render this whole scene (all 1188394 triangles) with 35 FPS. ;-)
but the most important thing here is that i have the tested (i hope ;-) code to perform near-optimal voxel conversion. i believe that my code produces the smallest models (in triangle count) among all "retro FPS engines" that support KVX/KV6 voxels, and it can fix visual "cracks" too. and it does this for DVP/reikall voxels in less then a millisecond per model.
at least i inspected GZDoom code, and it can't come even close to my results. ;-) (and it doesn't even try to fix t-junctions, but can introduce them.)
|
|
kvsari
Doomer
I like mapping.
Posts: 327
|
Post by kvsari on Mar 19, 2022 21:06:23 GMT -5
thank you! just in case: this isn't any "voxel engine", this is the development testbed for voxel model -> polygon model converter for k8vavoom. of course, nobody would use such huge voxel models in Doom, but hey, if i can make my conversion code fast on THIS… i love to test my algos on data nobody in their sane mind will feed to them. ;-) fun fact: my old GT 720 GPU can easily render this whole scene (all 1188394 triangles) with 35 FPS. ;-) but the most important thing here is that i have the tested (i hope ;-) code to perform near-optimal voxel conversion. i believe that my code produces the smallest models (in triangle count) among all "retro FPS engines" that support KVX/KV6 voxels, and it can fix visual "cracks" too. and it does this for DVP/reikall voxels in less then a millisecond per model. at least i inspected GZDoom code, and it can't come even close to my results. ;-) (and it doesn't even try to fix t-junctions, but can introduce them.) That's super cool. So your code converts the volumetric pixels into cubes and then merges the faces of adjacent cubes into larger and larger rectangles. You end up with a polygonal representation of the voxel model in the least amount of triangles needed. The challenge you've been mentioning is culling the rectangles which would be generated from the cube faces that are not visible?
|
|
|
Post by ketmar on Mar 19, 2022 21:42:57 GMT -5
So your code converts the volumetric pixels into cubes and then merges the faces of adjacent cubes into larger and larger rectangles. You end up with a polygonal representation of the voxel model in the least amount of triangles needed. yes, exactly this. The challenge you've been mentioning is culling the rectangles which would be generated from the cube faces that are not visible? nope, that's the easiest part. ;-) actually, KVX/KV6 already contains this info. but… but it is sometimes wrong, and has some invisible faces marked as visible. so i implemented my own "hollow fill" code, which leaves only exterior faces, properly marked. as a consequence, my code can load any voxel format, in any order: it will convert that into the internal voxel representation. the actual challenge is finding the best rectangle decomposition. doing that with brute force is something around O((X*Y*Z*6)*(N*M)). in other words, it is FUCKIN' SLOW. my first iterations converted that voxlap thingy in ~40 minutes. and the current code does it in less than 2 minutes. it can optionally fix t-junctions too. tbh, i can do it even faster, but that will require adding at least the same amout of code i already wrote, and won't cut the time to seconds anyway. so i decided to stop here. for normal voxel models it is almost instant, and i'm ok with that. also, the code is basically a self-contained library, that can be used in any engine with minimal modifications. so once i put it into the repo, other engines will be able to take and use it too. the final result of the library is vertex/indicies data and color texture, ready to be uploaded to GPU.
|
|
Lobo
Doomer
Posts: 594
|
Post by Lobo on Mar 20, 2022 3:36:18 GMT -5
|
|
|
Post by ketmar on Mar 20, 2022 9:07:17 GMT -5
Item voxel pack, you've probably seen it already. thank you! no, i didn't not really looked for voxel packs, just took what i knew about… i know about DVP, and that's basically all. and i was told about reikall. now about this too, will take a look, thank you again! ;-) btw, beta of voxel conversion code is in the repo. you may consider stealing it for your great EDGE. it is in "source/render/modelparse/voxelib.*". i really want people to start using this code for voxel conversion, because it hurts me to see various sub-par methods. #trianglecountmatters! p.s.: of course, i may improve it in the future, and make it completely independent even of corelib. for now, the code is using `TArray` and `TMap` (basically, `std::vector` and `std::map`) from k8vavoom core library. but that's mostly all, and i think i can implement very simple hash table and dynarrays right in the lib code, because why not… ;-)
|
|
Lobo
Doomer
Posts: 594
|
Post by Lobo on Mar 20, 2022 14:50:32 GMT -5
Cheers, I'll keep it in mind. Not a pressing feature for EDGE at the moment: lots of other stuff to be implemented first...
|
|
|
Post by ketmar on Mar 20, 2022 15:16:53 GMT -5
Cheers, I'll keep it in mind. Not a pressing feature for EDGE at the moment: lots of other stuff to be implemented first... :( still, i made "voxelib" usable as a standalone library now. it includes KVX/KV6 loaders too. and you don't need neither other k8vavoom libraries, nor even STL to use it! ;-) as for voxel support, it is quite easy to implement them as Yet Another Kind Of 3D Models, as i did. so you only need to get my library, and you will get a skin texture, and a triangle soup, which you could simply copy to your data structures. and BOOM! EDGE has voxel support, and you can write a HUGE ANNOUNCEMENT! ;-)
|
|
Lobo
Doomer
Posts: 594
|
Post by Lobo on Mar 20, 2022 17:11:15 GMT -5
I'll admit it's tempting as a "poor old EDGE has better voxel support than gzdoom!" thing... 😉
We'll see. We've still got a lot to do before next release still, so who knows.
|
|
|
Post by ketmar on Mar 20, 2022 17:16:13 GMT -5
I'll admit it's tempting as a "poor old EDGE has better voxel support than gzdoom!" thing... 😉 that would be a golden topic title! ;-) We'll see. We've still got a lot to do before next release still, so who knows. sure. anyway, the thing is still red hot, so it would be wise to wait a little until i iron out all the bugs i'll spot. ;-)
|
|
Lobo
Doomer
Posts: 594
|
Post by Lobo on Mar 20, 2022 17:24:59 GMT -5
Compared to md2 rendering, are voxels much better in performance?
|
|