Doom monster
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > DelphiDoom progress in 3d perspective in software mode, now with voxel support
Pages (2): [1] 2 »  
Author
All times are GMT. The time now is 16:57. Post New Thread    Post A Reply
jval
Junior Member


Posts: 191
Registered: 09-05


DelphiDoom's fake3d emulation in software rendering mode was an old hack since early versions of the project.

Last days I'm rewriting the module trying to bring it closer to the real thing. Note that this is NOT a true 3d software renderer, all colfuncs and spanfuncs work in the background as always, it's just a post-processing step just before rendering the player sprites and hud.
Progress so far is much more promising compared to the old stuff, faster and better looking.


This is a comparison between latest tests and previous versions:

http://s20.postimg.org/6fqbg4j71/compare01.jpg

One good point of interest is screen buffer without the post processing step of 3d emulation, it looks like this:
http://s20.postimg.org/705citcfh/step03.jpg

The black triangles left and right are because the floorclip (when looking down is ceilingclip) tables are altered to avoid unnecessary drawing. Also the black horizontal lines appears because these particular spans are not drawned to the final output (only spans, not columns).

Last edited by jval on 05-22-13 at 17:59

Old Post 05-04-13 09:36 #
jval is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
_bruce_
Senior Member


Posts: 1278
Registered: 11-07


Interesting + nice job!

Old Post 05-04-13 17:13 #
_bruce_ is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
jval
Junior Member


Posts: 191
Registered: 09-05


Here is a little video with progress so far:

http://www.youtube.com/watch?v=pYnOMg-LClg

Old Post 05-05-13 15:09 #
jval is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
MP2E
Junior Member


Posts: 157
Registered: 09-07


This looks phenomenal! Looking forward to the release.

Old Post 05-11-13 00:33 #
MP2E is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
jval
Junior Member


Posts: 191
Registered: 09-05


Work in progress using voxels for rendering sprites.
Screenshots are using resources from Doom Voxel Project (http://www.doomworld.com/vb/wads-mo...-voxel-project/)

OpenGL Mode:
http://s20.postimg.org/hx48q1x2h/voxel_gl_01.png http://s20.postimg.org/xu30mrpgp/voxel_gl_02.png

Software Rendering Mode:
http://s20.postimg.org/m2f5byuuh/voxel_soft_01.png http://s20.postimg.org/4dnekcj3d/voxel_soft_02.png

OpenGL stuff is almost 100% done, voxel data are converted to an optimized polygon mesh at loadtime giving good rendering performance.

Software rendering stuff still needs some work, some speed optimization (if possible) and some clipping issues to be corrected.

To use the Doom Voxel project you need latest version 1.1.4.580 and follow the instructions inside http://sourceforge.net/projects/del...EF.txt/download file.

Old Post 05-22-13 17:59 #
jval is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 10987
Registered: 07-07


Very impressive. :)

Old Post 05-22-13 18:31 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
schwerpunk
Senior Member


Posts: 2048
Registered: 05-12


VERY impressive. :D

Old Post 05-22-13 20:31 #
schwerpunk is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
esselfortium
A Major Doomworld Concern


Posts: 6482
Registered: 01-02


Oh shit, awesome! Original voxel rendering code?

Old Post 05-30-13 04:54 #
esselfortium is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
jval
Junior Member


Posts: 191
Registered: 09-05



esselfortium said:
Oh shit, awesome! Original voxel rendering code?


In software rendering mode voxels are rendered in a similar manner as sprite columns.
In OpenGL mode are converted to an optimized mesh, i.e. continuous voxel elements with same color are converted to a single polygon.

Here is a video demonstating how voxels look like in software rendering mode with fake3d enabled:

http://www.youtube.com/watch?v=jHGIP8zbUKo

Last edited by jval on 05-30-13 at 17:45

Old Post 05-30-13 14:24 #
jval is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5939
Registered: 08-00


I am intensely interested in the voxel code, since as you may or may not know, Eternity's attempt at implementing was pre-empted very abruptly.

Old Post 05-30-13 15:59 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
printz
CRAZY DUMB ZEALOT


Posts: 8767
Registered: 06-06



Quasar said:
Eternity's attempt at implementing was pre-empted very abruptly.
By what? Incompatible code?

__________________
Automatic Wolfenstein - Version 1.0 - also on Android

Old Post 05-30-13 17:37 #
printz is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
jval
Junior Member


Posts: 191
Registered: 09-05



Quasar said:
I am intensely interested in the voxel code, since as you may or may not know, Eternity's attempt at implementing was pre-empted very abruptly.


In software rendering mode DelphiDoom's approach follow the guidelines of ZDoom more or less, just instead of using directly the kvx data it creates at loadtime similar data (because can also use some other voxel custom formats), and split the vertical columns which create the voxel into fractions of same color:

voxel -> collection of vertical culumns.
vertical column -> collection of single color fractions.

These fractions are rendered with a "colorcolfunc", I thing the same does ZDoom.

Performance is marginal if 100 or more voxels are rendered simultaneously in fullhd resolution when using modern hardware (fps drops to TICRATE or below, 35 fps) in 32 bit color mode. In 8 bit color mode there is no significant gain since DelphiDoom even in 8 bit color mode uses 32 bit "blit" screen buffer, i.e. SCREENWIDTH * SCREENHEIGHT * 4 bytes screen proccesing in each frame regardless if we use 8 bit or 32 bit color depth.

On the other hand in OpenGL mode things are much better and faster since DelphiDoom merge neighboard voxels elements of the same color and create a low poly mesh and store it to a precompiled OpenGL list. What gave a huge speed boost was replacing calls to glColor with texture coordinates. A palette texture with size 512X512 is used. Each pixel of this texture is a different color. A 4096X4096 texture can give all the range of RGB color representation, but since the popular KVX voxel format uses a stantard 256 color pallette is needless, and also video ram consuming. A 512X512 texture has 262144 pixels / different colors, just because DelphiDoom supports custom voxel formats (made with DD_VOXEL tool) with true color depth. True color depth in custom voxel formats is going to be added soon in software renderer version.

Old Post 05-30-13 19:24 #
jval is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Mechadon
Senior Member


Posts: 2176
Registered: 12-06


It's really great to see another port support the voxel love :D. I'll have to give this a spin at some point.

Old Post 05-31-13 01:28 #
Mechadon is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
gnudist
Green Marine


Posts: 32
Registered: 04-12


There's a bit of a contridiction in the license file.

It claims delphi doom is GNU GPL(which allows for profit use), but it then goes on to say you can use it as lond as it's NOT for profit.

A license that dissallows such use is not only not GPL'd but it also runs counter to the ideals of the free software movement the GPL was born out of, that the end user of the software has the FREEDOM to modify and run the software for any purpose.

see: http://gnu.org/philosophy/free-sw.html
see also http://gnu.org/philosophy/selling.html

Last edited by gnudist on 05-31-13 at 20:31

Old Post 05-31-13 19:33 #
gnudist is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
jval
Junior Member


Posts: 191
Registered: 09-05



gnudist said:
There's a bit of a contridiction in the license file.

It claims delphi doom is GNU GPL(which allows for profit use), but it then goes on to say you can use it as lond as it's NOT for profit.

A license that dissallows such use is not only not GPL'd but it also runs counter to the ideals of the free software movement the GPL was born out of, that the end user of the software has the FREEDOM to modify and run the software for any purpose.

see: http://gnu.org/philosophy/free-sw.html
see also http://gnu.org/philosophy/selling.html



These lines was written a lot of years ago.... Anyway these lines have been removed from the readme.txt file.

The basic idea is that what you can do with Doom source code as published by id-software and the Heretic and Hexen source code as published by Raven software the same you can do with DelphiDoom. When the project started the raven source code wasn't under GPL, but since both the Doom source code and the Raven source code re-released under the GPL (http://doomwiki.org/wiki/Doom_Source_License , http://doomwiki.org/wiki/Raven_source_code_licensing) I thing that distributing DelphiDoom under GNU GPL is OK.

Old Post 06-01-13 07:03 #
jval is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
gnudist
Green Marine


Posts: 32
Registered: 04-12



jval said:


but since both the Doom source code and the Raven source code re-released under the GPL (http://doomwiki.org/wiki/Doom_Source_License , http://doomwiki.org/wiki/Raven_source_code_licensing) I thing that distributing DelphiDoom under GNU GPL is OK.



provided you're not including additional code from third parties you're correct. There'd be trouble if you had contributers prior to the switch who did not agree to the licensing change or assigned copyright over their contributions to you.

Last edited by gnudist on 06-01-13 at 20:49

Old Post 06-01-13 20:36 #
gnudist is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
jval
Junior Member


Posts: 191
Registered: 09-05



gnudist said:


provided you're not including additional code from third parties you're correct. There'd be trouble if you had contributers prior to the switch who did not agree to the licensing change or assigned copyright over their contributions to you.




I've made a list of all third party libraries DelphiDoom uses as well as base source code from third party releases was used:

Doom source code by id-software -> GPL
Heretic & Hexen source code by raven software -> GPL
delphimpeg (mp3 support) -> GPLv2
Graphics library by Gertjan Schouten -> GPL
pngdelphi (png support) -> GPL
zlib -> ?
jpeg lib (convertion to delphi by by Thomas G. Lane) -> ?
fastmm (memory manager ) -> dual license: MPL 1.1 & LGPL 2.1
Boom by TeamTNT (boom features) -> GPL
PrBoom plus by entryway (base for the OpenGL renderer) -> GPLv2
glBsp by ajapted -> GPLv2
Quake2 by id-software (small fractions for md2 model support) -> GPL

One of the voxel formats that DelphiDoom can read is the KVX files but does not use Build Engine code.
There are also a few mobj codepointers from zDoom modified to fit DelphiDoom specs/limitations. Oops, zDoom is not GPL but in sourceforge is registered as BSD ... this could be a problem.... right? On the other hand BSD is considered as GPL-compatible free software license (http://en.wikipedia.org/wiki/BSD_licenses)... ?
Custom actor definition and OpenGL light definitions are inspired from zDoom (ACTORDEF lumps that DelphiDoom uses for custom actor definition is a modified subset of zDoom DECORATE lumps and LIGHTDEF lump is quite identical) but no zDoom code is used to process them.

Last edited by jval on 06-05-13 at 06:40

Old Post 06-05-13 06:34 #
jval is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 10987
Registered: 07-07



jval said:
zlib -> ?

Extremely permissive license. Do you have the string "deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly." in the executable? If so, congratulations, you're following the terms of the license.

jval said:
There are also a few mobj codepointers from zDoom modified to fit DelphiDoom specs/limitations.

There's no problem using ZDoom's original code in a GPL program.

Generally, all you need to do (provided the licenses aren't incompatible) is to make sure the code under a different license from the rest of the project is clearly marked so. ZDoom itself uses a complex mix of licenses.

Old Post 06-05-13 08:47 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
jval
Junior Member


Posts: 191
Registered: 09-05



Gez said:
[B]
Extremely permissive license. Do you have the string "deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly." in the executable? If so, congratulations, you're following the terms of the license.



I don't.
I'm using version 1.2.5, obtained from http://www.base2ti.com/?id=delphi.zlib, this link is placed in zlib home site (zlib Delphi 5 interface). I've just checked the readme.txt file that comes with the package and that's all I've found:



this software is provided "as-is", without any express or implied warranty.
in no event will the authors be held liable for any damages arising from the
use of this software.

permission is granted to anyone to use this software for any purpose,
including commercial applications. please do not misrepresent the origin of
this software. if you use this software in a product, an acknowledgment in
the product documentation (readme, about box, help file, etc.) would be
appreciated but is not required.

Old Post 06-05-13 10:02 #
jval is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5939
Registered: 08-00



jval said:


I don't.
I'm using version 1.2.5, obtained from http://www.base2ti.com/?id=delphi.zlib, this link is placed in zlib home site (zlib Delphi 5 interface). I've just checked the readme.txt file that comes with the package and that's all I've found:



zlib is under a BSD-style license. It's sometimes called the "zlib" license but there's not a lot of practical difference.

Old Post 06-05-13 18:17 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Chu
Forum Regular


Posts: 687
Registered: 10-02


Is supporting Voxels only obtainable by using BUILD engine's code? I am thinking about hacking in support for 3DGE but if it even uses a smidge of that I'm staying away from it like the plague..

__________________
3DGE source port

Old Post 06-05-13 20:05 #
Chu is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 10987
Registered: 07-07



Chu said:
Is supporting Voxels only obtainable by using BUILD engine's code?

Of course not. In OpenGL you really don't care about how Build would do it.

ZDoom uses Build to render them, but not to load them. From Jval's explanations, DelphiDoom's software renderer uses its own code, even if the approach is similar.

Old Post 06-05-13 20:10 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
kb1
Member


Posts: 321
Registered: 11-06


jval:

So what exactly (mathmatically) is "3d perspective"? How does it differ from standard software rendering?

Old Post 06-21-13 02:19 #
kb1 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Stroggos
Junior Member


Posts: 181
Registered: 04-09



Chu said:
Is supporting Voxels only obtainable by using BUILD engine's code? I am thinking about hacking in support for 3DGE but if it even uses a smidge of that I'm staying away from it like the plague..


Ken Silverman did actually describe the format in the readme file of another project of his called Slab6. So you can just use what he describes there without the need to tear apart the BUILD engine and use that license.

Old Post 06-21-13 04:12 #
Stroggos is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 12215
Registered: 07-06



kb1 said:
jval:

So what exactly (mathmatically) is "3d perspective"? How does it differ from standard software rendering?



Try looking up & down in ZDoom and then in GZDoom, and you'll realize ;-)

Doom's engine is NOT polygon based, so changing "camera position" can only be done with certain compromises. E.g. in Heretic and ZDoom's "freelook" floors are practically always rendered as if they were dead-horizontal, and walls are always rendered as if they were dead-vertical, at all viewing angles (it's just that they get so distorted that you don't realize it).

When you "look up or down", instead of the polygons making up the walls and floors being rotated, it's just the view window that gets shifted up or down, plus screen-edge distortion (in fact, in Heretic shifting view means recomputing the yslope table every time, and that results in quite a bit of distortion at higher angles.
Normally e.g. when you look up a tall column IRL or in a proper 3D engine, the column should also get a trapezoidal distortion near the top, and you should get to see more of its surroundings the highest you look. In Heretic-like "freelook", this does not happen: the column will appear to be the same (pixel) width from base to top.

What jval is trying to do, essentially, is to add "proper" polygon-like distortion to the rendering of walls and flats. I'm not sure if this is done by converting visuals to a full, proper polygon mesh each frame, or by hacking column and flat drawing functions to appear as if they are drawing proper polygons, without the engine actually being polygonal.

Old Post 06-21-13 09:04 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 10987
Registered: 07-07


I wrote some explanations here.

Old Post 06-21-13 09:55 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Holering
Member


Posts: 303
Registered: 01-03


Voxels are very interesting. Wonder if Perkristian would use this as reference for high animation sprites...

Old Post 06-21-13 12:00 #
Holering is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 12215
Registered: 07-06



Gez said:
I wrote some explanations here.


So software freelook is more like a FORCED and PAINFUL view-window stretching? ;-)

Old Post 06-21-13 12:57 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7687
Registered: 01-03


Panning, not stretching. The perceived stretching with large angles is just a result ho how the projection works.

Old Post 06-21-13 13:51 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5939
Registered: 08-00



Gez said:
I wrote some explanations here.

Do we have a similar article on doomwiki? That's a very well-written and illustrated example of how it works.

Old Post 06-21-13 14:08 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 16:57. Post New Thread    Post A Reply
Pages (2): [1] 2 »  
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > DelphiDoom progress in 3d perspective in software mode, now with voxel support

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.