Crystal Space
Welcome, Guest. Please login or register.
October 25, 2014, 07:22:09 am

Login with username, password and session length
Search:     Advanced search
9011 Posts in 2044 Topics by 8822 Members
Latest Member: Mandrilmar
* Home Help Search Login Register
  Show Posts
Pages: 1 [2]
16  Crystal Space Development / Support / Re: [Linker Error] undefined reference to 'Sys' on: January 30, 2006, 11:32:54 am
to nickwarren:
For DevC++ you need to specify libraries to link. See for details http://www14.brinkster.com/aditsu/dev-cpp-faq.html#link
As minimum specify -lcrystalspace -lgdi32
17  Crystal Space Development / Support / Re: Loading plugins from archive on: January 26, 2006, 12:02:58 am
Probably if you include in /include/csconfig.h "#define CS_STATIC_LINKED" and make full recompilation you will get object files in /out/... ready to be static linked. Then you can try manually link all neccesarry *.o to single *.exe
But I'm not sure in this approach (and I'm needn't this at all). Maybe more advanced people will help you.
18  Crystal Space Development / Support / Re: Loading plugins from archive on: January 25, 2006, 09:28:22 pm
Windows can load dlls from file system only. It's bunch of tricks to load them from other place. See http://www.joachim-bauch.de/tutorials/load_dll_memory.html/en
It seems with MSVC you can use static linking for many plugins, i.e. they will be compiled to main *.exe

Personnaly I'm not thinkinkg the number of dll's influences the quality of anyone's project.
19  Crystal Space Development / Support / Re: Help me please!! Problems with resize!! on: January 24, 2006, 10:01:52 am
It seems there is no system independent way in CS to resize a window by program itself (very seldom needed feature for 3D app).
For windows you can try:

#include "windows.h"
...
HWND hWnd  = GetActiveWindow();
SetWindowPos(hWnd, ...);//look WinAPI for more info of the function
...
20  Crystal Space Development / Support / Re: Strange WalkTest on: January 23, 2006, 10:24:10 pm
No of course! It means a problem with particular version of drivers + particular shader. These two things can be changed.

Try to localize what type of shaders causes the problem. Rename back ..._arb.dll and try with it but without cg (and vice versa).
I'm not fluent with this but CS has driver base which allows to disable some type of shaders for particular combination of videocard+driver.
21  Crystal Space Development / Support / Re: Strange WalkTest on: January 23, 2006, 09:23:32 pm
Yea, the problem with light corona (halo) is old enough. Personally I'm using it as debug feature to see where the light source is. If you want to see something like it through a mirror it can be replaced by sprite2d (billboard) with appropriate texture.

Turning back to your problem: try to rename a couple of files in CS directory: 'glshader_arb.dll' to 'glshader_arb.dll_' and 'glshader_cg.dll' to 'glshader_cg.dll_' (this disables some advanced shader techniques) and run walktest again. Is the problem appearing?
22  Crystal Space Development / Support / Re: Strange WalkTest on: January 23, 2006, 12:39:57 pm
I had some problems (not like yours) with shaders yesterday. After updating & recompiling they gone.
If this won't help, run walktest with "--verbose=-scf"  option. Then go to CS directory, open walktest.txt and copy its contents to this thread. Perhaps this will give more info about your problem.
23  Crystal Space Development / Support / Re: Strange WalkTest on: January 23, 2006, 08:09:34 am
Hm... Looks like you run with software renderer...
Many changes was made in CVS during past weekend. Some things could be broken in the meantime. To update and recompile would be a good idea.
24  Crystal Space Development / Support / Re: Strange WalkTest on: January 22, 2006, 05:21:59 pm
What is your system (CPU. videocard)? Do you see transparent wood material over mirror or opaque wood and mirror flicker? Can you post a couple of screenshots here?
25  Crystal Space Project Development / Bug Reports / Re: Portals, mirrors & bugs (some thoughts of how to fix) on: January 11, 2006, 07:17:12 pm
Why not... But don't wait superior activity from me. Smiley Naturally I'm interested in bug fixing of things needed by project on which I'm working.
26  Crystal Space Project Development / Bug Reports / Portals, mirrors & bugs (some thoughts of how to fix) on: January 09, 2006, 08:54:04 pm
There are some problems in CS engine & OpenGL renderer which doesn't allow to draw mirrors correctly.

1. Probably one problem is common for all zfill/floating portals and described in bug #1398043 I've posted recently (see Flarge_Mirror.jpg attached to bug tracker).
It is caused by strange code in gl_render3d.cpp. That code is in Draw2DPolygon function:

Code:
void csGLGraphics3D::Draw2DPolygon (csVector2* poly, int num_poly,
const csPlane3& normal)
{
  SwapIfNeeded();

  // Get the plane normal of the polygon. Using this we can calculate
  // '1/z' at every screen space point.
  float M, N, O;
  float Dc = normal.D ();
  if (ABS (Dc) < 0.01f)
  {
    M = N = 0;
    O = 1;
  }
  else
  {
    float inv_Dc = 1.0f / Dc;
    M = -normal.A () * inv_Dc * inv_aspect;
    N = -normal.B () * inv_Dc * inv_aspect;
    O = -normal.C () * inv_Dc;
  }

  // Basically a GL ortho matrix
  const float P0 = 2.0f / (float)viewwidth;
  const float P5 = 2.0f / (float)viewheight;
  const float P10 = -2.0f / 11.0f;
  const float P11 = -9.0f / 11.0f;

  int v;
  glBegin (GL_TRIANGLE_FAN);
  csVector2* vt = poly;
  for (v = 0 ; v < num_poly ; v++)
  {
    float sx = vt->x - asp_center_x;
    float sy = vt->y - asp_center_y;
    float one_over_sz = M * sx + N * sy + O;
    float sz = 1.0f / one_over_sz;
    // This is what we would do if we'd use glOrtho():
    //glVertex4f (vt->x * sz, vt->y * sz, -1.0f, sz);

    // The vector that results from a GL ortho transform
    csVector4 bar ((vt->x * sz) * P0 - sz,
      (vt->y * sz) * P5 - sz,
      -P10 + sz * P11,
      sz);
    /* Now it can happen that a vertex of a polygon gets clipped when it's
     * very close to the near plane. In practice that causes sonme of the
     * portal magic (stencil area setup, Z fill) to go wrong when the camera
     * is close to the portal. We "fix" this by checking whether the vertex
     * would get clipped and ... */
    const float bar_w = bar.w, minus_bar_w = -bar_w;
    if ((bar.x < minus_bar_w) || (bar.x > bar_w)
      || (bar.y < minus_bar_w) || (bar.y > bar_w)
      || (bar.z < minus_bar_w) || (bar.z > bar_w))
    {
      /*If yes, "fix" the vertex sent to GL by replacing the Z value with one
      that won't cause clipping.*/
      const float hackedZ = 1.0f - EPSILON;
      glVertex3f (bar.x/bar_w, bar.y/bar_w, hackedZ);
    }
    else
    {
      // If not, proceed as usual.
      glVertex4f (bar.x, bar.y, bar.z, bar.w);
    }
    vt++;
  }
  glEnd ();
}

Strange code begins with "Now it can happen..." comment. Yes, we need some work around the case when camera "glass" crosses a portal polygon. But the vertices of portal polygon may have any z-coordinate and I don't understand why their x/y coordinates influence on "hackedZ" path.

If we use

   
Code:
if ((bar.z < minus_bar_w) || (bar.z > bar_w)) ...

instead of
   
   
Code:
if ((bar.x < minus_bar_w) || (bar.x > bar_w)
      || (bar.y < minus_bar_w) || (bar.y > bar_w)
      || (bar.z < minus_bar_w) || (bar.z > bar_w))

the function works OK with "portal magic" but the "overlay" bug #1398043 doesn't appear anymore. Maybe I'm wrong?

2. Other portal problem: portals are not visible in mirrors (it can be seen in flarge level also, but it 's not striking)

It seems, this happens because of vertex order of portal polygon is reversed in each mirror. When we use static statecache->SetCullFace (GL_FRONT) call it works Ok, while no other portals reflected. But if we have other portals the problem appears.
The temporary solution (second shot) is to disable GL culling while filling stencil, but this causes other bug - backfaced mirrors sometimes appears/flickers.

To solve the problem nicely we need to have for each portal in clipportal_stack some "mirror_flag" and calculate result culling in SetupClipPortals. But renderer knows nothing of portals' mirror property at the moment.

27  Crystal Space Development / Support / Halo's are invisible through portals & transparent objects. Is this intentional? on: December 31, 2005, 12:51:57 pm
Maybe there is a XML-tag/attribute for map file to force the visibility?
Pages: 1 [2]
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 3.118 seconds with 16 queries.