December 1st, 2006

Not Forgotten

 VIDEO LINK: Foamy’s Rancor model, casting soft shadows (35 megs). 

Well now, it’s been quite a while since I’ve last posted any updates. I’m very sorry for the lack of news - it’s due in part to the fact that with school being so rush rush, I don’t have as much time for coding as I used too, and also due in part that I’ve spent all the spare time I’ve had coding instead of blogging =)

 A lot of work has perspired since the last post though. I’ll give a list here, though I’m sure I’m missing out some things.

  • Demo: First off, actual work on my public demo is underway! Right now it’s just a basic little room I made in 3ds Max with some physics-enabled objects, and the camera floats around shooting out boxes or spheres, etc. I’ll speak a little bit more about this in a bit.
  • Lighting error fixes: I’ve spent a solid 4 days pulling my hair out about this. Apparently, every since screenshot I’ve taken up until yesterday was been suffering incorrect lighting. I hadn’t realized this, because all of my scenes were static, but the lighting shader would invalidate as soon as some kind of translation/rotation was applied to an object. I realized this when I added shooting cubes to the demo. It turns out I wasn’t properly converting everything into tangent space (hence my problem with translation).. a simple error, but it required me to rewrite the entire shader (that’s what you get for just plunging into lighting without much research). However, now lighting is correct for all objects, and simpler, and cleaner. Also, the parallax I had implemented before I had actually taken out of demo because it looked so ugly - turns out I was normalizing the view vector after grabbing the new offsetted tex coords, and not before. Switching that around made everything look fantastic!
  • Optimizations: Because I was forced to rewrite my shader, and with a little help from Zaknafein, the new lighting shader is far better optimized. I have a few free instructions, which has allowed me to bring back distance-based PCF and attenuation. Some of the optimizations included creating a TBN matrix, removing the light dir vec (redundant with a properly transformed light vec), using the dot product of a falloff range with itself for attenuation, etc. Also, I’ve been playing around with different cube map sizes for the lights.. and you can get acceptable quality even from a 128 ^ 6 map! (assuming the light isn’t very large). This has given me some ideas..
  • Actors: Thanks to a request from Foamy (a member at TrueVision3D - very talented artist) I spent part of today adding support for actors and shadowmapping. Surprisingly, it’s gone over very well, with few issues. This really shows off the power of shadowmapping - seamless self-shadowing, and soft-shadowing on all objects. Try doing that with stencils, and you get some horrible artifacts. Unfortunately right now the actors need to be transformed on the cpu, since I havn’t added skinning support (would require a seperate shader dedicated for actors). I’ll get to this in the future.

As you can see, I’ve been hard at work =) There have been a few hangups though. Most noticeably right now is that I have a feeling that actors do something funny with their transformation matrix. While I can’t pinpoint if my lighting is bad on actors (it looks right, but I can’t use an untextured actor do to a TrueVision bug), I know for a fact attenuation doesn’t work. I need an insane falloff range for a light to affect an actor.. and yet it affects the surrounding scene as expected. This would mean that I’m not able to grab the vertex distance properly, but that doesn’t make sense, since shadows are cast correctly. This is going to require a chat with Sylvain.

Additionally, the Max7 exporter hasn’t been updated to work with the new engine release, so I’m stuck using Panda exporter and .x files. While things have worked out ok for now, I would much rather export to .TVM directly.. I wish they would hurry and release it.

I do have a few goals though, before I release the demo, aside from these bug fixes.

  • Multiple lights: This, imho, is essential to having useful point light shadows. Unlike directional lights, of which there are generally only one in a scene, point lights and spot lights often exist in abundance. Unfortunately, this means I’m going to have to write a very tight shadow manager.
  • Shadow manager: An absolute must. The idea is that it’s a complete waste to do two things: Render lights that don’t need to be updated, and give lights too much/too little resolution. This means that my manager needs to figure out what faces of what light need to be updated each pass (otherwise, 2 lights * 6 faces = 12 renders JUST for shadows), and then perform the updates over several frames to keep things smooth, based on how close the shadow is to the user, how large it is, how many objects it affects, and its resolution. Also, render surfaces and cubemaps take up large amounts of memory, and rendering to a 1024 map is much slower than a 256 map. Small light sources require smaller maps, and maps should be dynamically resized based on the distance of reciever to camera, importance of the light vs. others, etc. Wow, that’s a lot of work to do!
  • Multiple lighting models: In order to demonstrate both the modularity and flexability of shadowmapping, I want to support more than basic parallax mapping. Planned types include anisotropic (metal), fur, and perhapes some kind of chromatic dispersion.
  • Alpha test objects: One of the greatest knocks against stencil shadows is the inflexability towards alpha-tested objects (ie. chain link fence). Because it uses silloughete extrusion, and cant read in texture information, you end up with a big blocky shadow. I’d like to be able to support transparent textures.. possibly using tex kill in the depth shader.
  • Projection lights: I’m not super sure about this one, but I might want to support texture-projecting lights. Maybe. It doesn’t seem like a major feature people want.

My that’s a long post! I’ll have to post more frequently then, to avoid doing this again.

4 Responses

  1. Althea Beck Says:

    good luck

  2. Margherita Says:

    Generally I don’t learn post on blogs, but I would
    like to say that this write-up very compelled me to take a
    look at and do it! Your writing style has been amazed me.
    Thanks, quite nice article.

  3. cheap seo content writers Says:

    Awesome post.

  4. ecotourism south florida yachts Says:

    5 percent charge on customers’ bank card purchases.

    Music with the Band Kaoba is very useful for listening or dancing.
    The South Rim tours have optional add-ons too such as a motorcycle or jeep ride.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.