Problem with shading


21-12-2008 15:56:56

Hello, I'm new to OGRE. Actually, I'm enjoying with PagedGeometry examples. I've created own simple tree mesh (in Blender). When I use it in my app without using PagedGeometry it looks fine, but with it looks like that: Is there simple solution?

sorry of my english :)


22-12-2008 20:29:24

Well I see two shading "problems" - the trees close up are shaded like a checkerboard, while the trees farther away (impostors) are not shaded at all.

The "checkerboard" problem (if not intentional) looks like you either have some messed up normals, or a very strange texture / uv mapping. Either way, this isn't a problem with PagedGeometry but rather your exporter / modeling tool (unless the trees look fine when not using PagedGeometry).

The unlit impostors is probably because when they were generated, you had no lights set up in the scene. Make sure that before you start configuring PagedGeometry that there are some lights available near (0,0,0) that will illuminate the impostors when they're being generated. Note: Impostor images won't be regenerated unless you go into your .exe's folder and delete the old Impostor[...].png file(s).


28-12-2008 21:46:28

I use blender with last version of exporter and command line tools to create mesh. Is it necessary to use specified soft?
Impostors still looks unlit, even in examples programs.

I haven't had access to the Internet for about week - sorry.


30-12-2008 01:33:13

I'm not an expert on Blender to Ogre exporting, but you'll probably want to set it to soft shading and also make sure normals are calculated correctly (I think there's a recalculate normals tool).

The impostors won't be regenerated unless you delete the corresponding .png files, and like I said you'll have to be sure a tree at (0,0,0) will be lit properly at the time when you add your first tree to the scene, because this is when the impostor images will be generated. Basically it puts a tree at (0,0,0) and takes pictures of it from various angles. If you don't have lighting set up so that these pictures are lit properly, the impostor images which are used at a distance won't look right.


06-02-2009 01:16:11

I've run across this problem too.
Trees drawn in a Batch Page look weird - either with a checkerboard pattern (like the OP's screenshot), and/or other flickering problems.

I've done a bit of testing, and here's some additional information:

  1. This problem only occurred after an update from Ogre1.49 + PagedGeometry (older version) to Ogre1.61 + PagedGeometry1.05[/*]
  2. The problem doesn't occur on all computers. My laptop (Radeon Mobility x1400) has the problem, my desktop (GeForce GTX 280) looks fine.[/*]
  3. The examples that come with PagedGeometry work fine on all computers.[/*]
  4. It's not an issue with the models - if I load my models into the paged geometry example apps, they work fine.[/*]
  5. Likewise, if I load the PG models into my program, they have the same problem.[/*]
  6. The ogre.log is clear of errors.[/*]

    Since the PG examples work fine, there must be something else conflicting within my program. I don't know what yet, but I'll post if I figure it out.


06-02-2009 01:36:42

Hmm, think I just figured it out.

I wasn't using a colour map for my trees. If I add a call to "TreeLoader3D::setColourMap", the problem goes away. Maybe the shader was accessing some random bit of texture memory if this function isn't called? That would explain why the behavior might be different from computer to computer, or even from program to program.