Horde3D

Next-Generation Graphics Engine
It is currently 29.11.2024, 15:56

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 20.09.2009, 12:30 
Offline

Joined: 18.09.2009, 07:44
Posts: 17
Hi all, we've just begun development using this terrific engine and I have some questions regarding the best way to load content from memory. I'm using the .NET wrapper and I've attempted to load the attached box in the following way:

Code:
//insert a null terminator into the xml byte stream
MemoryStream ms = _LoadEmbeddedResource() //
ms.Position = ms.Length -1;
ms.WriteByte((byte)'\0'); //insert null terminator

byte[] bytes = ms.ToArray();
resId = h3d.addResource((int)h3d.H3DResTypes.SceneGraph, resourceName, 0);
h3d.loadResource(resId, bytes, bytes.Length);
int node = h3d.addNodes(h3d.H3DRootNode, resId);

The result of which is a screen without my boxes and a log that looks like this:

Quote:
0.000 Initializing GL2 backend using OpenGL driver '3.0.0' by 'NVIDIA Corporation' on 'GeForce 8400M GS/PCI/SSE2'
0.020 Loading resource 'pipelines/forward.pipeline.xml'
0.020 Loading resource 'overlays/font.material.xml'
0.020 Loading resource 'overlays/panel.material.xml'
0.020 Loading resource 'pipelines/globalSettings.material.xml'
0.021 Loading resource 'shaders/overlay.shader'
0.021 ---- C O M P I L I N G . S H A D E R . shaders/overlay.shader@OVERLAY[0] ----
0.027 Loading resource 'overlays/font.tga'
0.048 Loading resource 'textures/common/white.tga'
0.049 Loading resource 'textures/ambientMap.dds'
4.366 Loading resource 'box.scene.xml'

If I store my content on disk and load using Horde3DUtils.loadResourcesFromDisk, all works as expected and I can see the boxes. It seems to pick up the missing shaders, materials, etc automatically:

Quote:
0.000 Initializing GL2 backend using OpenGL driver '3.0.0' by 'NVIDIA Corporation' on 'GeForce 8400M GS/PCI/SSE2'
0.019 Loading resource 'pipelines/forward.pipeline.xml'
0.019 Loading resource 'overlays/font.material.xml'
0.019 Loading resource 'overlays/panel.material.xml'
0.020 Loading resource 'pipelines/globalSettings.material.xml'
0.020 Loading resource 'shaders/overlay.shader'
0.020 ---- C O M P I L I N G . S H A D E R . shaders/overlay.shader@OVERLAY[0] ----
0.025 Loading resource 'overlays/font.tga'
0.045 Loading resource 'textures/common/white.tga'
0.046 Loading resource 'textures/ambientMap.dds'
10.602 Loading resource 'models/box/box.scene.xml'
10.602 Loading resource 'models/box/box.geo'
10.603 Loading resource 'models/box/box.material.xml'
10.603 Loading resource 'shaders/model.shader'
10.603 Loading resource 'shaders/utilityLib/vertCommon.glsl'
10.604 Loading resource 'shaders/utilityLib/vertSkinning.glsl'
10.604 ---- C O M P I L I N G . S H A D E R . shaders/model.shader@SHADOWMAP[0] ----
10.610 Loading resource 'shaders/utilityLib/fragDeferredWrite.glsl'
10.610 ---- C O M P I L I N G . S H A D E R . shaders/model.shader@ATTRIBPASS[0] ----
10.615 Loading resource 'shaders/utilityLib/fragLighting.glsl'
10.615 ---- C O M P I L I N G . S H A D E R . shaders/model.shader@LIGHTING[0] ----
10.630 ---- C O M P I L I N G . S H A D E R . shaders/model.shader@AMBIENT[0] ----

I've tried various incarnations of my code including manual loading of the material and geometry using similar code to the above, but I can't quite get it correct :?


Attachments:
box.zip [840 Bytes]
Downloaded 623 times
Top
 Profile  
Reply with quote  
PostPosted: 20.09.2009, 19:47 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
In Horde content is always loaded from memory, the loadResourcesFromDisk function is just a utility function which copies the files to memory. But it seems that in your own version you just load the scene graph resource and not the geometry and material resources.


Top
 Profile  
Reply with quote  
PostPosted: 21.09.2009, 07:02 
Offline

Joined: 18.09.2009, 07:44
Posts: 17
Thanks for the reply marciano, I looked at my code again when I was less tired and realised I'd made a mistake with my null terminator which was causing the code files to load incorrectly :oops:

All is working now!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group