Lighting things is pretty well covered in Crystal Space* right now; multiple lights can be rendered in one pass, and materials can have the usual assortment of properties such as normal maps, specularity maps etc. giving shiny visuals. However, for a truly convincing environment you also need shadows.
Crystal Space actually supported stencil shadows for a while, but they’re not with out issues: the algorithm inherently can’t support any transparent textures, and extra care must be taken by the artists to produce “closed” models, otherwise the shadows will mess up. Also, the Crystal Space implementation has some issues: they need some effort to set up and animated meshes are not supported.
Thus I implemented shadow map support. Without going into too much technical details, they can support binary transparency (aka alpha test), don’t need special care for the models (just throw anything at them and it’ll look as it should), and due simpler implementation, they work on animated meshes in Crystal Space. Within the render manager framework they can easily be utilized by either using a stock render manager with shadow support or some lines of code in custom render managers.
Now some screenshots on how they look in that well-known small test level:
Shadows also work on somewhat larger levels:
(Ignore the missing textures etc. Focus on the shadows 😉
Some implementation details: Parallel-Split Shadow Maps on top of a plain normal shadow mapping. (You can see the shadow maps displayed for debugging purposes in the lower left corner of the shots.) The”soft” shadows you see are actually provided by the NVidia hardware – so real soft shadows is still something left to be done.
* Well, render manager branch.
wow that looks great! Can that be animated? Can’t wait to see soft shadows!
looking good, fellows, looking good. 🙂
now id love to see if and/or how much progress has been on crystalblend(or w/e) and etc. xD
would love a little screen recorded video even, if its not too much to ask. :3
Damn, that looks great!
Keep up the great work guys!
Sweet. (h)
I own a NVIDIA video card but some soft shadow samples would be nice.
😮
Nice. That’s actually how it’s been done in Far Cry…
And shadows for moving objects will be done how? Using the regular CS shadows?
BTW: A limitation of this is of course that the movement of scenery (plants, trees) won’t be reflected in the shadows, which is a bit disappointing, because more recent games (Crysis comes to mind) can do this…
Alex: Why should moving meshs not show up in the shadow map?
Maybe you are mixing up shadow mapping with lightmaps?
Provided by the Nvidia HW means Percentage-Closer Filtering?
Stencil shadows are a dead end. I am not aware of any recent titles using it (the last was doom3).
youaresomean: I always thought that shadow maps were pre-generated, so I am probably confused. So, they’re generated on the fly by using a light as a camera and then projecting its view onto the surfaces as shadows?
Alex: Yes, the scene is rendered from the lights point-of-view storing the scene-depth values in some kind of buffer (“render target”/”fbo”…). This buffer is then projected onto the scene in the camera’s POV and the depth values are compared to determine shadowed/non-shadowed pixels.
youaresomean: Thanks. I always thought that exactly that was what DOOM 3 was doing. I’m not sure what’s the difference between stencil shadows and shadow maps then, because stencil shadows essentially have the same RESULT. I should do some reading 🙂
It looks really good.
I’m just curious what my (not so new) ATI-Card will say….
These look great but they bring to mind a question I have had. Does CS support AA? If it does, could you show some pictures with it enabled. If it doesn’t, that would the one really important feature to make the game look professional, but I assume it would be a big deal to implement. So eh, it still looks good without.
lohborn: I could be wrong *again* ;), but afaik, getting FSAA is merely a question of setting a certain flag in the graphics card. (It is like that, at least, with NVidia based cards.)
looking good.. is it possible to filter the shadows with some gaussion blur?
Wow, that looks awesome! I hope moving shadows also gets into the game.
Yall should use the texturing style of Team Fortress 2.
will you additionally use some kind of static (global illumination) light mapping?
when will there be a post about brecht’s shader node system? 🙂
horace: CS’ static lighter currently doesn’t do GI. So at least from that perspective static lighting would be pointless.
Kirado: not easily.
how are u doing multiple lights in single pass?.
You should integrate it with ambient occlusion from blender,at least for the terrain.
also what are minimum requirements.i hope all this runs on my crappy 7300 :>.
i just asked because i hope that blender’s light baking features get improved. 🙂
Very interesting… Alexander and youaresomean talked about a subject confuse to me: the difference between stencil shadows and shadowmaps. I also need to do some reading! 😉
stencil shadows are geometry based. the silhouette edges of models as seen from the light get extruded to form a shadow volume and the faces of this extrusion get rendered (taking the z-buffer of the scene into account) into the stencil buffer.
shadow maps are image based. a depth map seen from the light gets rendered and then projected onto the geometry where the distance to the light can be compared.
Hey Horace, thankx for the type!
I think that the shadows look really impressive, and I only hope that the game runs well on the average hardware available on the market these days.
NathanKP – Inkweaver Review
NathanKP: I don’t think “impressive” is quite the right word, they’re slightly worse than in Far Cry (which is 4 years old). But they’re work in progress… In turn, the shadows in CRYSIS *DO* look impressive 🙂 Of course, that game doesn’t run on average hardware, but hey.. 🙂
This is still work in progress ehhhh right? IMHO, this looks like graphics from an average studio in 2003. Is open source game dev really this primitive at the moment? before you flame me, which I expect someone to do, This is an honest question, I don’t mean insult by it. I think the blender team is great, I just don’t think Crystal Space is the right way to go, I think we should concentrate on building more powerful game engines from scratch, like Unreal3 cryengine2, ect, it’d take longer yes, but it’d fruit far better results. I hope I see something like that in the next blender game project, if there is one.
Anonymous: Exactly my opinion. Of course, this is work in progress, so one should be careful about premature comments and expect things to get better (and try to motivate the team instead of complaining all the time 🙂
However, saying that everything is spectacular when it clearly isn’t *yet* is also the wrong way to go.
(Just to give an impression of what I mean: this is roughly “state of the art” currently:
http://i6.photobucket.com/albums/y201/sergio_45/crysis%2064%20final/crysis642007-11-1816-04-52-68.jpg
I don’t expect a small half-dozen-people team to produce a title like this, but then, don’t say you are going to produce a ‘state of the art’ game, because frankly, I think this is impossible given this budget and manpower.
the budget of GTA IV was 100 million dollars and they had a staff of 1000 people. 🙂
crysis had a budget of about 30 million dollars.
how are open source projects supposed to compete with that manpower? a free and open sourced unreal3 engine wouldn’t give much advantage over crystal space either.
some people seem to have way too high expectations.
Indeed. That’s why I said I don’t expect a “state of the art” game from this project at all. I just wanted to convey that it’s dangerous to propose “state of the art” as the plan (as Ton did in the initial Apricot announcement), because that’s simply not possible. It’s easier with a movie (like Peach), because with a movie, the lack of budget and people can simply and fully be compensated for with an arbitrarily shorter length.