Crystal Space
Welcome, Guest. Please login or register.
September 17, 2014, 12:51:11 pm

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2051 Topics by 8471 Members
Latest Member: Jeffhogan
* Home Help Search Login Register
  Show Posts
Pages: 1 [2] 3 4 5
16  Crystal Space Development / Support / Re: Defining a submesh within a genmesh factory on: November 22, 2007, 11:05:10 am
What version of CS do you have? In 1.2 submeshes are *only* defined in factories. Not in meshes.
That sounds as it should!
Now I still use 1.01, so this is a good moment for me to make the switch....
thanks
17  Crystal Space Development / Support / Re: Textures getting blurry on: November 22, 2007, 10:36:11 am
Also dig in data/config/r3dopengl.cfg you can find many kewl options there.
indeed, this file contains a variable for anisotropic filtering:
Code:
Video.OpenGL.TextureFilterAnisotropy
which is defaulted to 1.0, effectively disabling it
Using this variable, the global setting in the driver (from the control panel) could be set back to "application controlled"
can't you turn off mip maps?
I have tried to do that in some cases but there was no effect
I'm not sure if it didn't turn them off or they simply don't have a visible difference.
Maybe someone can explain?

example CreateTexture(name, name, NULL, CS_TEXTURE_NOMIPMAPS | CS_TEXTURE_2D);
i don't know why there was no visible effect, what i can say however is that it will not be a solution for the high slanted planes. Disabling mipmapping would exchange blurriness for aliasing artifacts: (bi-)linear texture filtering (which is what you would use if you disable mipmapping) will only consider 4 "most close texels near the sample point". The "footprint" of the projected screenpixel onto the texture however "covers" more texels than the "4 most close near the center of the footprint", which will result in aliasing effects. Sampling theory says that there is a minimum sampling frequency required in order to avoid alisaing. Texture filtering on slanted planes will result in a kind of "eliptical shaped" footprint. Anisotropic filtering wil use more texels along the major axis than along the minor, effectively minimizing the aliasing artifacts.

High levels of anisotropic filtering can be expensive, so you would like to specify it per object.
I don't know if it is possible to specify the level of anisotropy in a shader...
18  Crystal Space Development / Support / Re: Textures getting blurry on: November 21, 2007, 03:56:34 pm
this is a typical situation where anisotropic texture filtering is needed. You could try to enforce this from the driver, on windows-XP, nvidia and ati cards often have a way to enable this from the desktop->properties->settings->advance-> etc....  Disable the "application-controlled" button and experiment with the slider setting...
19  Crystal Space Development / Support / Defining a submesh within a genmesh factory on: November 21, 2007, 03:47:46 pm
I'm changing the 3dsmax exporter to use genmeshes instead of thingmeshes, so i can use both vertex-lighting and lightmaps.

For this i want to use submeshes as part of the genmesh factories (to be able to use different materials within 1 mesh object)

From the documentation (section 4.10.8 "Genmesh Mesh Object") i conclude that such a genmesh factory could be defined as follows 

Code:
<meshfact name="t01">
  <plugin>crystalspace.mesh.loader.factory.genmesh</plugin>
    <params>
      <v x="-961.188" y="0.0" z="750.036" u="0.0" v="1.0" />
      ....
      <t v1="0" v2="1" v3="2" />
      .....
      <submesh>
         <material>....
         <mixmode>...
         <t>0</t>
         .....
      </submesh>
      ....
    </params>
  <plugin>
</meshfact>
This however doesn't work, when loading a scene with this factory i get the error:
Code:
crystalspace.syntax.badtoken: Unexpected token 't'!
In the example scenes, i can only see a submesh in "flarge". However, there the submesh is defined in a genmesh instance and not in the factory, i cannot see an example where a submesh is defined in a genmesh factory.

Does anyone knows how to do this?
20  Crystal Space Development / Support / Re: CS and RakNet on: November 20, 2007, 04:24:42 pm
i do agree that it is not acceptable to needlessly send packets with the framerate of the application. However, the function that is called at each iteration is merely a check if something needs to be synchronised. If none of the synchronised objects change state, the "poll" doesn't waste  network/CPU resources (at least not much). Decoupling the "local object update" and serialisation (which would trigger deserialisation at the ghosts) in combination with dead reckoning would be a way to both control/limit the network traffic and having good visual apearance. Seen as such, the "once per frame" activity would be a combination of receiving network updates when available and predicting the new state (position/orientation etc).
For my current application this is not a problem, meaning that i serialise the object position (using a method of the ReplicaManager)  as soon it is localy updated. In case of a local player update this is done in the event handling method of the application. In case of CEL, this should be done somewhere in the property classes.

P.S. BTW, do you know that Sun has now released the source for SGS/DarkStar server and client. I downloaded and went through the manuals, but as its all Java-based it does not suit me.
Darkstar is indeed mainly java, and as such looks not suited. Using it from C++ would involve 2 parts that have to be written

1-  java part, that is plugged into the (java) server-framework
2- C++ client that uses the C++ library (present in the SGS SDK)

For a CS plugin, these parts would make "part" of the plugin.
The point is that i don't know any C/C++ opensource solution if you want to create robust scalable MMORG applications....
On the speed issue: i think that the network will be the bottleneck and not the (slower than C++) java processing.....
21  Crystal Space Development / Support / Re: Problem with integrating "Torque Network Library" on: November 12, 2007, 04:57:16 pm
Speed and efficiency are ofcourse alsways important issues, it is that there are more issues for a typical MMORG than for a FPS. Suppose that you were making a server for a MMORGS using a "network library" like Raknet. 10 people connect, no problem. 100 connect, no problem. 10000 connect, crash because of memory depletion, after restarting the server, all data is gone. With other words, its not enough to have your data only in memory.
More in general, how do you insure that players can continue playing without starting from 0 when a server quits for whatever reason (too many connections, no more memory etc).
More than that, you would like another server to automaticaly takeover if the main server would crash. Dealing with all these issues is not easy, SGS claims to have an opensource solution for this.
Check the faq of SGS for other issues

http://www.projectdarkstar.com/index.php?option=com_content&task=view&id=19&Itemid=37

If these issues are not important for you, a "network library" (although  RakNet is more than just that)  is sufficient.

Incidently, I also just now finished reading the RakNet manual. If I'd had my own messageloop it seems simple how to integrate with RakNet. But how exactly to pass the events to CS Run() loop or actually vice-versa.. for instance at this stage I'm not clear at all on how would I catch an onKeyboard event and send it to server (for instance to replicate player movement).
Simply means I need to look more into CS event handling Smiley

Conceptually, if you want to syncronize the position of a player, the position is the relevant state, and it is irrelevant to the synchronisation part how this state is updated. In case of a keypress, it is the new position of the object that is send to the server, and not the keypress.

you could define a function tick() that is called in the CS ProcessFrame() method of the csApplicationFramework based application.
Code:
tick()
{
  p = rakPeer->Receive();
  if (p)
  {
   ...
    rakPeer->DeallocatePacket(p);
  }
}
In this way RakNet execution occurs once per frame. The Raknet::ReplicaConstructor based class is responsible for ghost object creation.
When the position of a player has changed as result of a keypress, this has to be told to the RakNet::ReplicaManager:
Code:
replicaManager.SignalSerializeNeeded(player, UNASSIGNED_SYSTEM_ADDRESS, true); // UNASSIGNED_SYSTEM_ADDRESS, true means everybody
For a plugin module, this tick() function would actually be the ProcessFrame method of the plugin. The update of the player position from the main application class should then trigger an event that will be handled by the network plugin.

If CEL would be used as a "starting point" (instead of core CS), the PropertyClass mechanism could be used to send events to the network plugin, this could be an elegant solution....
22  Crystal Space Development / Support / Re: Problem with integrating "Torque Network Library" on: November 12, 2007, 11:56:42 am
I do think though that either of these libraries are by themselves neither optimised for MMORPGs nor for FPS, these are just plain network libraries. The ability to support large number of players in MMORPG is usually implemented through various algorithms and techniques such as server-side extrapolation and so on. Since raknet handles UDP well it seems quite an appropriate base on which one could develop either an FPS or an MMORPG. Supporting mobile devices is certainly another issue.
i don't agree on that, RakNet is by itself not scalable such that is can be used for MMORGs, SGS on the other hand is designed with this in mind. In terms of "efficiency and speed", RakNet looks stronger. Ofcourse this is another kind of discussion, you should check the design documents (and experiment with the SDK's) if you are interested.
Anyway, to be more constructive, i can tell that i'm very pleased with the RakNet solution. I started studying the ReplicaManagerCS example of the SDK, which is a good example to get an overview. Basicaly, you derive your "synchronised class" from RakNet::Replica. After establishing a connection with your server application (in case of an client-server approach), the server can (as an example) instantiate the "synhcronised object", all connected clients will receive this "event" such that the "ghost" objects can be created. When one of the clients upates its "local gost", all other gost will be synchronised. The "syncronised class" contains just the state that needs to be synchronised, for example, a CS actor object will be connected to a "synchronised class" such that only the relevant state will be syncronised, you do not want complete object synchronisation, because this is redundant and thus inefficient. Ofcourse there are all kinds of details, but basically this is how it can be used.
The syncrhonisation part of the project is not confidential, so i can share the corresponding class structure soon (i quite busy getting my application ready..)

23  Crystal Space Development / Support / Re: Problem with integrating "Torque Network Library" on: November 09, 2007, 01:33:33 pm
Hi maharaja,

At the moment I implemented a class structure using CS and RakNet components. As part of the learing curve, this will most likely  change a few times. The experience gained in this way could serve as a good base for defining a CS plugin. One issue is ofcourse that RakNet is not OpenSource...
SGS would probably fit better in that respect. The emphasis of these 2 project is however a bit different. Darkstar is more focussed on massive-multiplayer involving heterogenous participants (like pc's, cell-phones etc), where RakNet is more focussed on fast and efficient communication between homogenous partners, so probably more suited for applications like fast pace shooters, not involving a "massive" amount of players.
Anyway, i am interested in multiplayer solutions for CS, lets keep in touch...


24  Crystal Space Development / Support / Re: Factories of Thing Meshes? on: October 22, 2007, 09:35:28 am
Note that thing meshes shouldn't be used anymore. Genmesh is preferred now.
does this mean that in the current version of CS genmeshes can be used with lightmaps ?
This would be great, in that case i can refactor the 3dsmax exporter to only use genmeshes.
25  Crystal Space Development / Game Content Creation / Re: Q: multiple semi-transparent objects? on: October 19, 2007, 11:13:25 am
Hi Kriss,

the manual only discusses the "binary alpha" and "keycolor" modes.
I checked the source code for other modes: in plugins\csparser\services\syntaxldr.cpp you can see 3 types:

1- "smooth"
2- "binary"
3-"smooth"


So in order to alpha-blend based on an per-texel-alpha that is present in the texture, this should  be possible with.

<texture name="transparent">
    <file>mytexture.png</file>
    <alpha><smooth/></alpha>
</texture>


About the 3ds exporter:
i'm now picking up my activities on the 3dsmax exporter. The latest version has full shader-support.
I designed it in such a way that it should be convenient to use. This version is almost ready.
If you/others are interested i can send you a version as soon it is "ready to be used/tested"
26  Crystal Space Development / Game Content Creation / Re: Q: multiple semi-transparent objects? on: October 18, 2007, 09:51:24 am
For dynamicaly generated semi-transparant meshes i used the following:

  _mesh->GetMeshObject()->SetMixMode(CS_FX_ALPHA);
  _mesh->SetZBufMode(CS_ZBUF_TEST);
  _mesh->SetRenderPriority(_engine->GetAlphaRenderPriority());

These properties can also be defined in the world file.

For the texture i set the following
txtDemo->GetTextureHandle()->SetAlphaType(csAlphaMode::alphaSmooth);

In the world file, the culler for the sector should be set to "frustvis". Don't use "dynavis" because it will cull objects that
are completely "obscured" by other meshes, no matter if they are semi-transparant or not.
 
<cullerp>crystalspace.culling.frustvis</cullerp>
27  Crystal Space Development / Support / Re: Problem with integrating "Torque Network Library" on: October 10, 2007, 09:31:01 am
i hate any crash...
Instead of trying to solve the specific problem, i threw TNL aboard and continued with RakNet, which is one of the other network libraries...
Boht TNL and RakNet are commercial products, which are free to use for non-commercial purposes.
It's a pity that Sun has not released the C++ api of SGS http://www.projectdarkstar.com/index.php?option=com_smf&Itemid=44&topic=4.0 yet.
I think it would be a good thing to have a SGS-plugin (or another OpenSource networking library, but there are not that many) for CS.
28  Crystal Space Development / Support / Problem with integrating "Torque Network Library" on: October 03, 2007, 03:49:54 pm
Both the CS libraries as well as the tnl library use static class-members, which are initialised before main()  is called.
So far no problem. However, at program termination (after the main(){..} scope has finished) there is a problem while destructing
the static components. The program crashes, giving a "corrupt" heap error. I narrowed down the problem by making a testprogram
that actually does nothing (just an empty main(){}), resulting in the same behaviour.

To be more specific: the destructor of one of the tnl classes crashes while calling free() on a pointer that has been used for malloc() in the
constructor. The crash only occurs when both the tnl and cs libraries are used in 1 application.

Also the TNLTest program (part of the tnl package) crashes in this way when i just add CS_IMPLEMENT_APPLICATION to the source, and link
it to libcrystalspace.lib

What i further see is that it has to do something with the method
Code:
csStaticVarCleanup_csutil
what could be the problem?
29  Crystal Space Development / Support / Re: help me please probelm with sector and genmish on: June 26, 2007, 09:54:41 am
ah, nice to hear that  i'm not the only one (beside the planeshift team, and a few other lone wolfs) that uses the 3dsmax exporter smiley
It sounds that you defined your genmesh factory incorrect: the factory should be defined as "_g_wall_0"  , the instances should have an
index different from 0.

 
30  Crystal Space Development / Support / Re: Renderloop questions on: June 26, 2007, 09:33:39 am
Quote
  * standard: static lighting with precalcalculated shadows.

This confuses me, because if you look at the shader definition i cannot see how the gen-meshes are dynamicaly lighted (which is definitely the case)

More in detail:
The standard renderloop (file std_rloop_standard.xml) defines shader "std_lighting" (defined in file "std_lighting.xml) as standard shader.
On non "nvidia-cg" hardware this falls back to the shader defined in file "std_lighting_fixed.xml". If you look at this "pure OpenGL shader"
it is clear how lighting is handled: if a lightmap is present (like it is the case for "thing-meshes"), the diffuse texture is modulated with
the lightmap value.  If lightmap is not available (in case of the gem-meshes), the diffuse texture value is modulated with the primary color of the vertex
(more precise: the interpolated vertex color).
So how does the contribution of the light-source get in? from what i can see in the shader, it seems as if the vertex color of the genmesh does already contain
the contribution of the lightsource(s), i cannot see from the shader how this contribution gets in....
Maybe it is a property of the "generic renderloop step" to precalculate the contribution of 1 lightsource to the vertex color? this could explain the behaviour...
 
 
Pages: 1 [2] 3 4 5
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 9.234 seconds with 15 queries.