SkyX 0.1 Wrapper for Mogre

boyamer

03-08-2010 11:40:10

Hi all,
directly from Alimer Engine (as i promissed to beauty) i've created PINVOKE wrapper of SkyX for Mogre.
The wrapper comes with an example ported to .NET from original SkyX demo.
Lot of classes are wrapped but all missing methods or features can be easily wrapped,just ask.

Project code is situated here,original code is LPGL (as Xavijy) done but mine wrapping parts are MIT so you can easily change code and use it at your own.

http://code.google.com/p/skyxmogre/

Binary downloads, just copy them into MogreSDK\bin\release are here: http://code.google.com/p/skyxmogre/downloads/list

Cheers,

Amer Koleci

mstoyke

03-08-2010 15:00:40

Thanks for sharing. I will add this to the list of supported add-ons for Mogre.

Beauty

05-08-2010 16:45:03

Great thing - thanks to boyamer :D

Although I can't remember that you did promise to me :wink:

I suppose the P/Invoke wrapper works with Mogre although it uses C++/CLI.
Is it right?

If yes, and we would have a Mogre wrapper using P/Invoke - would it also be possible to use C++/CLI add-ons with it?

boyamer

06-08-2010 07:52:12

Great thing - thanks to boyamer :D

Although I can't remember that you did promise to me :wink:

I suppose the P/Invoke wrapper works with Mogre although it uses C++/CLI.
Is it right?

If yes, and we would have a Mogre wrapper using P/Invoke - would it also be possible to use C++/CLI add-ons with it?


Of course i've promised to you, in alimer engine announchement (http://www.ogre3d.org/forums/viewtopic. ... lit=alimer).

I suppose the P/Invoke wrapper works with Mogre although it uses C++/CLI.
Is it right?


Of course, no matter with which wrapper version is wrapped (PINVOKE + C++/CLI) it can be both mixed,so no problem..
This would work with both version.

I think i'm going to wrap the new paged terrain system too. :)

mstoyke

06-08-2010 08:24:36

Hi boyamer, if you like to have write access to the mogre add-on repository to add your wrappers there, just let me know. I'm currently trying to assemble a list of add-ons that can be used with Mogre. Even if the developers want to keep their own repository for development, I'd like to have at least a copy in the official Mogre repository. That will make it easier for people to find working add-ons, because all they need is in the same repository.

Beauty

06-08-2010 12:25:56

I think i'm going to wrap the new paged terrain system too. :)
Good boy (-:

mikael

12-08-2010 16:05:47

Excellent, you saved my precious time for doing that, thanks for sharing :)

Beauty

12-08-2010 19:30:40

I think i'm going to wrap the new paged terrain system too. :)
As I read on the Ogre roadmap - in Ogre 1.8 the support for the old terrain scene manager will be removed.
So the new terrain system will be a must have for our Mogre wrapper.
In this case it would be great when you, boyamer, do the job 8)

Beauty

18-08-2010 18:45:45

A newcomer send me this message:
When i add a .dll file as a reference in C# application it shows an error :

A reference to the "SkyX.dll" could not be added.Please make sure that the file is accessible and that it is a valid assembly or COM component.

any idea ??
thanks

Now I publish it here, because I don't know the solution.
Also the answer could be interesting for other people.


Notice for all:
In the source code I found an info file how to build and use the SkyX wrapper.
http://code.google.com/p/skyxmogre/sour ... Start.wiki

mstoyke

18-08-2010 19:36:24

Maybe you're trying to add a native C/C++ DLL to your solution. You need to add the managed wrapper, it will bind to the native DLL via P/Invoke bindings.

0111

18-08-2010 19:39:16

hello there,

thanks for ur reply. could you explain a bit ? How i should do that. I'm always open the project properties/add reference/browse then skyX.dll and is show me the the err "make sure the file is accessable" .

so, can I show me the right steps to get it work ?

mstoyke

18-08-2010 20:03:04

I just saw how boyamer structured the wrapper. You don't need to add any DLL reference to your project, just make sure the DLL is in the same directory like all your compiled .exe and .dll files (usually somewhere like bin\Debug or bin\Release) and add the files from boyamers repository (AtmosphereManager.cs, CloudLayer.cs, and so on). These files contain the managed part (for C#) of the wrapper and contains all the functions and classes you need.

Beauty

18-08-2010 20:54:35

I tried your demo. It works well (-:

But it needs some preparatory work.
So it would be good to add a readme.txt file to the package of the demo.

To run this demo you need the MogreSDK 1.7.1.

1)
Copy the directory SkyX to MogreSDK/Media.

2)
Copy the files SkyX.dll and Mogre.Demo.SkyX.exe to MogreSDK/bin/release.

3)
Add these lines to the file resources.cft in MogreSDK/bin/release.
[SkyX]
FileSystem=../../Media/SkyX



If there are problems, look for warnings or exceptions to the file ogre.log.

For a feedback use this forum thread:
viewtopic.php?f=8&t=13172


More userfriendly would be:
Add all needed content (of the MogreSDK) to the package. So that the user just need to start it. (I assume he still installed the depencies.)


I think the demo we could include to the MogreSDK.


I found a bug:
When I push F1 for help, then it's like pushing the button quickly again and again. (Help on, off, on, off, on, off)


I can't see a difference pushing the numbers 1 to 9 or Shift+1 to Shift+9.

0111

19-08-2010 13:25:22

hello there,

it seems now the compiling is working fine and build success 100%.
the problem I have with the current code(see below)
when the window is loading, it shutdown automatically, it seems the problem of frame listener. but I have already include the fram listener to it.

This method;
private bool FrameStarted(FrameEvent evt)
{
// Check camera height
RaySceneQuery raySceneQuery = sceneMgr.CreateRayQuery(new Ray(camera.Position + new Vector3(0, 1000000, 0), Vector3.NEGATIVE_UNIT_Y));
RaySceneQueryResult qryResult = raySceneQuery.Execute();

RaySceneQueryResult.Iterator it = qryResult.Begin();
if (it != qryResult.End() && it.Value.worldFragment != null)
{
if (camera.DerivedPosition.y < it.Value.worldFragment.singleIntersection.y + 30)
{
camera.SetPosition(camera.Position.x,
it.Value.worldFragment.singleIntersection.y + 30,
camera.Position.z);
}

it.MoveNext();
}

//SkyX::AtmosphereManager::Options SkyXOptions = mSkyX->getAtmosphereManager()->getOptions();

// Time
if (!showInformation)
{
manager.TimeMultiplier = 0.1f;
}
else
{
manager.TimeMultiplier = 0.0f;
}

manager.Update(evt.timeSinceLastFrame);

return true;
}




private void createSky()
{
//create skyX
manager = new SkyManager(sceneMgr, camera);
manager.Create();

// Add our ground atmospheric scattering pass to terrain material
MaterialPtr material = MaterialManager.Singleton.GetByName(TerrainMaterialName);

manager.GPUManager.AddGroundPass(material.GetTechnique(0).CreatePass(), 5000, SceneBlendType.SBT_TRANSPARENT_COLOUR);

// Add a basic cloud layer
manager.CloudsManager.Add(new CloudLayer.LayerOptions());

//Add frame evnet
root.FrameStarted += new FrameListener.FrameStartedHandler(FrameStarted);
}




please help :)

and for creation:

Beauty

19-08-2010 16:10:10

Here is a bad code:
RaySceneQueryResult.Iterator it = qryResult.Begin();
if (it != qryResult.End() && it.Value.worldFragment != null)
{

I think you should write WHILE instead of IF. :wink:
RaySceneQueryResult.Iterator it = qryResult.Begin();
while (it != qryResult.End() && it.Value.worldFragment != null)
{


Maybe it's useful to enable the sort option. (I don't know if it's enabled by default.)
raySceneQuery.SetSortByDistance(false)

And I suppose after camera.SetPosition(...) the work is done. In this case you could add break; to the next line to stop repeating the while loop.

when the window is loading, it shutdown automaticall
Do you have a game loop? (a while loop for rendering until the application should quit)
Maybe you haven't and your application renders only one frame and then quit.


Is there an exception or warning in the file ogre.log?


How to create an application without the MogreFramework, you can look here:
http://www.ogre3d.org/tikiwiki/Mogre+Basic+Tutorial+6
(maybe you still know how to do it)


and for creation:
Did you forget to write a following text?

mikael

19-08-2010 18:42:16

-

Beauty

19-08-2010 19:16:10

In Mogre we have a repository based structure. Short time ago we switched to bitbucket and try to put most source code there.
But it also depends also to the add-on developers. Some use their own repository or use non. We can't make rules to them. We only can offer a place in our "official" Mogre repository.
In my eyes the most important thing is, to have something in a public repository. I saw different interesting projects, articles or snippets, but after months or years they died. There were removed from the servers or even the whole private websites were dead. Public repositories like sourceforge, code.google, bitbucket will not loose their content. And other people have the chance to help in an easy way (when they get access).

SkyX has a repository:
http://code.google.com/p/skyxmogre/

Either boyamer gives you write access. Or you could create a clone of it, apply bugfixes and ask boyamer to adopt them.

Beauty

19-08-2010 20:52:08

I created a wiki page for this wrapper.
http://www.ogre3d.org/tikiwiki/SkyX+Wrapper+for+MOGRE

It would be great when somebody adds details.

Also one or more screenshots would be nice.
How to add images you can read here:
http://www.ogre3d.org/tikiwiki/Help+-+Images

More help you find in the wiki menu at "Ogre Wiki Help".

boyamer

20-08-2010 14:15:09

I have access to mogre addons repository but i really don't know how to commit using HG and login into repository,if anybody can upload code,just do that.

Thanks,
Amer Koleci

Beauty

20-08-2010 15:02:25

I forgot to tell it here.
The answers related to the Mogre repository I moved to a new topic:
viewtopic.php?f=8&t=13274

The Mogre SVN on sourceforge is frozen (read-only) now.
Instead we use bitbucket which supports Mercurial.
Update and commit code is similar to SVN when you use TortoiseHG (as far as I know).
But well, details you can consult with mstoyke. I suppose he will give you write access to the Add-ons repository. (You are an active Mogre supporter and professional coder :wink: )

Beauty

26-12-2010 12:13:33

Did anybody try/use this add-on?
Does it work well with (M)Hydrax water simulation?
What are your experiences?
We would be happy to get tiny feedbacks.

nico008

27-12-2010 23:48:49

I'm able to run the demo but I cannot use SkyX in my own project currently since I can't add the SkyX.dll file to my project references (it says invalid assembly).
Then I guess I should look into http://code.google.com/p/skyxmogre/sour ... yX.cs?r=14 to get the sky into my project?

mikael

28-12-2010 14:09:12

Do not add SkyX.dll to references (it is not managed dll), instead copy it to your binary directory.

nico008

28-12-2010 14:16:25

Okay but then what should I do to get the sky in my project?
Nothing happens when I just add the dll and other files.

using SkyX;

namespace Mogre.Demo.SkyX
{
class SkyX : Mogre.Demo.ExampleApplication.Example
{
protected SkyManager manager;
protected TextAreaOverlayElement textArea;
protected bool showInformation;
...


-> SkyX is not found :-(

alamata

28-12-2010 17:54:32

hey ,...

i prefer post here insteed open a new post,...

i have try to compile the demo.Sky

but i have got a error


Pointers and fixed size buffers may only be used in an unsafe context


concerning this line in SkyManager,...

[DllImport("SkyX.dll", EntryPoint = "New_Manager", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr New_Manager(void*manager, void*camera);


can you help me to resolve my trouble,...

mikael

28-12-2010 23:09:40

nico008: you should able to compile the demo when you add SkyX directory in your project (dir which contains .cs files, AtmosphereManager.cs, CloudLayer.cs etc).

alamata: in your project's properties, check 'Allow unsafe code' under Build.

Havent had time to test this before but now I tried it, I got it to compile but Manager_Create(NativeHandle); (in SkyManager.cs, line 69) throws "System.AccessViolationException: Attempted to read or write protected memory." when starting the demo. Using mogre 1.7.1.

nico008

29-12-2010 00:27:56

Ok thanks it is working :-)
Is it possible to not set "allow unsafe" on my project? I want unsafe only for SkyX part or something
Also, when I move, the moon disappear then reappear when I stop moving.
How could I fix this?

alamata

29-12-2010 02:03:42

...

@ mikael : Thanks for your intervention,... :wink: i have made that already... but
your intervention has permit to me to see that i worked with mogre_d.dll and not mogre.dll.. :roll:
i needed this .dll for an other project,...
So Thanks,.. :wink:


but now i got an FileLoadExecption


System.IO.FileLoadException was unhandled
Message="Une procédure importée par 'Mogre, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null' ne peut pas être chargée."
Source="Mogre.Demo.SkyX"
FileName="Mogre, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null"
FusionLog=""
StackTrace:
à Mogre.Demo.SkyX.Program.Main(String[] args)
à System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Runtime.InteropServices.COMException
Message="La procédure spécifiée est introuvable. (Exception de HRESULT : 0x8007007F)"
ErrorCode=-2147024769




TargetSite attributes:

"System.Reflection"

en francais dans le texte:

"La méthode peut être appelée uniquement sur un type pour lequel Type.IsGenericParameter a la valeur true."

or

"The method can be called only on a type for which Type.IsGenericParameter is true."

but i can see in debug that the "IsGenericParameter" is at thsi time "false"

can you see what is wrong... ??

how can i put the "IsGenericParameter" on "true"

thanks for your comprehension,...

nico008

29-12-2010 11:28:26

It is now working pretty good in my project :-)

I still have 3 problemes :
1) Can't assign material _NULL_ to SubEntity of SkyXMeshEnt because this Material does not exist. Have you forgotten to define it in a .material script?

2) when I move, the moon disappear then reappear when I stop moving.

3) how can I change terrain position? or can set set it to be periodic in space?

Thanks in advance for your help!

Beauty

30-12-2010 12:47:57

Thanks for your feedback :D

Now I did spend 1 or 2 hours to fill information to the wiki page of the SkyX wrapper.
I hope this will help some people in the future. Feel free to add code snippets or further information (e.g. after wrapper updates).
http://www.ogre3d.org/tikiwiki/SkyX+Wrapper+for+MOGRE

I think i'm going to wrap the new paged terrain system too. :)
What's the current state? Did you wrap it? Or did you try the wrapper of mstoyke?
We would be happy about a feedback in the forum thread In Development: Mogre Terrain and Paging

boyamer

31-12-2010 16:21:28

If there are any methods missing from SkyX I can gladly wrap them and add them.

Just give any feedback

nico008

31-12-2010 16:42:01

It is now working pretty good in my project :-)

I still have 3 problemes :
1) Can't assign material _NULL_ to SubEntity of SkyXMeshEnt because this Material does not exist. Have you forgotten to define it in a .material script?

2) when I move, the moon disappear then reappear when I stop moving.

3) how can I change terrain position? or can set set it to be periodic in space?

Thanks in advance for your help!


What about this please?

mikael

31-12-2010 18:19:52

noco008:
I just downloaded c++ version of SkyX (http://www.ogre3d.org/forums/viewtopic.php?f=11&t=48414) and tested, in its log there is same
error/warning, so maybe you should write error report to skyx forum.

And you asked that it is possible not set "allow unsafe", no, but your code isnt unsafe unless you use unsafe { } somewhere
(but when wrapping methods from dll, it seems that there one must use unsafe block (there whole class is "unsafe" but it doesnt mean that it is unsafe ;))


Unfortunately, I cant get that demo to work, it still crashes and I cant find the problem. Can someone upload whole project that works, so I can test it?

nico008

01-01-2011 15:27:57

Mikael, in attachment you will find files that I downloaded from http://code.google.com/p/skyxmogre/sour ... %2FExample
Simply extract files in Mogre\Samples\SkyX
Compiled Mogre.Demo.SkyX.exe should automatically go in Mogre\bin\Release
Then you should add SkyX.dll in Mogre\bin\Release and SkyX folder with images etc in Mogre\Media
Also add following lines to Mogre\bin\Release\resources.cfg

[SkyX]

FileSystem=../../Media/SkyX


Enjoy!

mikael

01-01-2011 18:55:20

Thanks, but I use 2008 version of ide, so cant open that project. But, I have svn version of skyx too, so these files are the same. I had first hard time when I wasnt add that [SkyX] block, but then there was another exception, it always stopped at SkyManager.Manager_Create(IntPtr )
Just noticed that Im missing Mogre.Demo.Exampleapplication.dll, but where to find it...

nico008

01-01-2011 19:25:48

I'm using Mogre 1.7.1 beta

Mogre.Demo.ExampleApplication.dll should be in Mogre\bin\Release\
If not, you should compile it from there : Mogre\Samples\ExampleApplication

Let me know if it works ;-)

mikael

01-01-2011 21:38:28


23:19:46: Parsing scripts for resource group SkyX
23:19:46: Parsing script SkyX.material
23:19:46: Compiler error: invalid parameters in SkyX.material(109): param_named and param_indexed properties requires at least 3 arguments
23:19:47: Parsing script Terrain.material
23:19:47: Finished parsing scripts for resource group SkyX
23:20:17: DefaultWorkQueue('Root') shutting down on thread main.
23:20:17: *-*-* OGRE Shutdown
23:20:17: Unregistering ResourceManager for type Compositor
23:20:17: Unregistering ResourceManager for type Font
23:20:17: Unregistering ResourceManager for type Skeleton
23:20:17: Unregistering ResourceManager for type Mesh
23:20:17: Unregistering ResourceManager for type HighLevelGpuProgram


log does not show anything (that compiler error isnt the one that crashes the demo), but popup shows "InvalidParameterException): Parametr called lightSpecularColor does not exist"
ok, I copied Media files from sdk to Media dir overwriting the old ones (same files), but it still pops up.

nico008

01-01-2011 22:53:51

In SkyX.material, line 109 you should write param_named uRadius float 30000 to avoid the error in log but I guess this won't solve your problem :-(
I have no other idea sorry

mikael

02-01-2011 02:03:29

Ok, thanks, that modification erases that compiler error, but still same popup comes, "lightSpecularColor does not exist"
(feels like Im missing some files but how, using sdk media files and copied SkyX folder to Media).
And unfortunately it doesnt fix my compiled skyx demo project, still it throws the same exception as before.

Beauty

02-01-2011 11:31:49

In SkyX.material, line 109 you should write param_named uRadius float 30000 to avoid the error in log
Good note.
I added it to the wiki page of the SkyX wrapper.

Beauty

02-01-2011 14:59:56

In an other thread today somebody wrote a feedback about SkyX:
yes lol I have given up trying to do my own sky for now. I merged the skyxmogre svn repo with mine, and am now in the process of gathering enough courage to integrate it fully. I forgot how horrifying it can be to get the perfect combination of projects to all compile and play together nicely. I gave up on the first attempt to compile skyx when I found that you have to actually go back to the very bottom of the stack and compile ogre first (or second after mogre?). Love how SkyX looks btw, couldn't ask for much for than that :D

CodeKrash

07-01-2011 14:04:22

Thank you very much Boyamer! Your pinvoke wrapper is working well in my project! I did notice a couple things:

When the camera position is updated, the moon hides, and reappears when it is still lol
this is in the log, not sure if its skyx specific or not: "Can't assign material _NULL_ to SubEntity of SkyXMeshEnt because this Material does not exist. Have you forgotten to define it in a .material script?"
I had to apply the invalid parameters fix from the wiki to fix a log error that wasn't breaking skyx, but i wanted to remove the complaint from the log.
shadows totally break skyx! the following table will explain:

ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE; //shadows, SkyX BROKEN
ShadowTechnique.SHADOWTYPE_STENCIL_MODULATIVE; //no shadows, SkyX BROKEN

ShadowTechnique.SHADOWTYPE_NONE; //no shadows, SkyX WORKS
ShadowTechnique.SHADOWTYPE_TEXTURE_ADDITIVE; //no shadows, SkyX WORKS
ShadowTechnique.SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED; //no shadows, SkyX WORKS
ShadowTechnique.SHADOWTYPE_TEXTURE_MODULATIVE; //no shadows, SkyX WORKS
ShadowTechnique.SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED; //no shadows, SkyX WORKS


I think next ill be tapping into mhydrax and then trying to get it talking with skyx. Thanks again Boyamer!

nico008

07-01-2011 15:43:18


When the camera position is updated, the moon hides, and reappears when it is still lol
this is in the log, not sure if its skyx specific or not: "Can't assign material _NULL_ to SubEntity of SkyXMeshEnt because this Material does not exist. Have you forgotten to define it in a .material script?"
I had to apply the invalid parameters fix from the wiki to fix a log error that wasn't breaking skyx, but i wanted to remove the complaint from the log.

Same for me.

I have not much experience with shadow but currently I can't see any shadow in my project :-( (not even on the ground or something)

boyamer

08-01-2011 10:35:40

Don't even use Stencil shadows,as they're used for old hardware with fixed function pipeline,as skyx is shader based probably there is a problem.

Beauty

08-01-2011 13:24:46

I added this important note to the wiki page SkyX Wrapper for MOGRE.

CodeKrash

09-01-2011 00:02:42

Don't even use Stencil shadows,as they're used for old hardware with fixed function pipeline,as skyx is shader based probably there is a problem.

regardless of how "old" you say they are, ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE happens to be the only mode that works in this particular application.

I wasn't aware that shader based techniques break in shadow enabled scenes. Is there a workaround to allow skyx and shadows, because it seems to me that having to sacrifice shadows for a fancy sky is.. well... crappy. Even more crappy is the "don't use them" non answer, telling me that you probably don't intend to even approach the issue.

kdr35

11-01-2011 09:29:59

Hi, thanks for SkyX 0.1 Wrapper for Mogre,

Does SkyX 0.1 Wrapper support Mogre 1.7.x ?

boyamer

11-01-2011 21:05:25

Yes of course,it supports Mogre 1.7.x

McDonte

01-02-2011 22:52:00

Thanks a lot, this wrapper works great!

Just a question: could you include the AtmosphereManager Options? These are needed to get the position of the sun and so on. I need this to update my application but at the moment I have no control over it.

CodeKrash

03-02-2011 17:32:59

i also noticed the missing exports, specifically the lack of sun pos support

kdr35

10-02-2011 14:59:04

Hi, i want to skyx in my project but have some problems. I downloaded skyx.ddl to mogre 1.7.1. Skyx example works clearly with Mogre 1.7.1 SDK dlls but we use .NET framework 4.0 so we change standart mogre 1.7.1 dlls to .Net Framework 4.0 mogre dlls. When i use .net 4.0 mogre dlls, skyx doesnt working. How can I solve this problem?

thanks.

McDonte

17-02-2011 14:30:43

For me SkyX does work with .NET 4...I just used the provided dlls, didn't need to recompile anything.
What error message do you get?

kdr35

17-02-2011 16:30:20

I am taking the error in SkyManager.cs;
public void Create()
{
Manager_Create(NativeHandle);
}

Error message says:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I think,I usually take that type errors because of uncompatible dlls version while working on mogre. Skyx runtime version is .Net 2.0 framework but mogre's runtime version is 4.0. That uncompatible situation might be cause error. I solved same problem which is working caelum with caelum as use compiled caelum dll on Net 4.0. If is there anyone has compiled skyx on .net 4.0 dlls,I think it will solve the problem.

Thanks.

CodeKrash

18-02-2011 21:26:18

I am taking the error in SkyManager.cs;
public void Create()
{
Manager_Create(NativeHandle);
}

Error message says:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I think,I usually take that type errors because of uncompatible dlls version while working on mogre. Skyx runtime version is .Net 2.0 framework but mogre's runtime version is 4.0. That uncompatible situation might be cause error. I solved same problem which is working caelum with caelum as use compiled caelum dll on Net 4.0. If is there anyone has compiled skyx on .net 4.0 dlls,I think it will solve the problem.

Thanks.



If you look deeper in the exception, you might find something to do with the vector2 that becomes null after the managed/native transition marshaling process, causing a null argument logical exception

Z:\Projects\extramegablob\skyxmogre\SkyX\SkyX\CloudsManager.cpp

line 323


EXPORT SkyX::CloudLayer* CloudsManager_Add(SkyX::CloudsManager* ptr,float height,float scale,const Ogre::Vector2& windDirection,
float timeMultiplier,float distanceAttenuation,float detailAttenuation,float normalMultiplier,
float heightVolume,float volumetricDisplacement)
{
return ptr->add(SkyX::CloudLayer::Options(height,scale,Ogre::Vector2(1,1),timeMultiplier,distanceAttenuation,detailAttenuation,normalMultiplier,heightVolume,volumetricDisplacement));
}

Kwang1imsa

09-03-2011 03:17:55

I'm having the same error too, very good catch.

Any solutions?

CodeKrash

09-03-2011 06:38:56

I'm having the same error too, very good catch.

Any solutions?



I just posted the solution ,Ogre::Vector2(1,1)

Kwang1imsa

09-03-2011 15:14:56

I'm having the same error too, very good catch.

Any solutions?



I just posted the solution ,Ogre::Vector2(1,1)

Can someone compile this for me please?

codo

08-01-2012 17:42:07

Hello guys,
there seem to me some methods missing: AtmosphereManager.getOptions for example. How am I supposed to change parameters. Original SkyX demo has:

// Change SkyX atmosphere options if needed
SkyX::AtmosphereManager::Options SkyXOptions = mSkyX->getAtmosphereManager()->getOptions();


Any ideas why this hasn't been wrapped or workarounds?

Beauty

08-01-2012 23:45:03

Hi codo,

I can't help you with your question, but I'm happy to see you here again. :D

boyamer

09-01-2012 13:26:21

I'm going to update SkyX wrapper to version 0.2.1.

Hope this will help you.

Amer

codo

09-01-2012 14:50:18

@beauty It's good to be here again :) I'm gonna pimp my game up a bit...
@boyamer This is great. Can't wait to use it.

codo

25-03-2012 11:33:51

Any news on SkyX 0.2 wrapper anyone?

Beauty

25-03-2012 14:54:17

Hi codo,

in the meantime we had good proceedings with the MogreBuilder tool.
Now it's very easy to do the whole wrapping and compiling process of Mogre.

Zarifus published his development experiences in his blog. (Part1, part2, part3, part4)

You can download it here:
https://bitbucket.org/mogre/mogrebuilder

The development talk is here:
viewtopic.php?f=8&t=29272

In relation to SkyX could be these advantages:
  1. When you use the MogreBuilder, you have the lastest Mogre 1.7 version[/*:m]
  2. You also have all files, which you need to compile an add-on (Ogre sources, autogenerated Mogre source files, debug files and libraries)[/*:m]
  3. Theoretically its possible to extend the MogreBuilder to wrap an external add-on (e.g. SkyX)
    Side note: The mogre autowrapper was extended to wrap the Ogre terrain and paging component, too. (With exception of a few API methods, which caused problems.)[/*:m][/list:u]
    If you want to read details about the autowrapping process, then look here. (Links to documentation of user Manski.)

vinterdo

18-04-2012 13:40:27

Hi guys

I want to add SkyX to my VS 2008 c# project, but i have following exception:

14:27:49: OGRE EXCEPTION(4:ItemIdentityException): An object of type 'Entity' with name 'SkyXMeshEnt' already exists. in SceneManager::createMovableObject at ..\..\ogre\OgreMain\src\OgreSceneManager.cpp (line 6484)



There is full log:

14:27:44: Creating resource group General
14:27:44: Creating resource group Internal
14:27:44: Creating resource group Autodetect
14:27:44: SceneManagerFactory for type 'DefaultSceneManager' registered.
14:27:44: Registering ResourceManager for type Material
14:27:44: Registering ResourceManager for type Mesh
14:27:44: Registering ResourceManager for type Skeleton
14:27:44: MovableObjectFactory for type 'ParticleSystem' registered.
14:27:44: OverlayElementFactory for type Panel registered.
14:27:44: OverlayElementFactory for type BorderPanel registered.
14:27:44: OverlayElementFactory for type TextArea registered.
14:27:44: Registering ResourceManager for type Font
14:27:44: ArchiveFactory for archive type FileSystem registered.
14:27:44: ArchiveFactory for archive type Zip registered.
14:27:44: DDS codec registering
14:27:44: FreeImage version: 3.13.1
14:27:44: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
14:27:44: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
14:27:44: PVRTC codec registering
14:27:44: Registering ResourceManager for type HighLevelGpuProgram
14:27:44: Registering ResourceManager for type Compositor
14:27:44: MovableObjectFactory for type 'Entity' registered.
14:27:44: MovableObjectFactory for type 'Light' registered.
14:27:44: MovableObjectFactory for type 'BillboardSet' registered.
14:27:44: MovableObjectFactory for type 'ManualObject' registered.
14:27:44: MovableObjectFactory for type 'BillboardChain' registered.
14:27:44: MovableObjectFactory for type 'RibbonTrail' registered.
14:27:44: Loading library .\RenderSystem_Direct3D9
14:27:44: Installing plugin: D3D9 RenderSystem
14:27:44: D3D9 : Direct3D9 Rendering Subsystem created.
14:27:44: D3D9: Driver Detection Starts
14:27:44: D3D9: Driver Detection Ends
14:27:44: Plugin successfully installed
14:27:44: Loading library .\RenderSystem_GL
14:27:44: Installing plugin: GL RenderSystem
14:27:44: OpenGL Rendering Subsystem created.
14:27:44: Plugin successfully installed
14:27:44: Loading library .\Plugin_OctreeSceneManager
14:27:44: Installing plugin: Octree & Terrain Scene Manager
14:27:44: Plugin successfully installed
14:27:44: Loading library .\Plugin_CgProgramManager
14:27:44: Installing plugin: Cg Program Manager
14:27:44: Plugin successfully installed
14:27:44: *-*-* OGRE Initialising
14:27:44: *-*-* Version 1.7.1 (Cthugha)
14:27:45: Added resource location 'Media' of type 'FileSystem' to resource group 'General'
14:27:45: Added resource location 'Media/Hydrax' of type 'FileSystem' to resource group 'General'
14:27:45: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
14:27:45: D3D9 : RenderSystem Option: FSAA = 0
14:27:45: D3D9 : RenderSystem Option: Floating-point mode = Fastest
14:27:45: D3D9 : RenderSystem Option: Full Screen = No
14:27:45: D3D9 : RenderSystem Option: Rendering Device = Monitor-1-AMD Radeon HD 6900 Series
14:27:45: D3D9 : RenderSystem Option: Resource Creation Policy = Create on all devices
14:27:45: D3D9 : RenderSystem Option: VSync = No
14:27:45: D3D9 : RenderSystem Option: VSync Interval = 1
14:27:45: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
14:27:45: D3D9 : RenderSystem Option: sRGB Gamma Conversion = No
14:27:45: CPU Identifier & Features
14:27:45: -------------------------
14:27:45: * CPU ID: GenuineIntel: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
14:27:45: * SSE: yes
14:27:45: * SSE2: yes
14:27:45: * SSE3: yes
14:27:45: * MMX: yes
14:27:45: * MMXEXT: yes
14:27:45: * 3DNOW: no
14:27:45: * 3DNOWEXT: no
14:27:45: * CMOV: yes
14:27:45: * TSC: yes
14:27:45: * FPU: yes
14:27:45: * PRO: yes
14:27:45: * HT: no
14:27:45: -------------------------
14:27:45: D3D9 : Subsystem Initialising
14:27:45: Registering ResourceManager for type Texture
14:27:45: Registering ResourceManager for type GpuProgram
14:27:45: D3D9RenderSystem::_createRenderWindow "OGRE Render Window", 800x600 windowed miscParams: FSAA=0 FSAAHint= colourDepth=32 gamma=false monitorIndex=0 useNVPerfHUD=false vsync=false vsyncInterval=1
14:27:45: D3D9 : Created D3D9 Rendering Window 'OGRE Render Window' : 800x600, 32bpp
14:27:45: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
14:27:45: D3D9: Vertex texture format supported - PF_L8
14:27:45: D3D9: Vertex texture format supported - PF_L16
14:27:45: D3D9: Vertex texture format supported - PF_A8
14:27:45: D3D9: Vertex texture format supported - PF_A4L4
14:27:45: D3D9: Vertex texture format supported - PF_BYTE_LA
14:27:45: D3D9: Vertex texture format supported - PF_R5G6B5
14:27:45: D3D9: Vertex texture format supported - PF_B5G6R5
14:27:45: D3D9: Vertex texture format supported - PF_A4R4G4B4
14:27:45: D3D9: Vertex texture format supported - PF_A1R5G5B5
14:27:45: D3D9: Vertex texture format supported - PF_A8R8G8B8
14:27:45: D3D9: Vertex texture format supported - PF_B8G8R8A8
14:27:45: D3D9: Vertex texture format supported - PF_A2R10G10B10
14:27:45: D3D9: Vertex texture format supported - PF_A2B10G10R10
14:27:45: D3D9: Vertex texture format supported - PF_DXT1
14:27:45: D3D9: Vertex texture format supported - PF_DXT2
14:27:45: D3D9: Vertex texture format supported - PF_DXT3
14:27:45: D3D9: Vertex texture format supported - PF_DXT4
14:27:45: D3D9: Vertex texture format supported - PF_DXT5
14:27:45: D3D9: Vertex texture format supported - PF_FLOAT16_RGB
14:27:45: D3D9: Vertex texture format supported - PF_FLOAT16_RGBA
14:27:45: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
14:27:45: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
14:27:45: D3D9: Vertex texture format supported - PF_X8R8G8B8
14:27:45: D3D9: Vertex texture format supported - PF_X8B8G8R8
14:27:45: D3D9: Vertex texture format supported - PF_R8G8B8A8
14:27:45: D3D9: Vertex texture format supported - PF_DEPTH
14:27:45: D3D9: Vertex texture format supported - PF_SHORT_RGBA
14:27:45: D3D9: Vertex texture format supported - PF_FLOAT16_R
14:27:45: D3D9: Vertex texture format supported - PF_FLOAT32_R
14:27:45: D3D9: Vertex texture format supported - PF_SHORT_GR
14:27:45: D3D9: Vertex texture format supported - PF_FLOAT16_GR
14:27:45: D3D9: Vertex texture format supported - PF_FLOAT32_GR
14:27:45: D3D9: Vertex texture format supported - PF_SHORT_RGB
14:27:45: D3D9: Vertex texture format supported - PF_PVRTC_RGB2
14:27:45: D3D9: Vertex texture format supported - PF_PVRTC_RGBA2
14:27:45: D3D9: Vertex texture format supported - PF_PVRTC_RGB4
14:27:45: D3D9: Vertex texture format supported - PF_PVRTC_RGBA4
14:27:45: RenderSystem capabilities
14:27:45: -------------------------
14:27:45: RenderSystem Name: Direct3D9 Rendering Subsystem
14:27:45: GPU Vendor: ati
14:27:45: Device Name: Monitor-1-AMD Radeon HD 6900 Series
14:27:45: Driver Version: 8.17.10.1119
14:27:45: * Fixed function pipeline: yes
14:27:45: * Hardware generation of mipmaps: yes
14:27:45: * Texture blending: yes
14:27:45: * Anisotropic texture filtering: yes
14:27:45: * Dot product texture operation: yes
14:27:45: * Cube mapping: yes
14:27:45: * Hardware stencil buffer: yes
14:27:45: - Stencil depth: 8
14:27:45: - Two sided stencil support: yes
14:27:45: - Wrap stencil values: yes
14:27:45: * Hardware vertex / index buffers: yes
14:27:45: * Vertex programs: yes
14:27:45: * Number of floating-point constants for vertex programs: 256
14:27:45: * Number of integer constants for vertex programs: 16
14:27:45: * Number of boolean constants for vertex programs: 16
14:27:45: * Fragment programs: yes
14:27:45: * Number of floating-point constants for fragment programs: 224
14:27:45: * Number of integer constants for fragment programs: 16
14:27:45: * Number of boolean constants for fragment programs: 16
14:27:45: * Geometry programs: no
14:27:45: * Number of floating-point constants for geometry programs: 0
14:27:45: * Number of integer constants for geometry programs: 0
14:27:45: * Number of boolean constants for geometry programs: 0
14:27:45: * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
14:27:45: * Texture Compression: yes
14:27:45: - DXT: yes
14:27:45: - VTC: no
14:27:45: - PVRTC: no
14:27:45: * Scissor Rectangle: yes
14:27:45: * Hardware Occlusion Query: yes
14:27:45: * User clip planes: yes
14:27:45: * VET_UBYTE4 vertex element type: yes
14:27:45: * Infinite far plane projection: yes
14:27:45: * Hardware render-to-texture: yes
14:27:45: * Floating point textures: yes
14:27:45: * Non-power-of-two textures: yes
14:27:45: * Volume textures: yes
14:27:45: * Multiple Render Targets: 4
14:27:45: - With different bit depths: yes
14:27:45: * Point Sprites: yes
14:27:45: * Extended point parameters: yes
14:27:45: * Max Point Size: 10
14:27:45: * Vertex texture fetch: yes
14:27:45: * Number of world matrices: 0
14:27:45: * Number of texture units: 8
14:27:45: * Stencil buffer depth: 8
14:27:45: * Number of vertex blend matrices: 0
14:27:45: - Max vertex textures: 4
14:27:45: - Vertex textures shared: no
14:27:45: * Render to Vertex Buffer : no
14:27:45: * DirectX per stage constants: yes
14:27:45: ***************************************
14:27:45: *** D3D9 : Subsystem Initialised OK ***
14:27:45: ***************************************
14:27:45: DefaultWorkQueue('Root') initialising on thread main.
14:27:45: Particle Renderer Type 'billboard' registered
14:27:45: SceneManagerFactory for type 'OctreeSceneManager' registered.
14:27:45: SceneManagerFactory for type 'TerrainSceneManager' registered.
14:27:45: Creating resource group Media
14:27:45: Added resource location 'Media' of type 'FileSystem' to resource group 'Media'
14:27:45: Creating resource group SkyX
14:27:46: Added resource location 'Media/SkyX' of type 'FileSystem' to resource group 'SkyX'
14:27:46: Parsing scripts for resource group Autodetect
14:27:46: Finished parsing scripts for resource group Autodetect
14:27:46: Parsing scripts for resource group General
14:27:46: Parsing script Level.material
14:27:46: Parsing script Man.material
14:27:46: Parsing script terrain.material
14:27:46: Parsing script Vase.material
14:27:46: Parsing script Fonts.fontdef
14:27:46: Finished parsing scripts for resource group General
14:27:46: Parsing scripts for resource group Internal
14:27:46: Finished parsing scripts for resource group Internal
14:27:46: Parsing scripts for resource group Media
14:27:46: Parsing script Level.material
14:27:46: Parsing script Man.material
14:27:46: Parsing script terrain.material
14:27:46: Parsing script Vase.material
14:27:46: Parsing script Fonts.fontdef
14:27:46: Finished parsing scripts for resource group Media
14:27:46: Parsing scripts for resource group SkyX
14:27:46: Parsing script SkyX.material
14:27:48: Parsing script Terrain.material
14:27:48: Finished parsing scripts for resource group SkyX
14:27:48: TerrainSceneManager: Registered a new PageSource for type Heightmap
14:27:49: Can't assign material _NULL_ to SubEntity of SkyXMeshEnt because this Material does not exist. Have you forgotten to define it in a .material script?
14:27:49: Texture: SkyX_Starfield.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
14:27:49: Texture: SkyX_Moon.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
14:27:49: OGRE EXCEPTION(4:ItemIdentityException): An object of type 'Entity' with name 'SkyXMeshEnt' already exists. in SceneManager::createMovableObject at ..\..\ogre\OgreMain\src\OgreSceneManager.cpp (line 6484)


Anybony know why that dont work properly? I only simple create an SkyManager and trying to run skymanager.Create()

Thanks from advance for help

EDIT:
I have the same problem with MHydraX

Beauty

18-04-2012 22:13:38

Hi Vinterdo,

welcome to Mogre. :D

Unfortunately I can't help much, because I never used MHydrax nor SkyX.

An interesting question would be to know which code tried to add an entity with already used name. (In Ogre/Mogre the names has to be unique.)
It's a wrapped library. So there is a good chance that it's a bug in the original C++ code.


I suggest to do this:

1)
Ask for this problem in the SkyX topic of the main forum. Perhaps it's a known issue.

2)
Try to update the code. Use the latest SkyX library version and update the wrapper if needed.
Yes, this could be a hard task.
If it's realy a bug, perhaps there is a compromise solution: Just apply a bugfix (by help of the latest code and the help of people in the main topic) and compile the SkyX library. So the API shouldn't be touched and the wrapper needs no change. (Only maybe a recompile.)

An other reason could be a wrong usage of the SkyX wrapper API. But I suppose the people in the main topic tell it, if this is the case. (Additionally you need to show your used SkyX code.)

If you don't need MHydrax and only sky simulation, an alternative would be CaelumSharp. It's not wrapped - it's a complete C# port. The sky settings you can change by a config file.

A water alternative could be OgreWater. Currently it's only available for Ogre. I looked to the code some time ago. It seems so that it's not difficult to use it for Mogre. The media files still exists and the shaders should be usable, too. At least this could be easy for the older version, which simulates water on a flat plane (2D surface).
The latest version has a 3D water surface. For this I don't know if the effort is much more higher.

This is some background information.
A direct help for your problem I can't offer. Sorry.

vinterdo

19-04-2012 15:50:12

Thanks for reply. Im trying to solve that problem on my own. I cant find anybody who have this problem too. Im dont create any entity with same name - probably im doing something wrong with initialization of SkyX / HydraX.

Beauty

19-04-2012 17:07:41

I really suggest to post this problem in the SkyX main topic!
There the SkyX developer will read it. He should know more.

If you found a solution, please let us know. (Source + solution)

probably im doing something wrong with initialization of SkyX / HydraX
Watch out for an example code. (in forums or downloads or Hydrax repository (if exists) )
It doesn't care if it's for Ogre or Mogre. Just to see how it's done by others.

vinterdo

20-04-2012 15:41:09

Problem solved!

Because i was creating SkyX and HydraX instance in my water class constructor. Water class was was used in Level class which was creating 2 times - so HydraX instance was creating 2 times too. Because of this HydraX want to create 2 instances of every Entities, Cameras and Nodes. So i have right - i making something wrong :)