Mariano Cerdeiro wrote:
> 
> Hello,
> 
> I am new with CS and I have some basic questions:
> 
> 1.- I am Loading a genmesh from a library exported from blender (with
> blender2cs). The library is a genmesh with 7000 polygons and texture.
> The first problem is that I need 5 minutes to start the engine. I have
> 3 lights on my world and on the second light the engine take this time
> to run CalculateLighting().
> 
> engine.cpp line 1314: (CS 1.0)
> 
>    while (lit->HasNext ())
>    {
>      if (doVerbose)
>      {
>        csPrintf ("Doing light %d\n", lit_cnt);
>        fflush (stdout);
>      }
>      lit_cnt++;
>      l = lit->Next ();
>      ((csLight*)l)->GetPrivateObject ()->CalculateLighting (); /* <---
> take 5 minutes */
>      if (meter) meter->Step ();
>    }
> 
> If I use a simple box with only 6 faces there is no time problem. I
> can jump this instruction and works fine too, but really darkly..
> 
> 2.- and the second question. This genmesh has a texture, and the
> texture is defined on the library too, but by drawing the texture is
> no present.. :( I use to load the mesh:
> 
> loader->LoadLibraryFile("library");
> 
> carMeshFactoryWrapper = engine->FindMeshFactory("genMeshName");
> 
> carMeshWrapper =
> engine->CreateMeshWrapper(carMeshFactoryWrapper,"name",
> engine->GetSectors()->FindByName("Scene"), csVector3(position.x,
> position.y, position.z ) );
> 
> I don't have any problem with the textures of the world...
> 
> Thanks
> Mariano.-
> 
> 

Hello :)

Welcome to CS,

1.) if you have the line engine->SetLightingCacheMode (0); in your code, you
can remove it. The next time you run your application, run it with the
command line switch /relight. It will take some time to load but the
lightmaps should get cached and the next time the application should load
the cached light maps without running a full relight.

2.) The way blender2crystal makes libraries is a little misleading. Firstly
it makes a Texture folder within the .zip file and places the textures in it
but the CS Engine actually looks for the texture on the VFS. If you edit
your library you will see the lines for texture:

  <textures>
    <texture name='ninja_test_model.png'>
      <file>/lib/textures/ninja_test_model.png</file>
    </texture>
  </textures>

You will notice that my code above has the extra /lib/ portion in front of
textures. This means to load my textures from my library file and not my
Textures file/folder that is defines as @data/Textures within VFS.cfg. 

So, you can either change the place the CS Engine looks for the texture,
then re-add the library file back to your (library).zip file, or you can add
the texture file to your (texture).zip file.

Hope thats not too confusing!
-- 
View this message in context: 
http://www.nabble.com/basic-questions-tf3894062.html#a11040439
Sent from the Crystal Space - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to