Dev Blog

Hi, this is the Stranded III development blog. What you see here are actually posts from the Stranded III Dev. Blog Thread at UnrealSoftware.de. There are currently 62 dev blog entries. Click here for an overview
2

Entry 2 - Shadow Trouble & Lua - August 27, 2012

Lua added
Luckily using the Lua library in a C++ project is quite simple as Lua itself is written in C! So I managed to do this within a few minutes and I'm now ready to use Lua scripts in Stranded III.

Shadow Trouble
Shadows are giving me a headache though. I played around with shadows but there are a few problems:
IMG:http://stuff.unrealsoftware.de/s3_shadow01.jpg

• First of all: The part of the palm trees that is UNDER the ground (I made the wireframe visible to show that the trunk doesn't end at the ground) is rendered as shadow as well (red circles). This looks pretty odd and stupid. The easiest solution would be to simply don't put parts of models under the terrain. This leads to other problems though. Some models would partially fly in the air when placed on steep terrain for example.

• The leaves of the palm trees are not rendered in the shadowmap at all. Just the trunk. By default Ogre3D materials don't cast shadows when they have transparency. This can be disabled in the material script but it looks like I also have to enable "depth_write" to make it work, which makes all transparent shapes look crazy.
In the following screen you can see that the leaves cast shadows but if you look at the leaves themselves you can see that they cover the ground and trunks in an odd manner. This happens because I had to enable depth_write in their material script to make them cast shadows.
IMG:http://stuff.unrealsoftware.de/s3_shadow02.jpg


Hopefully there are solutions for those problems but I won't concentrate on shadows now. I'll continue with implementing game logic and a way to define and script objects, units and items. Moreover I have to choose/tweak the right Ogre3D scene manager to make everything run smoothly on large islands.

By the way: I found out that the Ogre3D Milkshape exporter can automatically create LOD (level of detail) versions of your models with reduced polygon counts. Ogre3D uses those versions automatically for objects which are far away from the camera to reduce the amount of polygons which need to be rendered.
2

Disqus

blog comments powered by Disqus