#123775 - silent_code - Sat Mar 31, 2007 12:34 am
UPDATE: 1.6.0 (final) released! (2008) Moved to new domain. (2013)
Hello everybody!
I have updated the Volumetric Shadow (Tech)Demo (formerly know as the "Stencil Shadow Demo" and later "Volume Shadow Demo".)
For now, this will be the final version, although I might release some updates when needed.
A more advanced project (VSD 2.0), which will take VSD's place in the future, is already being developed.
Back on topic: VSD is compatible with most, if not all DLDI devices.
Emulators (as far as they emulate used features) and older SLOT2 GBA NOR (without any SD or CF card storage) cartridges are supported via FCSR (build available on the site.)
The demo shows how to use a bunch of NDS features and some otherwise handy lines of source code, like:
- Hardware accelerated volumetric shadowing - mini-tutorial included!
- Motion blur with video capture, using only one VRAM bank, at 60 FPS
- Hardware lighting, texturing, fogging, antialiasing etc.
- Display brightness control
- Viewport scissoring (thanks to gabebear)
- Loading binary and text files from disk
- Converting 24/32bit .tga image data to 16bit NDS textures
- Displaying a custom font and a text area over a background image, all loaded from disk
- Smooth touch input
- Simple frame rate counting and renderer status display
Please, make sure you read the contents of the included readme file!
A mini-tutorial on volumetric shadows comes with the source release (as well as at here in the forum) and some additional information (e.g. on the .tga format) is "hidden" in the source files. ;^)
Since the initial release, I have reworked the sources a lot! There have been quite some rewrites and a lot of renaming and rearranging!
Now all data should be put into ROOT/data/vsd_data, then the demo can be run from any folder!
It was developed and build with devkitARM R23b, libnds 20071023 and libfat 20070127.
It's quite readable, stable (I guess) and relatively easy to understand!
Download it from: www.code-basement.net
As always, I released the sources along with binary builds. I only supply a DLDI .nds and an FCSR .nds, as I don't think anybody needs a .gba any more (I don't) and the few people who do need it, can easily convert it themselves... But in case that assumption is wrong, please let me know and I'll upload a .gba to the web site.
Note, that there are some implementations and data structures I don't recommend using in "serious" programs, but for the sake of simplicity, I used them in this demo (e.g. the triangle structure.)
This "issue" will be addressed in the next major release - VSD 2.0, which is already being worked on.
The shadow in the demo is static, that means it's not deforming (but could be moved around freely) - it's up to you to implement dynamic shadows.
Feel free to comment - just make sure you read the readme first! ;^)
(Keep in mind, that the demo is my first publicly released open source software. :^) )
Anyways, I hope this demo will be useful to at least some of you. Don't hesitate to tell me about it! :^D
Finally, I want to thank everybody in this forum who's helped me making the jump from GBA to NDS!
Very special thanks go out to Brandon M. and Larry E. for helping me out with the hardware and gabebear for sharing his viewport scissoring implementation.
Thank you for reading and have a nice day! :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Wed Jan 16, 2013 2:32 am; edited 15 times in total
#123808 - Sunray - Sat Mar 31, 2007 9:44 am
Well, GBFS... that sucks big time. Doesn't work in slot-1 devices.
#123814 - silent_code - Sat Mar 31, 2007 10:59 am
EDIT: The demo has been ported to libfat and works with (probably) all devices (SLOT1 / 2 and NOR cartridges), as well as emulators!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 8:46 pm; edited 2 times in total
#124493 - Epicenter - Fri Apr 06, 2007 8:37 am
Why isn't there a build? It surely can't be that hard for you to release one. :P It's a gigantic pain in the ass to set up a dev environment just to compile a demo and see if it's any good or not.
#124813 - silent_code - Sun Apr 08, 2007 9:20 pm
EDIT: This is old news. skip it! (@ Moderators: This post can be deleted.)
Epicenter wrote: |
Why isn't there a build? It surely can't be that hard for you to release one. :P It's a gigantic pain in the ass to set up a dev environment just to compile a demo and see if it's any good or not. |
see, it's just that there are far too many devices that i would need to compile it for to satisfy everyone.
i'm sorry to have upset you. there's a slightly improved new revision and i'll release a binary with it, as soon as i get to it (release planned for wednesday).
a major problem is also, that i only have a neoflash mk4mini and a slot2 card to test my code with (and i'm already thankful for that). that's why it isn't a problem for me to use gbfs ;^p (if i get it done on time, i'll replace it with libfat in the upcoming release).
finally i'd like to tell you a wish of mine: it was nice if anyone voting would at least give me *some* feedback. (i especially mean you option-3-voters! ;^p )
anyway, thanks for looking!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 8:51 pm; edited 1 time in total
#124976 - silent_code - Tue Apr 10, 2007 3:38 pm
EDIT: This is old news. skip it! (@ Moderators: This post can be deleted.)
quick update:
version 1.1 is out and as promissed i've also released binary builds of it. it still uses gbfs, though (to be changed in 1.2).
get it at http://www.robs-basement.de!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 8:50 pm; edited 4 times in total
#125091 - Lino - Wed Apr 11, 2007 8:11 am
it does not work on slot-1. Sorry
#125100 - silent_code - Wed Apr 11, 2007 11:13 am
EDIT: It does now! ;^)
Last edited by silent_code on Sat Jun 28, 2008 8:49 pm; edited 1 time in total
#125101 - Mrshlee - Wed Apr 11, 2007 11:50 am
I tested on the supercard CF.. worked fine
Impressive tech demo even if it is only not animated!
_________________
MrShlee.com
Projects
Dev-Scene
MyTechpedia
#125729 - silent_code - Mon Apr 16, 2007 11:36 am
Thanks a lot!
Does anyone have any suggestions for features to be added, e.g. translutient textures (any need for demoing that)?
Something I'll be experimenting with is "correct" shadows, that is shadow geometry you can penetrate ("walk into") without causing artifacts.
Z-Fail (? la Monsieur Carmack & Creative Labs...) is, to my knowledge, not doable, because the hardware only supports a "hardwired" Z-Pass test. What a pitty... Software patents suck and make our lives hard! Software patents are not there to the benefit of developers and technical advancement, but to make some lawyers and managers rich!
Back on topic: I won't include animation, yet. That has been left out for another time and another demo.
Antialiasing is in and working, so please don't list it. ;^p
Although I should probably include some en-/disable option for it. :^)
The demo runs in no$gba, but some essential features, e.g. shadowing don't work, yet.
I hope this demo helps to improve emulation a little bit. (Someone give Martin a hint - I read he's hard to contact!)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 9:06 pm; edited 1 time in total
#125730 - silent_code - Mon Apr 16, 2007 12:10 pm
EDIT: Removed some whining. ;^)
@ Moderators: Please remove this post. Thank you!
Last edited by silent_code on Sat Jun 28, 2008 8:40 pm; edited 2 times in total
#125741 - Lino - Mon Apr 16, 2007 3:00 pm
your code don't work on slot-1. ok baby
#125749 - DekuTree64 - Mon Apr 16, 2007 5:11 pm
silent_code wrote: |
btw: i just realized most ppl don't seem interested in it. |
Really, it's just because you haven't released a compiled version. Case in point: I haven't built it yet, but I've still been reading the new posts to the thread ;)
And supporting different devices shouldn't be an issue with a small demo. Just build whatever data it needs into the .nds.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#125751 - silent_code - Mon Apr 16, 2007 5:27 pm
@ Moderators: This post can be removed. Thank you!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 9:08 pm; edited 4 times in total
#125757 - silent_code - Mon Apr 16, 2007 6:08 pm
@ Moderators: Could you please remove the poll? It's not like a lot of people participated in it or something... ;^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 8:38 pm; edited 3 times in total
#125762 - Sausage Boy - Mon Apr 16, 2007 7:33 pm
What you can do to make it work on all devices is move the filesystem.gbfs file into arm9/data, rename it to filesystem.gbfs.bin (you can also add a rule for .gbfs in the makefile). This will make devkitARM compile this file into your binary. Next, in main.cpp, #include "filesystem_gbfs_bin.h" or something similar. Now, instead of using the gbfs find first file command, you can simply set gbfs_file to filesystem_gbfs_bin, which will be declared in a header automatically generated by devkitARM.
I don't have access to a DS at the moment, so I havn't tested it, but I looked through the source and read the readme file. What I'd really like is some more explanation of wtf is going on. The comments in draw.cpp didn't make things any clearer for me. Maybe I'm just stupid. Perhaps you could link to nice explanations of shadow volumes and stencil shadows, and explain how that applies to the DS hardware?
_________________
"no offense, but this is the gayest game ever"
#125771 - silent_code - Mon Apr 16, 2007 9:13 pm
@ Moderators: This post can be removed. Thank you.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 9:11 pm; edited 1 time in total
#125806 - DekuTree64 - Tue Apr 17, 2007 4:34 am
DekuTree64 wrote: |
Really, it's just because you haven't released a compiled version. |
silent_code wrote: |
i have released a compiled build (as posted before) with the release of 1.1. |
Yay, I just won the Inconsiderate Bastard Award!
Sorry about that. For some reason the .nds doesn't work, but the .ds.gba does. Looks good.
For sausage boy, basically what you do is set poly ID to 0, render back faces, set poly ID to non-zero, and render front faces. Alpha has to be >0 and <=30, and poly mode set to shadow.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#127980 - syncope - Mon May 07, 2007 4:19 am
Bloody awesome silent_code,
I could only try it via no$gba so I have no idea how fast/slow this runs on hardware,....but wowee this surely isn't a sight I expected on a DS !
by all means keep it up
and release a libfat version for Slot1 users, please
(and yes a few more comments in the code would really be welcome, but thanks for releasing it in the first place)
unless I'm missing something here, this is one of the coolest DS graphics techdemos around. steile sache !
#127982 - Lino - Mon May 07, 2007 5:26 am
This is an iDeaS image 1.0.1.5. Does it work well?
http://spazioinwind.libero.it/linoma/ideas_screen/shadow_demo_gbfs.png copy and paste in your browser.
#127994 - silent_code - Mon May 07, 2007 11:22 am
hihi, thanks!
well, as i've been to GB for a while and my dev pc is being serviced, i couldn't do much nds stuff. but you can understand that as a promise that i'll release a libfat version, if nobody else does it sooner than me.
well about the comments: there isn't really much you have to do to enable shadows, but i admit that searching somebody else's sources isn't really the best way of learning something new. because of my so called "vacations" (they really weren't) and now uni, i haven't been on the forum very often and definitely had no time to put up any kind of snippet/mini tutorial so far. though i aim for this friday to do so - stay tuned.
last time i checked no$gba screwed the rendering big time, but it ran. i really haven't tested it in any other emus because most lack a consistent matrix implementation (ok, that also isn't the case with no$, but at least it does *something* right about matrices). so seeing the iDeaS pic is sort of cool for me :) the lower screen's colors are corrupt, but surprisingly the shadow looks right! textures also look correct (as opposed to no$ - which is still a great emu, though!).
thanks for the image. ;)
my only problem with porting from gbfs to libfat is that when i try to build a fat12 image, it always says it can't find the first file and then it stops, producing a 10kb image file with no content. that was sort of disappointing, as you might remember, i only have a slot 2 kit (with mk4 mini). so i'd need to append the image to the rom, but not being able to build the image, i couldn't even start coding. that was like the last day i had my pc at hand.
can anybody help me? what do i need to do in order to build a fat12 image? i guess i have all the tools and i read the readmes and stuff... i'm working with xp (home - yes!) sp2. any ideas?
again, thanks for the interest!
ps: gru? nach deutschland :^D
EDIT: didn't have enough time. dunno when i'll be able to put things up (slot1 build and "tutorial").
#132838 - Rajveer - Sat Jun 30, 2007 1:21 am
Sorry guys, don't mean to bring up an "old" thread, just wanted to let you (silent_code) know I think this demo is awesome. Stencil shadows on the DS! I know you put a fair amount of time into this demo, so nice one :)
#133246 - silent_code - Wed Jul 04, 2007 4:41 pm
Thank you very much! :^D
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 9:14 pm; edited 1 time in total
#158156 - silent_code - Fri Jun 06, 2008 12:21 am
I just wanted you to know that I have updated the demo. Look at the original topic. :^)
PS: I have released a WIP demo of a small game I have worked on every now and then. Visit my page to take a look at it. Thanks. ;^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 9:15 pm; edited 1 time in total
#158611 - silent_code - Sat Jun 14, 2008 2:56 pm
UPDATED to 1.3.0!
New features include smooth touch input, frame rate display and of course the most important feature of all: DLDI support! :^D
The original post contains more info. You can also visit my web site for an up to date release! :^)
Happy programming!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 9:17 pm; edited 1 time in total
#158679 - dub3000 - Mon Jun 16, 2008 2:32 pm
this is pretty cool!
#158827 - silent_code - Wed Jun 18, 2008 10:44 pm
Thank you and everyone else who likes the demo! :^D
PS: U-u-u-u-Update-ate-ate... Version 1.4.0 is out!
Cleaner sources, better file handling, texture loading and all new error detection and handling! I've de-hacked this release quite a bit. :^)
As usually, look at the original post for more info or visit my web site!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Sat Jun 28, 2008 9:22 pm; edited 3 times in total
#159292 - silent_code - Sat Jun 28, 2008 8:34 pm
Bumpy, bumpy... here goes another update: It's time for version 1.5.0! :^)
This one mainly fixes some bugs, replaces the "almighty declare, define and include everything main.hpp" programming style by only including and declaring what is needed by each compilation unit, along with some more commenting and some cleaning things up.
Additionally, the project was changed from using a "custom" ARM7, to using devkitARM's default ARM7. That removed some unneccessary stuff from the source release.
Now it also uses an unmodified Makefile.
The mini-tutorial was separated from the readme. From now on it will be included in the source release and can also be downloaded separately from the web site.
Check it out. :^)
And please: Read the readme, at least the disclaimer section! Thank you!
@ News-posters: All old releases are removed whenever a new one becomes available, so please don't link directly to the files, but to my web site. Thank you!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
#159446 - silent_code - Tue Jul 01, 2008 2:20 am
Okays, it looks like this is the final update for the demo.
If I had some more feedback on this, I might have added or improved some other stuff, too. Well, there's nothing I can do about missing feedback, but at least I know my smooth touch implementation has been put to good use in cquake. :^D
Ah, yes. This time, I've reworked some minor parts of the sources and (re)added some status displays, like the number of vertex / primitive entries, that are in the RAM lists.
I've also modified the file paths, so I had to rename some files. That's why this version is not compatible with older ones. No big deal though. :^)
Well, there's not much more to say about this.
Until I decide to make another update for version 1.x, I say "Bye, bye doll!"
Version 2.0 will contain some higher quality graphics, as well as a little bit of sound, animation and some sweet bits of FPS gameplay. :^D
Big plans. We'll see how far I get with that. :^)
The dataset is being prepared and some design and layout work has already been made. As I'm doing this all on my own (except for the sounds), there won't be much news to post about in the next few weeks.
Basically, I want to get this done before I start my new job, but I really can't tell how long it will take... and I don't suspect a lot of people are interested in that anyways. ;^)
So long!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
#159627 - zeruda - Thu Jul 03, 2008 4:18 am
Nice demo. But your tutorial is a bit misleading. It says:
- *ALLWAYS* follow the three steps for *EACH* shadow geometry seperately!
But that's not true. You only need to do step 1 once. And then always follow steps 2 and 3 for each shadow geometry seperately. Or just for fun, algorithmically:
Code: |
// Step 1
DrawShadowCastingGeometryIfAnyPresent();
DrawReceivingGeometry();
for (int i = 0; i < NumberOfShadowVolumes; i++) {
// Step 2
glPolyFmt(POLY_ALPHA(1) | POLY_CULL_FRONT | POLY_ID(0) | POLY_SHADOW);
DrawShadowVolume(i);
// Step 3
glPolyFmt(POLY_ALPHA(20) | POLY_CULL_BACK | POLY_ID(63) | POLY_SHADOW | POLY_FOG);
DrawShadowVolume(i);
} |
Also, when I do glFlush(GL_TRANS_MANUALSORT | GL_WBUFFERING); the fog on mygeometry gets switched off. But if I do glFlush(GL_TRANS_MANUALSORT); it comes out ok. What is the GL_WBUFFERING necessary for since the volumes seem to work without it for me?
#159646 - silent_code - Thu Jul 03, 2008 2:42 pm
zeruda wrote: |
Nice demo. But your tutorial is a bit misleading.
...
Also, when I do glFlush(GL_TRANS_MANUALSORT | GL_WBUFFERING); the fog on mygeometry gets switched off. But if I do glFlush(GL_TRANS_MANUALSORT); it comes out ok. What is the GL_WBUFFERING necessary for since the volumes seem to work without it for me? |
Thanks! :^)
Yes, you are absolutely right, I will have to fix that statement. (EDIT: FIXED! An updated version is available on my web site.) Thanks for the feedback! :^)
I found, that without w-sorting, the shadow volumes don't work propperly (especially more complex ones) and start to flicker, much like z-fighting, at any distance.
Using w-sorting, I don't have any problems in my demo. Did you enable the fog master bit? How are you testing? Are you using the latest libnds?
EDIT: If I remove w-sorting in my demo, I get *nothing* on screen on hardware.
PS: Do you enable fog for the shadow geometry? (It's explained in my mini-tutorial.)
EDIT: Also fixed the forum version of the tutorial. :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
#159741 - silent_code - Sat Jul 05, 2008 9:38 pm
Quote: |
Revision 6.0:
- Fixed the tutorial (thanks to zeruda!) :^)
- Fixed a typo in the readme (thanks to jello!) ;^)
- Updated the readme.
- Cleaned up console initialization and propper use of libnds' definitions.
- Fixed material / lighting bug.
- Added and fixed come source comments.
- Fixed initialization function.
- Fixed the view class and its usage.
- Replaced the floating point gluPerspective() whith its fixed point
counterpart.
- Reworked some parts of the mesh rendering.
- Removed last bits of "useless stuff." |
That should be enough info. :^)
And it's probably the last release of version 1.x. :^|
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
#177748 - silent_code - Wed Jan 16, 2013 2:30 am
I am moving to a new domain, so I'll update any relevant links, as people still seem to download the old stuff.
Oh ya, and I haven't been here in a pretty long time! To be honest, I really miss NDS (homebrew) development. After some commercial NDS work I started at a 3D Flash MMO company - it's good, but you know just how it is with the "good old days". ;D
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.