Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Jean-Michel Hervé, posted on September 30, 2000




Image Description, by Jean-Michel Hervé



Hi everybody,

Here's a small set of screenshots of the new shadow system I'm working on, for the Lankhor's upcoming title called WARM UP ! edited by Microïds.

As you can see, the shadow is casted on a quite complex car mesh (note : the rear wing is not included in the process, since it is still in early development). The car itself has more than 8500 polygons. The whole thing is rendered without T&L (but a T&L version is available too, that doesn't support the shadow system yet). Please note that this shadow system is fully compatible with ALL 3D cards existing around, since it doesn't uses stencil buffer at all.

The screenshot in the lower right corner of the pic has been taken on a Radeon card. The shot is not wide enough to show it clearly, but there's also a heat effect, using the bump mapping functionnality of the Radeon (originally developped on a G400 card).

The whole engine could be more optimized, but it currently uses an octree system for the tracks, a fully physic-handled hierarchy for the car, and so on.


[prev]
Image of the Day Gallery
www.flipcode.com

[next]

 
Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
krogoth

September 30, 2000, 09:21 AM

What framerate do you get with this? Do you calculate lighting for each vertex?

 
Jean-Michel Hervé

September 30, 2000, 09:49 AM

I do get more than 20fps (DEBUG compiled), in the actual game. But it's just the "raw" code, no optimizations yet. And there's also the whole game to run :)

Anyway, I plan to get a higher framerate in the near future.

For the algo, I compute mapping coordinates into the shadow maps for each vertex of the car yes.

 
StrongBow

September 30, 2000, 09:57 AM

Very nice! not much more i can say being a newbie to graphics coding, but it looks real nice, i realy like the shodow that is cast on the car from above.

 
iCodeSuk

September 30, 2000, 11:36 AM

wow, those shadows are sharp, How does your system work? Another question, Is the sharpness of the shadows effected by the properties of thel surface?

 
Ikuyubon

September 30, 2000, 12:46 PM

Nice work!
I'd really like to see the heat effect!!!
Could you send me a better screenshot? so I could see it.:)
Do u use a sort of bitmap distorsion to create the heat effect?


 
fluffy

September 30, 2000, 01:00 PM

Jean: So basically you're just using projected textures, then? :)

 
Jean-Michel Hervé

September 30, 2000, 01:18 PM

For people interested in the heat effect, you can jump to this link :

http://www.matrox.com/mga/3d_gaming/enhanced_games/f1_worldgrandprix.cfm

there's 2 videos and some screenshots of F1 World Grand Prix, the previous game that was using my 3D engine.
The heat effect has been slightly enhanced since.

fluffy : yep it's kinda projected textures, but there's just MANY textures and MANY shadows against a huge complex mesh. :)

The shadows themselves are "static" on the world actually, but it could easily been animated, since it is not using anything static.

 
fluffy

September 30, 2000, 02:03 PM

jean: There's nothing about projected textures which precludes using a lot of them against a complex mesh. :) FWIW, I believe the various hardware T&L cards out there will, in fact, do hardware transforms for the texture matrix (under OpenGL anyway), so there's no reason that there should be any difference between the software and hardware T&L code. Oh, but you're probably using D3D, so never mind. ;)

 
krogoth

September 30, 2000, 02:25 PM

Do you do this every frame?

 
Jean-Michel Hervé

September 30, 2000, 02:26 PM

It's not using some strange matrix things, it's an home made algo that algo a large amount of shadows to be casted on a large amount of meshes (22 cars in a typical F1 game, with several meshes per car).

Anyway, the T&L cards can do such things, but not as efficiently than the way I do it in "software" transformations.

 
treething

September 30, 2000, 02:37 PM

Why do you say doing the texture projection yourself in software is faster than letting the hardware do it?

 
fluffy

September 30, 2000, 03:56 PM

And I don't see why you need any special algorithm to project shadowmaps onto more than one mesh at a time. It's not like drawing one object with a shadow texturemap will somehow invalidate the shadow...

Also, for an outdoor engine where the lightsource is typically "infinitely" far away, you can typically get away with one big shadowmap and a very simple projection transform. Not that point lightsource projection transforms are much more difficult (and both can be handled with the same equations).

The only thing "special" I see your algorithm doing is projecting shadows from the cars, and those could easily be groundplane shadows, considering that as far as I can tell, they don't self-shadow, and it looks like your cars' shadows are combining with the projected shadows as well (which doesn't happen in reality). Also, groundplane shadows are very easy to do in a generic way which uses the same code in both software and hardware transforms, and it's such a basic technique that it's even gone into in great detail in the OpenGL "red" (tutorial) book.

 
Joe Ante

September 30, 2000, 04:14 PM

"The whole thing is rendered without T&L"
Wow, you must have some awesome technology, rendering without transformation. ;-)

 
Jean-Michel Hervé

September 30, 2000, 04:40 PM

But of course I can't expect some understanding from people that just want to say something funny :)


anyway, I use a homemade "projection" to be able to do on a less powerfull computer. Because YOU guys tell me about hardware T&L, and many gamers just have a P200 or a PII 300, and thus don't own a GeForce card or this kind of stuff.

Anyway, show me some game using such technologies and maybe I would reconsider that. But from my point of view, it is important to make things working on every cards and not on just the "topmost hardware". Thus, my technic is just here to show it is possible to get realistic shadow on complex meshes with a standard 3D card.

Of course there's many other ways to make it in T&L (hardware T&L I mean), but that's not the point of these screenshots.

The T&L version is so obvious that I don't even bother to discuss it here. It's like stencil shadows : that's great... awesome... but doesn't work on a voodoo2 card. So it's not optimal for everybody.

My aim is not to have latest cards used fully, but every card used at its topmost.

 
John van der Burg

September 30, 2000, 05:23 PM

Looks very cool!
Maybe it's a good idea to let the game player select the type of shadows? Or just use a TnL version using a texture matrix if TnL is present, and use your home brewn algo when there is no TnL?
Just a suggestion :)
Again, it looks great!

- John

 
ax_dex

September 30, 2000, 05:23 PM

YES!

Many guys here are freaks.
I mean they pay much money for computers.
But the most of people really buying games
have not a comuter with a GeForce......
Think about it!

 
Kurt Miller

September 30, 2000, 05:29 PM

"My aim is not to have latest cards used fully, but every card used at its topmost."

I'm glad to hear that. It seems like things are getting a bit messy with "our-card-can-do-this-and-yours-can't" syndrome. Anyway, cool screenshot. The heat effect video you linked to was interesting as well...

 
Jean-Michel Hervé

September 30, 2000, 05:50 PM

of course I plan to make a T&L version with all the things etc.

BUT I first develop a version that works everywhere, and THEN I make a specific-optimization for some cards.

That's the way I thought everybody was doing, but it seems that it is not the case.

Some effects can't be done evrywhere (like heat effect), but some can : just need to find the right way to do it.

My opinion is that optimization is the key of everything. It's too easy to just use latest possibilities of the latest cards instead of thinking about some way to do it in a generic way.

That's why I made a special tweaked version of shadow projections, faster than the "generic way" described by fluffy.

 
John van der Burg

September 30, 2000, 05:57 PM

I also always first get everything to work and then optimize.
But I know there are a lot of people who like to type optimized code at once. But makes it harder to read most of the time, so also harder to debug. If it's your own code it's oke, but if someone else also has to work with your code then I'm sure they prefer to see the code without all optimization tricks first of all.

Your optimization is probably because the shadows ony get casted from above? I can imagine that makes it faster because you can do some tricks so you don't need the projected vertex positions.

- John

 
Jean-Michel Hervé

September 30, 2000, 05:59 PM

John you're right on all the things you said :)

including the optimization

 
John van der Burg

September 30, 2000, 06:18 PM

Do I win the refrigiator now? :)

 
Jean-Michel Hervé

September 30, 2000, 07:48 PM

Mmmmmh well, you didn't told me I was the best programmer sooooo... nayyyyy, you don't deserve the refrigiator :)

Anyway, I'm sure those posts are off topic :)

So, to fix that (I like to fix things) :

I would like to say that what programmers should have in mind is that the most important thing is to have all players having as much fun as possible, whatever their computer is. That's why I support hardware T&L (for high quality 3D cards), heat effect (for EMBM cards), but also a specific non-hardware-T&L, for all the remaining 3D cards. I believe the game would run on a Voodoo 1 card.
I think it is a LOT MORE challenging to achieve that result than just use topmost hardware without trying to optimize.
And it's up to us, coders, to find a way to support a such wide variety of possibilities. And D3D allow us to do so. (but OpenGL too I must say).

 
fluffy

September 30, 2000, 08:34 PM

I'm not saying that you should abandon the lower end cards. I'm only saying that there's nothing special about projected textures, whether you do the texture coordinate transforms in hardware or software. An incredibly-optimized software texture coordinate generation for projected textures is still projected textures. :)

Note that I never said anything about stencil shadows, requiring hardware T&L, or anything. I was just saying that projected textures is still projected textures, even if you're hand-rolling the coordinate projection (which I'm quite fine with). Jeeze. :P

My thing about the OpenGL texture matrix was intended to be a lighthearted jab at D3D, and not saying that you really MUST use the OpenGL transform pipeline (just that if you did, you wouldn't have to have separate transformation cores for hardware and software T&L like D3D seems to like to make programmers do).

Sorry if I came off unclearly. I realize that there's many language barriers which occur on this site, and not everyone's a native English speaker like I am (and even the ones who are seem to not be very good at it most of the time). I'm sorry for my ambiguity, but there's really no need to get hostile over a simple misunderstanding.

 
Jean-Michel Hervé

September 30, 2000, 08:52 PM

Like you said, there's a language barrier, since I didn't wanted to be hostile or so, but just to justify the technic I used.

Because, of course you're right, it's "just" texture projection, but texture projection on much poly, and it has to work on the more computers possible. So ok, it's still texture projection, but if you go that way, a 3D engine is just a 3D engine, regardless it uses BSP, PVS, textures, shadows, animations, etc. :)) So, it's not the "what it is" that matters, but the "how it is done", at least I think so :)

So of course I could have used some things in D3D like you describe for OpenGL, but would it have been as fast as my way to do? I don't think so. Because I have more information than I could give to D3D/OGL to do the job, and I can use these informations. That's what I call "high level optimization"... after there's the low level optimization that is optimizing the algorythm itself, and then the code if possible.

Anyway, please don't take it in the wrong way : I wasn't upset at all, nor hostile :)
If I wouldn't accept critics I wouldn't have post a picture here :)


 
Alan Gordie

September 30, 2000, 09:52 PM

Jean-Michel,

Very nice!
So, you are using shadow mapping with static shadow maps?

Are the shadow maps generated at run-time or pre-compiled with track info?

Alan
[og]viper

 
Jean-Michel Hervé

September 30, 2000, 10:03 PM

the maps are precompiled with track. BUT it is not totally static... the thing is that maps themselves are static, but we can imagine to make a slight move with shadow depending on hour of the day and so. But it would just be a "stretch" of the existing shadow maps yes.

So not really dynamic too :)

 
ysaneya

October 01, 2000, 02:53 AM

I agree with Hervé here. If i'm saying i'm working on a lightmap generator, you're
not gonna be impressed, will you ? But if i'm saying i'm recomputing them in
realtime for a fully dynamic scene, suddenly it becomes more interesting,
doesn't it ? Yet, it's still lightmaps. So, "it's not the 'what it is' that matter, but
the 'how it is done' " :)

Y.

 
aNa|0Gue

October 01, 2000, 06:13 AM

it rulez !!! =)

 
This thread contains 28 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.