Caelum - [WARNING: Screenshot intensive]

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
cdleonard
Goblin
Posts: 266
Joined: Thu May 31, 2007 9:45 am

Post by cdleonard »

@lilljohan: It should work; I don't know why it doesn't. Can you post the full Ogre.log somewhere?

@epha: I don't have access to a mac and can't really help you. Still; it shouldn't be very difficult to make it work. People made it work before (eugene; some time ago).

@sheen: Yes; it's OK to rotate the sky to fit your coordinates. You can freely rotate mCaelumSystem->getCameraNode(). Caelum's coordinates don't particularly make sense.

Are you sure you're converting time correctly? Julian day is always gmt; not local time. Also; time of the year matters.

@nath31337: The cloud shader now claims to require ps3.0; perhaps this is why it no longer works for you. It's possible that simply lowering the profile in the material would make it work.
Sheen
Halfling
Posts: 58
Joined: Mon May 26, 2008 9:32 pm
Location: St. Petersburg, Russia
x 1

Post by Sheen »

Julian day is always gmt; not local time. Also; time of the year matters.
Of course, I forgot it :oops:
lilljohan
Halfling
Posts: 82
Joined: Tue Jan 03, 2006 4:05 pm
Location: Växjö, Sweden
Contact:

Post by lilljohan »

cdleonard wrote:@lilljohan: It should work; I don't know why it doesn't. Can you post the full Ogre.log somewhere?
Here we go http://www.tinyrocket.se/Ogre.log
I have tried to play around with the profile, but to no use.
User avatar
cdleonard
Goblin
Posts: 266
Joined: Thu May 31, 2007 9:45 am

Post by cdleonard »

lilljohan wrote:
cdleonard wrote:@lilljohan: It should work; I don't know why it doesn't. Can you post the full Ogre.log somewhere?
Here we go http://www.tinyrocket.se/Ogre.log
I have tried to play around with the profile, but to no use.
"Ground fog" is ugly and nasty and I want to remove it. Don't use it. It seems you're trying to create it after Caelum itself is initialized; this is confusing. What about the demos; do those work?
lilljohan
Halfling
Posts: 82
Joined: Tue Jan 03, 2006 4:05 pm
Location: Växjö, Sweden
Contact:

Post by lilljohan »

cdleonard wrote:
lilljohan wrote:
cdleonard wrote:@lilljohan: It should work; I don't know why it doesn't. Can you post the full Ogre.log somewhere?
Here we go http://www.tinyrocket.se/Ogre.log
I have tried to play around with the profile, but to no use.
"Ground fog" is ugly and nasty and I want to remove it. Don't use it. It seems you're trying to create it after Caelum itself is initialized; this is confusing. What about the demos; do those work?
Both demo and lab works perfectly.

Here is my init code. If i enable moon, starfield or clouds then it crashes with the same error message as before, just a different unsupported shader. Which is weird since my graphics card supports every shader model known to man ;) .. except 4.1 ...

Code: Select all

Caelum::CaelumSystem::CaelumComponent componentMask = 
			static_cast<Caelum::CaelumSystem::CaelumComponent> (
			Caelum::CaelumSystem::CAELUM_COMPONENT_SUN |				
			//Caelum::CaelumSystem::CAELUM_COMPONENT_MOON |
			Caelum::CaelumSystem::CAELUM_COMPONENT_SKY_DOME |
			//Caelum::CaelumSystem::CAELUM_COMPONENT_IMAGE_STARFIELD |
			//Caelum::CaelumSystem::CAELUM_COMPONENT_POINT_STARFIELD |
			//Caelum::CaelumSystem::CAELUM_COMPONENT_CLOUDS |
			0);

		caelumSystem = new Caelum::CaelumSystem(Ogre::Root::getSingletonPtr(), sceneManager, componentMask);

		caelumSystem->setManageSceneFog(true);
		caelumSystem->setSceneFogDensityMultiplier(0.0015);

		caelumSystem->setManageAmbientLight(true);
		caelumSystem->setMinimumAmbientLight(Ogre::ColourValue(0.1, 0.1, 0.1));

		caelumSystem->setSun(new Caelum::SphereSun(sceneManager, caelumSystem->getCaelumCameraNode()));

		if (caelumSystem->getSun()) {
			caelumSystem->getSun()->setAmbientMultiplier(Ogre::ColourValue(0.5, 0.5, 0.5));
			caelumSystem->getSun()->setDiffuseMultiplier(Ogre::ColourValue(3, 3, 2.7));
			caelumSystem->getSun()->setSpecularMultiplier(Ogre::ColourValue(5, 5, 5));

			caelumSystem->getSun()->setAutoDisable(true);
			caelumSystem->getSun()->setAutoDisableThreshold(0.1);
			caelumSystem->getSun()->getMainLight()->setCastShadows(true);
		}

		if (caelumSystem->getMoon()) {
			caelumSystem->getMoon()->setAutoDisable(true);
			caelumSystem->getMoon()->setAutoDisableThreshold(0.1);
		}

		caelumSystem->setEnsureSingleShadowSource(true);
		caelumSystem->setEnsureSingleLightSource(true);

		caelumSystem->getUniversalClock()->setGregorianDateTime(2008, 4, 9, 6, 33, 0);
		caelumSystem->setObserverLongitude(Ogre::Degree(0));
		caelumSystem->setObserverLatitude(Ogre::Degree(0));
		caelumSystem->getUniversalClock()->setTimeScale(100);

		caelumSystem->getSkyDome()->setHazeEnabled(true);

		window->addListener(caelumSystem);
		Ogre::Root::getSingleton().addFrameListener(caelumSystem);
User avatar
cdleonard
Goblin
Posts: 266
Joined: Thu May 31, 2007 9:45 am

Post by cdleonard »

@lilljohan: In your ogre.log you load "Assets/Caelum". Are you absolutely sure that you're not using older resource files for Caelum? You need the contents of the main/resources/ directory.

This is short of a shot in the dark; even if you had older resources I'm not sure why you would get "unsupported shader" errors. But if the demos work then something must be wrong with your setup.
lilljohan
Halfling
Posts: 82
Joined: Tue Jan 03, 2006 4:05 pm
Location: Växjö, Sweden
Contact:

Post by lilljohan »

cdleonard wrote:@lilljohan: In your ogre.log you load "Assets/Caelum". Are you absolutely sure that you're not using older resource files for Caelum? You need the contents of the main/resources/ directory.

This is short of a shot in the dark; even if you had older resources I'm not sure why you would get "unsupported shader" errors. But if the demos work then something must be wrong with your setup.
Already checked that =/

I did get the unsupported exception before, but not on the clouds. I have checked "everything" in my setup. The init order seems okay.

Code: Select all

- Create ogre root
 - Render system (d3d9)
 - Resources
 - Scene manager (Terrain)
 - Camera
 - world geometry
 - caelum ...
It's more or less the same as the demo, except i don't use the example framework. ... This is driving me nuts =/

Edit Going to download the latest drivers for my graphics card later, doesn't hurt to try.
User avatar
SiENcE
Goblin
Posts: 231
Joined: Thu May 11, 2006 3:07 pm
Location: Berlin
Contact:

Post by SiENcE »

We integrated Caelum into Iris2. It also gives us now "seg fault". :-(

I noticed also a problem with CAELUM_COMPONENT_POINT_STARFIELD and Direct3d. I don't see a starfield at night. But OpenGL works!

It's possible to integrate a cloud and moon fallback for people withour shaders?
jonnys
Halfling
Posts: 77
Joined: Thu Mar 27, 2008 7:40 pm

Post by jonnys »

What are the minimum hardware requirements to use Caelum (shaders)?
User avatar
cdleonard
Goblin
Posts: 266
Joined: Thu May 31, 2007 9:45 am

Post by cdleonard »

@jonnys: I don't know. Some of the shaders are declared to require ps_3_0 vs_3_0 because it's easier to develop with the highest model. Most shaders can probably also work with lower profiles by just changing their declarations. I don't have a good answer. :)

@SieNcE: There's not enough information; how exactly do you get a segfault? Do the demos work correctly? What about an ogre.log or stacktrace?

You can check for shader support in ogre or catch Caelum::UnsupportedException (all components throw that now). Then you can make some sort of fallback. But shader-less cards should be pretty rare anyway.
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Post by xadhoom »

Hi leo!

I have an "unsupported Exception" issue with creating a caelumSystem,
destroying it and then recreating it (here the exception occurs saying that it
couldn´t load point starfield material in PointStarfield).
I´m working with a two weeks old SVN checkout. Did you address this issue already?

Thanks for your support!
User avatar
cdleonard
Goblin
Posts: 266
Joined: Thu May 31, 2007 9:45 am

Post by cdleonard »

xadhoom wrote:Hi leo!

I have an "unsupported Exception" issue with creating a caelumSystem,
destroying it and then recreating it (here the exception occurs saying that it
couldn´t load point starfield material in PointStarfield).
I´m working with a two weeks old SVN checkout. Did you address this issue already?

Thanks for your support!
No; I don't think that was ever tested. Perhaps it leaks a material somehow? CaelumLab should have checkboxes to create/destroy individual components :).

BTW; did you manage to eventually get nullsquared's shadows to work with Caelum's lights?
User avatar
SiENcE
Goblin
Posts: 231
Joined: Thu May 11, 2006 3:07 pm
Location: Berlin
Contact:

Post by SiENcE »

@cdleonard: I know that its impossible to find a seg fault and our Application is far to big to debug only caelum. So i just wait a bit that someone finds the problem in caelum. No hurry :).

I solved the problem with the STARFIELD. You wrote in file ImageStarfield.h "ImageStarfield.jpg" and not "Starfield.jpg". But you only have "Starfield.jpg" in your ressources.

And now another question. I call Shutdown but nothing happends. Is shutdown currently working and does it clean all caelum stuff ?

I tried some stuff without the CG shader Plugin from Ogre and with this setup caelum is working without shaders.

Code: Select all

gCaelumSystem = CreateCaelumCaelumSystem(
CAELUM_COMPONENT_SUN + 
CAELUM_COMPONENT_SKY_DOME +
CAELUM_COMPONENT_IMAGE_STARFIELD +
CAELUM_COMPONENT_PRECIPITATION +
0
)
Don't wonder about the prog. language ... it's Lua. We wrote a Middleware called Lugre for Ogre and we integrated Caelum, Cadunetree, Pagedgeometry, Texture-Atlas, 2D Sprite and Guisystem and lots of other bindings.

Here is our caelum binding: http://zwischenwelt.org/trac/lugre/brow ... elum_L.cpp

We have also a Sample showing Caelum + Cadunetree in action: http://zwischenwelt.org/trac/lugre/brow ... nk/example
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Post by xadhoom »

cdleonard wrote:No; I don't think that was ever tested. Perhaps it leaks a material somehow? CaelumLab should have checkboxes to create/destroy individual components :).
Everything works fine on the first run, but after destroying and recreating CaelumSystem I get this exception.

cdleonard wrote:BTW; did you manage to eventually get nullsquared's shadows to work with Caelum's lights?
No, we currently use caelum lights without shadows and I´m afraid there is no proper
solution to that problem. Its not only about the directional lights which would
need an orthogrphic projection in the shadowmap to make the light really far away,
its mainly the problem of aliasing artifacts if the light is at a significant
distance. Because Null did not succeed with implementing Lispsm camera setup
which may lower this artifacts( http://www.ogre3d.org/phpBB2/viewtopic. ... &start=200 )
this is a serious problem with outdoor scenes.

I really look forward to this:
http://www.ogre3d.org/phpBB2/viewtopic.php?t=41801
This approach could make acceptable outdoor shadows possible. But I´m not sure if this will get into Shoggoth...
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

Right, I apologise for making the example of VSM so ... limited. The ideal-case use would be to use VSM with unclamped depths (no divide by far distance) in a spot-light based in-door environment.

However, VSM can indeed be used for outdoor areas. For directional lights, you'd want to store viewSpacePosition.z as the depth, not the length. You'll want to make sure that Ogre places the directional light a good distance from the scene (there was a method for this in SceneManager), not too far, but not too close.
User avatar
cdleonard
Goblin
Posts: 266
Joined: Thu May 31, 2007 9:45 am

Post by cdleonard »

xadhoom: I managed to reproduce and fix the reload bug in trunk. It's quite likely that Caelum will still leak some stuff on reload, but (hopefully) nothing large. Writing leak-free code with Ogre is not very easy; you still have to destroy a lot of stuff by hand.

liljohan: This could be what broke stuff for you as well. Can you please retry latest trunk?

SiENcE: Fixed in trunk. Thanks for pointing this out.
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Post by xadhoom »

Thanks! :P

I think many leaks can be tracked down using shoggoth leak detection...
corywinter
Gnoblar
Posts: 10
Joined: Fri Feb 29, 2008 4:41 am

Post by corywinter »

corywinter wrote:
sjcomp wrote:Hello,

When my camera looks straight along z axis towards -z, the clouds disappear. If I rotate camera to the side clouds appear, but I can rotate camera back and they disappear. I do not think I noticed this behavior before updating to the newest code today.

Thanks.
I also have this problem.
I've tried the proposed workarounds for this problem but nothing seems to fix. I've downloaded v0.3 and it's easy to duplicate using the CaelumLab demo. Simply set the camera position and orientation:

Code: Select all

mCamera->setPosition (Vector3 (0, 0, 0));
mCamera->lookAt (Vector3 (0, 0, -1)); 
I read this thread for any updates on the issue (many pre-apologies if I missed something) but came up nil. Is there anything further about this bug?
webteca
Kobold
Posts: 27
Joined: Wed Aug 01, 2007 3:29 pm
Location: Italy

My compliments and a suggestion (I hope)

Post by webteca »

I just want to make all my compliments to cdleonard for the great work that he have done. Last year I critizied the approach of the project and, after a while, I had to freeze my effort with Ogre (I had no time to spend on it). It was really a surprise for me to see the big steps that were done: new elements such as the moon, rain, clouds and (this was the "big point" for me) a very clean structure and more formal approach. Again, all my compliments.

@liljohan: I don't know if this it the correct thread, but I see that you got into trouble with your Nature Demo. I had some problems too, but I finally got it work. I'm going to write a more complete post about this in your Nature Demo thread, but I simply added:

Code: Select all

ResourceGroupManager::getSingleton().addResourceLocation("Assets", "FileSystem", "Caelum");
to your main.cpp code (line 40)

And the demo worked. I Hope this will help you.
Roberto
lilljohan
Halfling
Posts: 82
Joined: Tue Jan 03, 2006 4:05 pm
Location: Växjö, Sweden
Contact:

Post by lilljohan »

Unfortunately neither the newest version or adding "Assets" to the Caelum resource group seems to work =/
User avatar
ahmedismaiel
OGRE Contributor
OGRE Contributor
Posts: 217
Joined: Wed Jan 25, 2006 11:16 pm
Location: Redmond,WA

Post by ahmedismaiel »

it seems that you need to have the resource folder both in the general group and a new Caelum group as well ,some of the queries doesn't check the Cealum resource group

i tried it and it seems to have worked
User avatar
ahmedismaiel
OGRE Contributor
OGRE Contributor
Posts: 217
Joined: Wed Jan 25, 2006 11:16 pm
Location: Redmond,WA

Post by ahmedismaiel »

have any one got Caelum working with shadows ?
can you point me to what is required?

i have PSSM with a directional light ,when i set the value my self the shadow works correctly ,but when using caelum it doesn't ,does the sky dome get rendered as par of the shadowing ,doesn't play with the depth buffers?
lilljohan
Halfling
Posts: 82
Joined: Tue Jan 03, 2006 4:05 pm
Location: Växjö, Sweden
Contact:

Post by lilljohan »

Just got my new drivers - no change =/
ahmedismaiel wrote:it seems that you need to have the resource folder both in the general group and a new Caelum group as well ,some of the queries doesn't check the Cealum resource group

i tried it and it seems to have worked
Adding the same resource location to two different resource groups? That will result in collisions, when Ogre tries to load the same resource twice.
User avatar
ahmedismaiel
OGRE Contributor
OGRE Contributor
Posts: 217
Joined: Wed Jan 25, 2006 11:16 pm
Location: Redmond,WA

Post by ahmedismaiel »

lilljohan wrote:Just got my new drivers - no change =/
ahmedismaiel wrote:it seems that you need to have the resource folder both in the general group and a new Caelum group as well ,some of the queries doesn't check the Cealum resource group

i tried it and it seems to have worked
Adding the same resource location to two different resource groups? That will result in collisions, when Ogre tries to load the same resource twice.
Not on the latest svn
Commander
Kobold
Posts: 27
Joined: Thu Oct 11, 2007 12:43 am
Location: Aachen, Germany

Post by Commander »

ahmedismaiel wrote:have any one got Caelum working with shadows ?
can you point me to what is required?
I have. I use SHADOWTYPE_TEXTURE_MODULATIVE and LiSPSMShadowCameraSetup. If found out that it's important to disable shadowing of the moon, otherwise I don't see shadows of the sun, and the moon casts shadows even on the brightest day and when beneath the horizon:

Code: Select all

caelumSystem->getMoon()->getMainLight()->setCastShadows(false);
And you don't need to setup your own light.
Post Reply