SkyX 0.4 [0.4 version released - Over-cloud rendering!]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Xavyiy »

@Thoran
Great for the kind words =)

About using the existing CMake solutions, yes I've considered that. In fact I've been testing the one from Nodrev, but since I'm not an expert in CMake(I've used a couple of times CMake before, but never written CMake config files) and that my source environment is a little restrictive(changes to it can take me days, so testing the CMake system will have taken some days) I've decided to not include them in the initial release and just let the CMake gurus doing it.

I've to say that I'm not a very big fan of CMake for little projects(like SkyX, in big projects such as Ogre I think it's very recomendable) because of I think it's more easy to quickly create a project file for your favorite IDE instead of generate the whole stuff with CMake, and also it requires a little complex configuration files.

So for that, my idea is to upload little packages with different IDEs project files(I'll do myself the VC++ 2005, so anyone using VC++ will be able to use them, if you're using 2008 or 2010 you'll just have to upgrade the project files, but that's automatically done) including CMake.

Xavier
Nodrev
Gremlin
Posts: 193
Joined: Fri Jan 25, 2008 6:55 pm
Location: Nantes / France
x 17

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Nodrev »

Great work Xavyiy ;)

Here the CMake files for SkyX 0.2.
[s]http://www.megaupload.com/?d=QVW2JVX9[/s] <edit>Use paradise engine website instead</edit>

Demo 1 is deactivated, uncomment the line at the end of the main CMakeList.txt if you have Ogre1.6 or 1.7.
I also added a static build configuration, check cmakeReadme.txt for informations about it.

You also need to modify

Code: Select all

mSceneMgr = mRoot->createSceneManager("TerrainSceneManager");
to

Code: Select all

mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);
in order to run the demos with Ogre 1.8.
Let me know if you have issues with this package.

It's right that CMake build system is "complicated" to setup, but for my part, I have a template CMake hierarchy that I adapt to every new library I need, so it's not so time consuming to port a library to cmake once you have such kind of reference files. I was using autotools before, and trust me, cmake is a lot more powerfull ;). But your opinion makes sense too :).

Now, I just have to test this new version in our framework (I have a "real" time/position controller that I will certainly release once those tests are completed).
Last edited by Nodrev on Fri Dec 02, 2011 9:13 am, edited 2 times in total.
User avatar
Thoran
Halfling
Posts: 94
Joined: Mon Dec 01, 2008 2:04 pm
Location: Germany
x 1
Contact:

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Thoran »

Xavyiy wrote: I've to say that I'm not a very big fan of CMake for little projects(like SkyX, in big projects such as Ogre I think it's very recomendable) because of I think it's more easy to quickly create a project file for your favorite IDE instead of generate the whole stuff with CMake, and also it requires a little complex configuration files.
While this might be true for you, others using your library might have the dependencies installed in completely other locations on their machine than you have. And editing all configurations in a VS project for all dependencies is really a hazardous job. However I can understand your point of view. In the meantime I updated my own CMake files to SkyX-0.2. So in the end it wasn't as much work as I feared it would be.
Xavyiy wrote: So for that, my idea is to upload little packages with different IDEs project files(I'll do myself the VC++ 2005, so anyone using VC++ will be able to use them, if you're using 2008 or 2010 you'll just have to upgrade the project files, but that's automatically done) including CMake.
Xavier
As mentioned above this doesn't help for different dependency paths and build environments.

Thoran
P.S.: I am not a real CMake guru. Like Nodrev I am working with a base CMake script hierarchy and setup that gets adapted each tim I have a new library to be put under CMake.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Xavyiy »

@Nodrev
Wow, you're fast! =)
Thanks a lot for the CMake package, I'm sure lot of users will find it very helpful!

Just a little note: since the current Ogre stable version is 1.7.X, I think the CMake should automatically asume that we're using Ogre 1.6./1.7 instead of 1.8. So I've just uncommented that line in the main CMakeLists file and added the proper comment. The CMake package is now online!

Also, I've updated the Demo2 and Demo3 in order to use a generic SM(the octree SM in this case) instead of the TSM, this way these two demos are going to be compatible with Ogre 1.8 out-of-the-box =)

P.D.: For the next SkyX release I'll update the Demo1 to use the new Terrain component instead of the old TSM

@Thoran
About the CMake discussion, yes, if someone is using a "big" number of libraries and wants to be able to generate the apropiated project files for differents environments then CMake is the way to follow.
The argument I'm "defending" is that for me is easier to create a new VC++ project, add the source files and the Ogre include/lib path than create the CMake config files for each library and then generate the project files. That assuming that you're going to do that only a few times, maybe one time per computer, otherwise CMake is better =)

When I'll have some free time(at the moment I'm always busy between university, coding, sport and personal life) I'll make my own CMake template and migrate all my projects to it, but I can't ensure it'll be anytime soon :roll:

Xavier
Nodrev
Gremlin
Posts: 193
Joined: Fri Jan 25, 2008 6:55 pm
Location: Nantes / France
x 17

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Nodrev »

Voila, it works :) (the camera is facing sw):
Image
Still have some issues concerning skyx v0-2 / hydrax integration, but nothing that I can't handle.

@Xavyiy:
Ok, you are right, targeting 1.7 as default is better.
I have found some little bugs (sorry ^^), mainly related to camera far clip (infinite is not supported, and sometimes the finite clip plane cut the skydome, forcing the skydome size to 95% of the clip distance should do the trick), I'll post a patch tomorrow. Otherwise, everything runs well.
I'm thinking about an attenuation factor for the moon relative to sun elevation, will see that too.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Xavyiy »

Nodrev wrote:Ok, you are right, targeting 1.7 as default is better.
I have found some little bugs (sorry ^^), mainly related to camera far clip (infinite is not supported, and sometimes the finite clip plane cut the skydome, forcing the skydome size to 95% of the clip distance should do the trick), I'll post a patch tomorrow.
Finally I haven't added the "infinite" far clip distance support since I really don't know why the user want a "infinite" camera, since it may lead to serious performance problems due to inefficient culling, etc. Also it may lead to get some geometry hidden by the SkyX skydome. But if people are using it, I'll add infinite far clip distance support for the 0.3 version.

About the finite clip planes cutting the skydome, this is very weird since in all apps I'm using SkyX(SkyX demos and in a lot of scenes usint the Paradise Engine) I haven't experimented this problem. In fact, the skydome radius is set to the 95% of the far clip distance in SkyX. Are you sure you're not using a bad camera configuration or something like that? (high FOV value, bad aspect ratio, or something like this.. but seems not to be related for me).
If it's not something related with a bad camera configuration or infinite far clip distance related stuff, it'll very helpful if you can send me a PM with your camera config in order to reproduce the bug myself and fix it =)

Edit: I've tested very big camera FOVy values, like 270º, and all works as expected.

About the Moon, in SkyX 0.5 I'll rewrite almost all atmosphere shaders, and I'll take account the possibility of easily render celestial bodies even during the day, not only during the night. Until that, a little hack like the one you're proposing can do the trick :)

Xavier
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by mistigrii33 »

Excellent work Xavyiy and thanks to Nodrev for CMake ! I'm lucky that you release SkyX 0.2, i need it now :)
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
Nodrev
Gremlin
Posts: 193
Joined: Fri Jan 25, 2008 6:55 pm
Location: Nantes / France
x 17

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Nodrev »

Concerning the artefacts, I'm sure it has nothing to do with camera setup, but it was maybe just my cg which was too hot (I didn't reproduce it today :?). So don't worry about that.
I develop a tool that let the user to set an infinite far clip if he wants to, so for me, it's necessary that SkyX manages this case. Furthermore, infinite clip is the default value for a camera far clip in Ogre, so it could avoid some user question about "why the hell skyx did not work in my app?" if you handle it ;).

So, as promised, I made a patch to correct this case (fully tested, as I had done those modifications on my own version of skyx v.0-1). I also correct a bug in cloud layer destruction (when you unregister a cloud layer at runtime, skyx crash on destruction when removeAllLayer() is called). Note that I changed version to 0-2-1 too.

Code: Select all

Index: SkyX/Include/MeshManager.h
===================================================================
--- SkyX/Include/MeshManager.h	(revision 3824)
+++ SkyX/Include/MeshManager.h	(working copy)
@@ -222,7 +222,12 @@
 		 */
 		inline const float getSkydomeRadius(Ogre::Camera* c) const
 		{
-			return c->getFarClipDistance()*mRadiusMultiplier;
+      // Handling infinite far clip
+      Ogre::Real cameraCurrentFarClipDistance = c->getFarClipDistance();
+      if(cameraCurrentFarClipDistance == 0)
+        cameraCurrentFarClipDistance = SKYX_INFINITE_FAR_CLIP_DEFAULT_DISTANCE;
+
+			return cameraCurrentFarClipDistance*mRadiusMultiplier;
 		}
 
 	private:
Index: SkyX/Include/Prerequisites.h
===================================================================
--- SkyX/Include/Prerequisites.h	(revision 3825)
+++ SkyX/Include/Prerequisites.h	(working copy)
@@ -50,8 +50,9 @@
 /// SkyX defines
 #define SKYX_VERSION_MAJOR 0
 #define SKYX_VERSION_MINOR 2
-#define SKYX_VERSION_PATCH 0
+#define SKYX_VERSION_PATCH 1
 
 #define SKYX_RESOURCE_GROUP "SkyX"
+#define SKYX_INFINITE_FAR_CLIP_DEFAULT_DISTANCE 99999.0f
 
 #endif
Index: SkyX/Source/CloudsManager.cpp
===================================================================
--- SkyX/Source/CloudsManager.cpp	(revision 3824)
+++ SkyX/Source/CloudsManager.cpp	(working copy)
@@ -262,13 +262,20 @@
 
 	void CloudsManager::remove(CloudLayer* cl)
 	{
-		for(CloudLayersIt = mCloudLayers.begin(); CloudLayersIt != mCloudLayers.end(); CloudLayersIt++)
+    unsigned int currentIndex = 0;
+    unsigned int indexToErase = 0;
+    for(CloudLayersIt = mCloudLayers.begin(); CloudLayersIt != mCloudLayers.end(); CloudLayersIt++)
+    {
+        currentIndex++;
+        if((*CloudLayersIt) == cl)
         {
-            if((*CloudLayersIt) == cl)
-            {
-				delete (*CloudLayersIt);
-            }
-		}
+            indexToErase = currentIndex;
+            delete (*CloudLayersIt);
+        }
+    }
+
+    if(indexToErase > 0)
+        mCloudLayers.erase(mCloudLayers.begin() + (indexToErase - 1));
 	}
 
 	void CloudsManager::removeAll()
Index: SkyX/Source/MeshManager.cpp
===================================================================
--- SkyX/Source/MeshManager.cpp	(revision 3824)
+++ SkyX/Source/MeshManager.cpp	(working copy)
@@ -118,8 +118,13 @@
 			return;
 		}
 
-		float Radius = cam->getFarClipDistance()*mRadiusMultiplier;
+    // Handling infinite far clip
+    Ogre::Real cameraCurrentFarClipDistance = cam->getFarClipDistance();
+    if(cameraCurrentFarClipDistance == 0)
+      cameraCurrentFarClipDistance = SKYX_INFINITE_FAR_CLIP_DEFAULT_DISTANCE;
 
+		float Radius = cameraCurrentFarClipDistance*mRadiusMultiplier;
+
 		mVertices[0].x = 0; mVertices[0].z = 0;	mVertices[0].y = Radius;
 		mVertices[0].nx = 0; mVertices[0].nz = 0; mVertices[0].ny = 1; 
 		mVertices[0].u = 4; mVertices[0].v = 4;
Index: SkyX/Source/MoonManager.cpp
===================================================================
--- SkyX/Source/MoonManager.cpp	(revision 3824)
+++ SkyX/Source/MoonManager.cpp	(working copy)
@@ -268,7 +268,12 @@
 			return;
 		}
 
-		float radius = c->getFarClipDistance()*0.95f,
+    // Handling infinite far clip
+    Ogre::Real cameraCurrentFarClipDistance = c->getFarClipDistance();
+    if(cameraCurrentFarClipDistance == 0)
+      cameraCurrentFarClipDistance = SKYX_INFINITE_FAR_CLIP_DEFAULT_DISTANCE;
+
+		float radius = cameraCurrentFarClipDistance*0.95f,
               size = radius*mMoonSize;
 
 		mMoonBillboard->setCommonDirection((mSkyX->getController()->getMoonDirection()).normalisedCopy().perpendicular());
@@ -298,7 +303,12 @@
 
 	void MoonManager::_updateMoonBounds(Ogre::Camera* c)
 	{
-		float radius = c->getFarClipDistance()*0.95f,
+    // Handling infinite far clip
+    Ogre::Real cameraCurrentFarClipDistance = c->getFarClipDistance();
+    if(cameraCurrentFarClipDistance == 0)
+      cameraCurrentFarClipDistance = SKYX_INFINITE_FAR_CLIP_DEFAULT_DISTANCE;
+
+		float radius = cameraCurrentFarClipDistance*0.95f,
               size = radius*mMoonSize;
 
 		mMoonBillboard->setDefaultDimensions(size, size);
Index: SkyX/Source/SkyX.cpp
===================================================================
--- SkyX/Source/SkyX.cpp	(revision 3824)
+++ SkyX/Source/SkyX.cpp	(working copy)
@@ -40,7 +40,7 @@
 		, mCloudsManager(new CloudsManager(this))
 		, mCreated(false)
 		, mLastCameraPosition(Ogre::Vector3(0,0,0))
-		, mLastCameraFarClipDistance(0)
+		, mLastCameraFarClipDistance(-1)
 		, mVisible(true)
 		, mLightingMode(LM_LDR)
 		, mStarfield(true)
@@ -93,7 +93,7 @@
 		setVisible(mVisible);
 
 		mLastCameraPosition = Ogre::Vector3(0,0,0);
-		mLastCameraFarClipDistance = 0;
+		mLastCameraFarClipDistance = -1;
 
 		mCreated = true;
 	}
Feel free to apply this patch to your official download (I can send you a zip file instead of this diff, if you prefer).

<edit> Another patch that you will need to use SkyX with Hydrax:

Code: Select all

Index: SkyX/Source/SkyX.cpp
===================================================================
--- SkyX/Source/SkyX.cpp	(revision 3828)
+++ SkyX/Source/SkyX.cpp	(working copy)
@@ -226,6 +226,12 @@
 
 		// Update parameters
 		mAtmosphereManager->_update(mAtmosphereManager->getOptions(), true);
+
+		if (mStarfield)
+			mGPUManager->setGpuProgramParameter(GPUManager::GPUP_FRAGMENT, "uTime", mTimeOffset*0.5f, false);
+
+		mGPUManager->setGpuProgramParameter(GPUManager::GPUP_VERTEX, "uLightDir", mController->getSunDirection());
+		mGPUManager->setGpuProgramParameter(GPUManager::GPUP_FRAGMENT, "uLightDir", mController->getSunDirection());
 	}
 
 	bool SkyX::frameStarted(const Ogre::FrameEvent& e)
</edit>
Doc_QuicknDirty
Gnoblar
Posts: 16
Joined: Mon Aug 30, 2010 4:48 pm
x 1

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Doc_QuicknDirty »

Hello,

First: many thanks to Xavyiy! I can't wait to use SkyX 0.2 in my project.

I encountered something strange. If I run Xavyiy's precompiled Demo1 I get ~300 fps @1280x800 with terrain. If I compile the demo by myself and run it at the same settings I get only ~40 fps without terrain. Any hints?
(Win7 64 - VS 2005 SP2 - Quadro FX3800)

Best wishes

Ralf
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Xavyiy »

@mistigrii33
Hehe thanks!
Also I want to say thanks to all people that have donated to the project =)

@Nodrev
Hi!
No idea about the fact that the infinite far clip fistance was the default one! I'll add support for it in SkyX 0.2.1!
Btw, I think I'll use a run-time editable parameter instead of a fixed compiler-time #define, this way the user is going to be able to modify it on-the-fly depending of the scene without having to recompile SkyX.

About the CloudsManager::remove(...) bug, good catch! Maybe you want use this code instead of creating two auxiliar variables (that at the end is the same, it's just the standard code I use when I've to remove one element from a std container through iterators!) =)

Code: Select all

for(CloudLayersIt = mCloudLayers.begin(); CloudLayersIt != mCloudLayers.end(); CloudLayersIt++)
        {
            if((*CloudLayersIt) == cl)
            {
				delete (*CloudLayersIt);
				mCloudLayers.erase(CloudLayersIt);
				return;
            }
		}
About the SkyX::setStarfieldEnabled(...), good catch! I've missed to update these shader parameters when I was implementing the Controller-based feature! :P

I'll wait some days until release the 0.2.1 version (which will just fix these bugs and add infinite far clip distance support) since maybe there're some more little bugs to be discovered in the following days!

@Doc_QuicknDirty
Are you compiling in release mode? otherwise(in debug mode) you'll get slow framerates.

Xavier
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by scrawl »

Is it possible you forgot some files in the cmake package? this is what i get.

Xavyiy, congrats for reaching this milestone - looks amazing :)

Code: Select all

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring SKYX 0.2.0
-- Performing Test SKYX_GCC_VISIBILITY
-- Performing Test SKYX_GCC_VISIBILITY - Success
-- Search path: 
CMake Warning at CMake/SkyXDependencies.cmake:59 (find_package):
  Could not find module FindOGRE.cmake or a configuration file for package
  OGRE.

  Adjust CMAKE_MODULE_PATH to find FindOGRE.cmake or set OGRE_DIR to the
  directory containing a CMake configuration file for OGRE.  The file will
  have one of the following names:

    OGREConfig.cmake
    ogre-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:107 (include)


-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
CMake Warning at CMake/SkyXDependencies.cmake:75 (find_package):
  Could not find module FindOIS.cmake or a configuration file for package
  OIS.

  Adjust CMAKE_MODULE_PATH to find FindOIS.cmake or set OIS_DIR to the
  directory containing a CMake configuration file for OIS.  The file will
  have one of the following names:

    OISConfig.cmake
    ois-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:107 (include)


CMake Error at CMake/Utils/SkyXMacroLogFeature.cmake:95 (MESSAGE):
  

  
  -----------------------------------------------------------------------------


  -- The following REQUIRED packages could NOT be located on your system.

  -- Please install them before continuing this software installation.

  -- If you are in Windows, try passing -DSKYX_DEPENDENCIES_DIR=<path to
  dependencies>

  
  -----------------------------------------------------------------------------


  + OGRE: 3D library needed for the OgreGraphics plugin <http://>

  + OIS: Input library needed for the OISInput plugin
  <http://sourceforge.net/projects/wgois>

  
  -----------------------------------------------------------------------------
Call Stack (most recent call first):
  CMake/SkyXDependencies.cmake:83 (MACRO_DISPLAY_FEATURE_LOG)
  CMakeLists.txt:107 (include)


-- Configuring incomplete, errors occurred!
Edit: after copying FindOGRE.cmake and so on to SkyX-v0.2/CMake, I'm stuck at this:

Code: Select all

-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
+ boost
+ OGRE
+ OIS
-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ boost-thread: Used for threading support <http://boost.org>
+ boost-date_time: Used for threading support <http://boost.org>
+ Doxygen: Tool for building API documentation <http://doxygen.org>
-----------------------------------------------------------------------------

CMake Error: File /home/scrawl/Downloads/SkyX-v0.2/CMake/Templates/SKYX.pc.in does not exist.
CMake Error at CMake/SkyXConfigureBuild.cmake:41 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:142 (include)
Edit 3 : removed the offending line from SkyXConfigureBuild.cmake. Now there is trouble with case sensitive (this one was easy, just changed Skyx to SkyX in CmakeLists.txt):

Code: Select all

  Cannot find source file "Skyx.h".  Tried extensions .c .C .c++ .cc .cpp
  .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx

  Cannot find source file "Skyx.cpp".  Tried extensions .c .C .c++ .cc .cpp
Edit 4 it can't find headers and I have no idea about this one. Can you help me ?.

Code: Select all

/home/scrawl/Downloads/SkyX-v0.2/SkyX/Source/GPUManager.cpp:24:24: fatal error: GPUManager.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
/home/scrawl/Downloads/SkyX-v0.2/SkyX/Source/CloudsManager.cpp:24:27: fatal error: CloudsManager.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
/home/scrawl/Downloads/SkyX-v0.2/SkyX/Source/AtmosphereManager.cpp:24:31: fatal error: AtmosphereManager.h: Datei oder Verzeichnis nicht gefunden
/home/scrawl/Downloads/SkyX-v0.2/SkyX/Source/MeshManager.cpp:24:25: fatal error: MeshManager.h: Datei oder Verzeichnis nicht gefunden
Last edited by scrawl on Mon Nov 21, 2011 7:51 pm, edited 1 time in total.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Xavyiy »

scrawl wrote:Is it possible you forgot some files in the cmake package? this is what i get.
The best person to reply you is Nodrev since he has made the CMake package, but from what I can see in your log seems that CMake coud not find either Ogre of IOS in your computer.

Xavier
Nodrev
Gremlin
Posts: 193
Joined: Fri Jan 25, 2008 6:55 pm
Location: Nantes / France
x 17

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Nodrev »

Xavyiy, the code you wrote generate another bug, obviously, that was the first thing I wrote to correct the bug, but I got a crash elsewhere, in the CloudLayer destructor I think, but not sure, didn't remember exactly where it was :roll:.
That's why I wrote the other solution which do not modify the list before being sure the CloudLayer was completely destroyed. So it seems that those two variables are needed until a std::set is used instead, or by doing some refacto to CloudLayer destructor.
Ok for the parametred max clip distance, using the define was the "fast and easy" way ;).
Nodrev
Gremlin
Posts: 193
Joined: Fri Jan 25, 2008 6:55 pm
Location: Nantes / France
x 17

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Nodrev »

If you are under linux, I may make inconsistent lower/upper case character in some file path (I only tested on windows, which as everyone knows, is not case sensitive). And yea, I forgot the "SKYX.In" file...
Also, the first error is

Code: Select all

Could not find module FindOGRE.cmake
In a normal gnu environment, you don't have to add those cmake files in the skyx lib. Just generate ogre using cmake/make/make install (do not forget the last step), and the "make install" target will copy all Ogre files to a place where CMake will find them. If not, use the SKYX_DEPENDENCIES var instead of copying files.
I'll try to buil under linux tonight.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Xavyiy »

@Nodrev
I've been reading(fast, not in detail) the CloudsManager source code and I don't find where it can crash if you delete the CloudLayer ptr before removing it from the vector. I must be skipping something, I'll fully test it before release the 0.2.1 version =)

Xavier
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by scrawl »

Nodrev wrote:If you are under linux, I may make inconsistent lower/upper case character in some file path (I only tested on windows, which as everyone knows, is not case sensitive). And yea, I forgot the "SKYX.In" file...
Also, the first error is

Code: Select all

Could not find module FindOGRE.cmake
THis is what i have in

Code: Select all

/usr/lib/OGRE/cmake$ ls
FindOGRE.cmake       MacroLogFeature.cmake     OgreGetVersion.cmake
FindOIS.cmake        OgreConfigTargets.cmake   PreprocessorUtils.cmake
FindPkgMacros.cmake  OgreFindFrameworks.cmake
So looks like its a problem finding them.

Edit: Did you think about making a repository (e.g. github) [for all skyx sources and cmake files] ?
Nodrev
Gremlin
Posts: 193
Joined: Fri Jan 25, 2008 6:55 pm
Location: Nantes / France
x 17

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Nodrev »

There was some litlle error for building under linux, I post a temporary package at the following address:
[s]http://www.megaupload.com/?d=MEL5L9VC[/s]<edit>Use paradise engine website instead, the cmake package link has been updated</edit>

With a correct compiled version of Ogre ("make" + "sudo make install" under "/usr/local/", here what CMake log gives me:

Code: Select all

The C compiler identification is GNU
The CXX compiler identification is GNU
Check for working C compiler: /usr/bin/gcc
Check for working C compiler: /usr/bin/gcc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: /usr/bin/c++
Check for working CXX compiler: /usr/bin/c++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Configuring SKYX 0.2.0
Performing Test SKYX_GCC_VISIBILITY
Performing Test SKYX_GCC_VISIBILITY - Success
Search path: 
Looking for OGRE...
OGRE_PREFIX_WATCH changed.
checking for module 'OGRE'
  found OGRE, version 1.8.0unstable
Found Ogre Byatis (1.8.0)
Found OGRE: optimized;/usr/local/lib/libOgreMain.so;debug;/usr/local/lib/libOgreMain.so
Looking for OGRE_Paging...
Found OGRE_Paging: optimized;/usr/local/lib/libOgrePaging.so;debug;/usr/local/lib/libOgrePaging.so
Looking for OGRE_Terrain...
Found OGRE_Terrain: optimized;/usr/local/lib/libOgreTerrain.so;debug;/usr/local/lib/libOgreTerrain.so
Looking for OGRE_Property...
Found OGRE_Property: optimized;/usr/local/lib/libOgreProperty.so;debug;/usr/local/lib/libOgreProperty.so
Looking for OGRE_RTShaderSystem...
Found OGRE_RTShaderSystem: optimized;/usr/local/lib/libOgreRTShaderSystem.so;debug;/usr/local/lib/libOgreRTShaderSystem.so
Found Doxygen: /usr/bin/doxygen 
Looking for OIS...
OIS_PREFIX_PATH changed.
checking for module 'OIS'
  found OIS, version 1.2.0
Found OIS: optimized;/usr/lib/libOIS.so;debug;/usr/lib/libOIS.so

-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
+ boost
+ OGRE
+ Doxygen
+ OIS
-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ boost-thread: Used for threading support <http://boost.org>
+ boost-date_time: Used for threading support <http://boost.org>
-----------------------------------------------------------------------------

Configuring done
Building under linux always point to some syntax errors/warnings (gcc is less permissive than ms) so I list them here in order to correct them in the next version:

* Remove inline to every virtual function in "Controller.h"

Code: Select all

/home/jeff/formation/sources/skyx/SkyX-v0.2/SkyX/Include/Controller.h:57:32: warning: inline function ‘virtual Ogre::Vector3 SkyX::Controller::getSunDirection()’ used but never defined
* Invalid main signature in demos

Code: Select all

/home/jeff/formation/sources/skyx/SkyX-v0.2/SkyXDemo3/Source/main.cpp:395:5: warning: second argument of ‘int main(int, char***)’ should be ‘char **’
After compiling, run "sudo ldconfig" in order to update the list of available dynamic library with SkyX (you will only need to do that the first time you install the lib).
And also note that the demo directory is not packaged as cleanly as under windows, you'll need to copy manually the media files, and edit resource.cfg and plugin.cfg too.
But at least it compiles under linux now :)
Last edited by Nodrev on Fri Dec 02, 2011 9:13 am, edited 2 times in total.
Nodrev
Gremlin
Posts: 193
Joined: Fri Jan 25, 2008 6:55 pm
Location: Nantes / France
x 17

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Nodrev »

@scrawl:

In the main CMakeList, replace:

Code: Select all

# Set where to find ogre Cmake files on unix
if (UNIX)
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/local/lib/OGRE/cmake/")
else (UNIX)
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ENV_OGRE_HOME}/CMake)
endif ()
with:

Code: Select all

# Set where to find ogre Cmake files on unix
if (UNIX)
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/local/lib/OGRE/cmake/" "/usr/lib/OGRE/cmake/")
else (UNIX)
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ENV_OGRE_HOME}/CMake)
endif ()
And now your FindOGRE.cmake script should be found.
LBDude
Gnome
Posts: 389
Joined: Mon Jul 26, 2010 10:53 pm
x 22

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by LBDude »

Any plans for supporting shader model 4? I'm asking is because I need the texture arrays which means I need to port my shaders to SM4 and over for DX10/11. Then I realized I need to do that for SkyX. But now I'll probably port my shaders to Cg and run OGL. All I need is texture arrays I have no need for other DX10/11 features.
My blog here.
Game twitter here
User avatar
boyamer
Orc
Posts: 459
Joined: Sat Jan 24, 2009 11:16 am
Location: Italy
x 6

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by boyamer »

SkyX runs on DX11 here :) Maybe i can post shader model 4.0/5.0 here if you want.
LBDude
Gnome
Posts: 389
Joined: Mon Jul 26, 2010 10:53 pm
x 22

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by LBDude »

OH if you can please post it!
My blog here.
Game twitter here
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by scrawl »

Nodrev, first of all thanks for your effort. Is there any reason why you didn't include the path /usr/lib/OGRE/cmake for finding cmake scripts? This is the only error I have left now, and this is pretty much the standard directory on most linux distributions if you use a pre-compiled ogre.

Next problem is running. I cd into SkyXCommon/Bin, renamed Plugins.cfg to plugins.cfg (upper/lower case again), removed direct3d from it, and adjusted the PluginFolder.

Then I do: ../bin/SkyXDemo1, I can select renderer, press ok and then it crashes (this happens with Demo2 and Demo3 too).

relevant output:

Code: Select all

*** Initializing OIS ***
*** Initializing OIS ***
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  2 (X_ChangeWindowAttributes)
  Serial number of failed request:  7
  Current serial number in output stream:  9
What's bugging me is that *** Initializing OIS *** seems to be done twice (and as a result, crash). My ogre version is 1.7.3.

Any ideas?


P.S. the precompiled demos worked under WINE.
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by scrawl »

I've found the problem. Looks like this is a bug in the SkyX demos (demo 1,2,3)

This is an excerpt of the ExampleApplication.h shipped with Ogre 1.7.3:

Code: Select all


virtual bool setup(void)
    {
      .................
		// Create the scene
        createScene();

        createFrameListener();

        return true;

    }

Now, we look at main.cpp from SkyXDemo1:

Code: Select all

class SampleApp : public ExampleApplication
 ..........
    void createScene(void)
    {
               ...............
		// Add a basic cloud layer
		mSkyX->getCloudsManager()->add(SkyX::CloudLayer::Options(/* Default options */));

		// Add frame listener
		mRoot->addFrameListener(new SkyXDemoFrameListener(mWindow, mCamera, mSceneMgr));
    }
So, what is happening here? ExampleApplication calls createScene(); which creates the frame listener for SkyX. After that, it calls createFrameListener(); which creates another frame listener (the default ogre one). As a result, 2 frame listeners are trying to create 2 input systems which seems to fail on linux (pretty reasonable).

How I've gotten it to work / proposed patch:

Remove the addFrameListener from createScene, instead override the "createFrameListener" method from ExampleApplication.

Code: Select all

                .......
		// Add a basic cloud layer
		mSkyX->getCloudsManager()->add(SkyX::CloudLayer::Options(/* Default options */));
    }
    
	void createFrameListener()
	{
		mRoot->addFrameListener(new SkyXDemoFrameListener(mWindow, mCamera, mSceneMgr));
	}
I can make a .diff if that makes it easier for you, Xavyiy.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by Xavyiy »

@Nodrev
Thanks for highlight the gcc warnings, I'll fix them for the upcoming 0.2.1 version =)

@LBDude
At the moment I've no plans to officially support SM4 since the DX11 Render System is still in development and AFAIK not much people is using it. Anyway, the required changes are minimal, I haven't tested the DX11 RS yet but if I'm not wrong the only thing to do is to change the hlsl shaders target to ps/vs 4 in SkyX.material.

But in a future, one time the DX11 will be mature enough and almost all people will have a DX11 compatible GC, I'll add official SM4 support.

@scrawl
Hi!
Good catch!. As far as I remember, the createFrameListener() virtual function weren't here in the past :/
I guess that ExampleApplication.h must have been changed in Ogre 1.7.X (I'm seeing some iphone-specific code here, maybe that was the reason of the change)

I'll fix that for 0.2.1!

Xavier
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: SkyX 0.2 [SkyX 0.2 released!]

Post by scrawl »

Thanks for your fast reply, and good to hear it will be fixed :)

Looking at [1], seems like createFrameListener has been here since Ogre 1.6.

[1] https://bitbucket.org/sinbad/ogre/annot ... lication.h
Post Reply