Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (767)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (854)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Realtime zFail shadows  (Read 6377 times)
0 Members and 1 Guest are viewing this topic.
Offline Vorax

Senior Devvie


Projects: 1


System shutting down in 5..4..3...


« Posted 2005-06-14 03:57:23 »

I have implemented zFail realtime shadows into my engine, also known as "Carmack's Reverse" made famous by John Carmack for the Doom 3 engine.

Here is a before and after screen shot of the same image (Please exuse the ugly models...I'll get to the real art at some point. Wink)

Before


After


I am pretty happy with the FPS, but to use the algorithm properly, all my models vertex counts will have to go up a bit because you can't have unclosed meshes or you get streak artifacts.  This algorithm is really a killer on both CPU and video card - it generally drops FPS by more then 50% (I get about 48% drop) because the entire scene is rendered twice and you have to render the shadows to the stencil buffer.  I am using the two_sided stencil extension to save some stencil buffer writing but I am gaining something else for free -  The way my engine is designed I don't have to transform the light into the object coordinates, this is a pretty big saving because it either adds alot of CPU or it adds alot of copmlexity it also opens me up to use display lists for static object shadows, another very big saving.    Because the engine does all transformations in the second thread, I can keep everything (lights and objects), in worldspace.  There is no need to determine the inverse matrix of the objects transformations.

If you look you can see a streak in the shadow, it's a part that lit just past the leg and into what should be the bulk of the shadow.  That's not a bug in the implementation, it's caused by a reversed normal insde the model. 

Now I have to go back and patch up just about all the models to remove any more reversed normals and close the meshes....just added another month to the project ...DOH! Cheesy


Offline eraboin

Senior Newbie





« Reply #1 - Posted 2005-06-14 04:24:00 »

my brain hurts
Offline JoC

Junior Devvie




I love YaBB 1G - SP1!


« Reply #2 - Posted 2005-06-14 05:34:45 »

wow, looks awesome.  Shocked
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #3 - Posted 2005-06-14 07:19:28 »

Superb! That's really really good & only a 50% drop in framerate!  I know how to project shadows onto a flat surface, but this projects onto the various faces as they come.  I'm overwhelmed and can't even think how to implement this with any pretence at maintaining real time.

Where did you get the information on the algorithm?  I'm off for a quick Google.

Alan

/Edit  I found at article at gamedev (http://www.gamedev.net/columns/hardcore/shadowvolume/default.asp) that looks promising.  Ah, so much to learn, so little time.

Time flies like a bird. Fruit flies like a banana.
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2005-06-14 07:21:47 »

Nice one Vorax, stunning looking work!

Kev

Offline Markus_Persson

JGO Wizard


Medals: 19
Projects: 19


Mojang Specifications


« Reply #5 - Posted 2005-06-14 07:25:11 »

Very nice. =)

How do you calculate the polygon edges? That was my biggest problem when I tried implementing it.

Play Minecraft!
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #6 - Posted 2005-06-14 14:33:17 »

do note patent issues with using said algorithm.
Creative has a patent on it, and will force you to use EAX 4 :p

Offline Vorax

Senior Devvie


Projects: 1


System shutting down in 5..4..3...


« Reply #7 - Posted 2005-06-14 14:51:36 »

Very nice. =)

How do you calculate the polygon edges? That was my biggest problem when I tried implementing it.

Here are the steps:
- Index planes which compose the geometry
- Determine which planes share verts with other planes to determine neighbors
- Determine which planes are facing the light
- To get the edges:  Of the light facing planes, determine which ones have neighbors that aren't facing the light and/or they don't have any neighbors at all <<-- these are the edges


Offline Vorax

Senior Devvie


Projects: 1


System shutting down in 5..4..3...


« Reply #8 - Posted 2005-06-14 14:52:59 »

do note patent issues with using said algorithm.
Creative has a patent on it, and will force you to use EAX 4 :p

Creative (the sound card manufacturer?) has a patent on John Carmack's (self proclaimed software patent hater) algorithm??

Offline Markus_Persson

JGO Wizard


Medals: 19
Projects: 19


Mojang Specifications


« Reply #9 - Posted 2005-06-14 14:54:43 »

Vorax:

So for each frame, you need to calculate the dot product of the normal of every single triangle in the scene and the view vector? =/


Matzon:

Fortunately for me, american software patents don't apply in Europe. Cheesy

Play Minecraft!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #10 - Posted 2005-06-14 14:55:15 »

do note patent issues with using said algorithm.
Creative has a patent on it, and will force you to use EAX 4 :p

Yep. Everything with shadow volumes... creative owns it. They shouldn't have got that patent in first place, because they talked about publically before filing it.

However... they have it and most people won't have enough cash for fighting against that. That's "justice" made in the USA. :-/

Well, it does look nice. Good work. Smiley

" Warning - while you were typing 2 new replies have been posted. You may wish to review your post."

Erm... yes, they do have that patent and they blackmailed id software to include eax, which they did (otherwise the release would have been delayed by at least 9-12 months).

弾幕 ☆ @mahonnaiseblog
Offline Vorax

Senior Devvie


Projects: 1


System shutting down in 5..4..3...


« Reply #11 - Posted 2005-06-14 15:16:23 »

Vorax:

So for each frame, you need to calculate the dot product of the normal of every single triangle in the scene and the view vector? =/

Yup...you got it. [edit]err..not of the view vector, the light vector.  Which is why in most implementations of this you have to transform the light vector into the object space[/edit]

Quote
Matzon:

Fortunately for me, american software patents don't apply in Europe. Cheesy

I am Canadian....

Offline Markus_Persson

JGO Wizard


Medals: 19
Projects: 19


Mojang Specifications


« Reply #12 - Posted 2005-06-15 07:32:58 »

Er, yeah, I meant light vector. I was thinking eye space when rendering the depth map from the light's pov in shadow mapping.
d'oh

Play Minecraft!
Offline Tomas

Junior Devvie




Agency9


« Reply #13 - Posted 2005-06-15 13:50:47 »

Quote
Creative (the sound card manufacturer?) has a patent on John Carmack's (self proclaimed software patent hater) algorithm??

I belive that Creative are the owner of the 3D guru company 3DLabs (The driving force behind GL 2.0), I think that might explain why a sound card manufacture is walking  3D land Wink

// Tomas

CTO Agency9
Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1279 views)
2018-06-10 19:43:48

EgonOlsen (1147 views)
2018-06-10 19:43:44

EgonOlsen (881 views)
2018-06-10 19:43:20

DesertCoockie (1291 views)
2018-05-13 18:23:11

nelsongames (1106 views)
2018-04-24 18:15:36

nelsongames (1337 views)
2018-04-24 18:14:32

ivj94 (2078 views)
2018-03-24 14:47:39

ivj94 (1231 views)
2018-03-24 14:46:31

ivj94 (2188 views)
2018-03-24 14:43:53

Solater (798 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!