Monday, December 1, 2008

Ogre - Deferred for Now



I have decided to temporarily suspend Ogre development at this point. The screenshot above shows the state I managed to get it to thus far. You can see there a floating white object, which casts a dynamic shadow rendered with Ogre. Note that the dynamic shadow and the static shadows from Sauerbraten are combined in a reasonable manner, in particular where they overlap they don't create a yet darker area, which is the result you get with the simplest shadowing approaches.

To prevent that problem, I added an alpha channel to the static shadows, which is used to combine them with the dynamic shadows (but not with the diffuse textures). In effect, dynamic shadows are suppressed in areas of static shadow. This has a few drawbacks - in particular, it is hard to get the dynamic shadows to be as dark as the static ones, lightmap textures are 33% larger, and static lighting is not as vivid as it might be - but a better solution would require writing custom shaders.

But shaders would be required anyhow as depth shadow mapping in Ogre requires it (I was hoping this would be easier, but it isn't), and without depth shadow mapping you have various problems with shadows (casting in the direction of the light, not just away, etc.). I don't intend to make a serious effort at this point in time to design appropriate shaders and so forth. So Ogre will wait for now, until someone decides to work on it.

However, a great deal of the required work has already been done: Set up Ogre correctly; feed cube geometry into Ogre; synchronize entities to Ogre (lights, etc. - Ogre's dynamic shadows must have the same orientation as Sauerbraten's static shadows!); utilize Sauerbraten's lightmaps; and so forth. All that is really left is to write shaders for shadowing, and some interfacing for odd bits and pieces (particle effects, etc.). So, when I or someone else returns to the matter of Ogre rendering, it shouldn't be too hard to finish the job. It's just that there are more pressing things at the moment (in particular a 0.2 release).

No comments: