Jump to content

can i get NodeSector Sample?


photo

Recommended Posts

Posted

NodeSector Class is loading only mesh , image and texture.

 

unigine engine have delay time for material and Node Load.

 

can unigine engine support seamless background streaming?

Posted

Read this forum thread for some more details. As you already have mentioned at the moment UNIGINE only supports streaming of mesh, images and texture data, but all nodes and material libraries of large world still have to be loaded on startup and stay in mermory all the time.

 

Real zone-based tiled world streaming including node files, properties and material libraries required for "endless" worlds has been discussed several times here on the forum (e.g. this thread), but implementation by UNIGINE is still open.

Posted

I have read those threads.

 

can you make sample code that does streaming using unigine engine?

Posted

Have a look into NodeSector documentation. Required steps are quite well explained. Also some code snippets can be found here

Posted

Hi,

 

Does Ulf's posts solve your problem or you still need code sample?

Posted

i need code sample.

 

i want look at process stream in Unigine Engine.

Posted

Hi,

 

For NodeSector usage please take a look at samples/lightmap/loading.cpp. Is that you searching for?

Posted

UnigineSDK-source-2012-04-11 not have folder to data/samples/lightmap/.

 

instead exist folder data\samples\lights.

 

not found loading.cpp.

Posted

My fault. Its location is in data/demos/lightmap/loading.cpp

 

By the way, here is this code sample in case you haven't demos folder:

 

/* Copyright (C) 2005-2012, Unigine Corp. All rights reserved.
*
* File:	lightmap.cpp
* Desc:	Lightmap demo
* Version: 1.01
* Author:  Alexander Zaprjagaev <frustum@unigine.com>
*
* This file is part of the Unigine engine (http://unigine.com/).
*
* Your use and or redistribution of this software in source and / or
* binary form, with or without modification, is subject to: (i) your
* ongoing acceptance of and compliance with the terms and conditions of
* the Unigine License Agreement; and (ii) your inclusion of this notice
* in any version of this software that you use or redistribute.
* A copy of the Unigine License Agreement is available by contacting
* Unigine Corp. at http://unigine.com/
*/

#include <core/scripts/camera.h>

/*
*/
float time;
NodeSector sector;
PlayerSpectator player;
Unigine::CameraPath camera;

/*
*/
int init() {

 player = new PlayerSpectator();
 player.setZNear(0.1f);
 player.setZFar(20000.0f);
 player.setPosition(vec3(12.0f,-2.6f,2.8f));
 player.setDirection(vec3(-1.0f,0.0f,-0.2f));
 player.setControlled(0);
 player.setCollision(0);
 engine.game.setPlayer(player);

 camera = new Unigine::CameraPath("lightmap/camera/camera.txt");

 // get sector
 sector = node_cast(engine.editor.getNodeByName("sector"));

 // update resources
 sector.updateMeshes();
 sector.updateTextures();

 // increase the loading time
 engine.console.setFloat("filesystem_delay",0.05f);

 return 1;
}

/*
*/
int update() {

 // load resources
 if(sector.loadMeshes() == 0 || sector.loadTextures() == 0) {
   engine.message("Loading...");
   return 1;
 }

 // enable sector
 engine.message("Ready");
 engine.console.setFloat("filesystem_delay",0.0f);

 sector.setEnabled(1);

 yield 1;

 if(engine.editor.isLoaded() == 0) {
   time += engine.game.getIFps();
   camera.setFrame(player,time * 25.0f);
 }

 return 1;
}

Posted

thank for reply!

 

node sector is good solution when preloaded. that Node , World And Base Resource.

 

node sector was useless in seamless World.

Posted

You can create an array of NodeSectors and use 'update/load' calls when you need to load new chunk and 'clear' calls when you don't need this chunk. This approach could be useful if you want to stream only meshes/textures. Unfortunately, you can't stream properties, nodes and material libraries.

 

Could you specify your use case for streaming?

×
×
  • Create New...