[SOLVED] Caelum and Ogre materials


30-10-2008 14:51:43

This is a follow-up to the post (click) on the regular Ogre forums. Since I found the problem to be related to Caelum (not necessarily due to it!), I am continuing discussion here.

Ogre: 1.6 SDK
Hydrax: 0.4
Caelum: 0.4 (reverted to 0.3 in this thread)
OS: Windows XP SP2 x86
Video: GeForce 7600 GS/PCI/SSE/3DNOW! (AGP)
Driver: 178.24
GL Version: 2.1.2


I recently found a problem when loading various Ogre components (Terrain Scene Manager, Caelum, Hydrax) and models into my app scene.

The problem seems to be that materials don't show up, or alternatively the default Ogre white material is applied to models that are treated as lit. This problem only occurs on models, and terrain IF I use a custom material which causes the terrain to use lighting. (If the terrain is unlit it appears as expected.) Caelum sky and Hydrax water appear as expected. Caelum's resource group, along with my own resources, is 'General'; Hydrax's is 'Hydrax'.

This morning I came up with the idea that perhaps scene fog was set to white, and near/far values were close together, hence rendering everything white. Alternatively, perhaps Caelum does something to the Ogre material manager which causes it to deallocate materials or apply the default material to everything. I'm not experienced enough with the internals of Caelum/Ogre to prove or debug this problem, but I have narrowed the behavior down to:

- problem occurs after adding CaelumSystem object as an Ogre frame listener
- also occurs only in v0.4; I reverted back to 0.3 last night, and the problem was not present
- in v0.3 code, there is much initializing of different portions of the Caelum system, whereas in 0.4 I am leaving the system defaults alone. I definitely am not touching scene fog settings in 0.4, which might be the root of the problem.

If you have any info or experience on this issue, I'd appreciate any help.

--- SOLUTION ---

Turns out that enabling the CaelumSystem scene fog manager WHILE using Hydrax results in insane amounts of fog. Using the following code:


...resolves this problem.


01-11-2008 17:11:34

I don't really know what can be the problem here.

White materials are frequently caused by compile errors or similar. Posting Ogre.log could help.

Caelum doesn't do anything interesting with Ogre's material manager; so I doubt that's the problem.

You don't have to register as a frame listener; there are other ways to get caelum to do it's thing. There's a longer discussion of updating Caelum in the docs. Still; this should work without issues.

You can try to disable fog with CaelumSystem::setManagerSceneFog(false). Maybe this should be off by default; it to cause lots of issues.


01-11-2008 19:23:32

Since reverting to 0.3, I don't have a logfile which represents the above experiences. I will try to get a logfile posted here though.