Jump to content

myconid

WFG Retired
  • Posts

    790
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by myconid

  1. The water shader code has gotten a little bit too artsy to debug easily, so I can't readily point to where the problem might be. Maybe wraitii has an idea...

    alpha123 and serveurix, does it make any difference when you turn on/off reflections, refractions and so on?

  2. It looks like Intel's drivers for the GMA 3600 are so buggy that nothing works on them. Do any other recent 3d games work on your netbook?

    Besides, on underpowered hardware like the GMAs, even if the game did run it would probably be far too slow to play (the game should run fine on netbooks with Intel HD graphics cards and above).

    • Like 1
  3. Intended behaviour, unfortunately. The engine stretches the visible objects so they fill as much of the shadowmap as possible (to get better quality shadows), but doesn't account for terrain while doing so. The result is that shadows from terrain aren't rendered unless that terrain falls within the bounding box of objects on screen. By moving that building around, you're forcing the bounding box to be expanded, so part of a cliff falls inside that bounding box.

    It's easy to reproduce in Atlas. Make an empty map, set the sun elevation to a low value and create a tall mountain. No terrain shadows will appear. Then pick an object and place it on the north-east side of the mountain. Create a second object and place it on the south-west side; move it around. You'll notice that only the parts of the terrain between the two objects will cast shadows.

    This is part of what causes the problem that Pureon mentioned (The other part is that the engine does the visibility culling in the simulation (not at all thread-friendly design, mind you), and it does it by eliminating everything that isn't visible from the main camera, thus the renderer doesn't know about things that may cast shadows/reflections once they go off screen).

  4. I'm not a lawyer but I think it clearly states that using symbols as the swastika is allowed if it's used for teaching, coverage of history or art which I think could all apply to our situation. I don't think it should be a legal problem.

    And video games are classified as art in Germany, so I'd say it's almost certainly legal to use Swastikas in games, even Nazi Swastikas.

    I say keep it. If anyone is silly enough to feel offended by an ancient symbol being used in a historically-correct way, this is an open source game and they should feel free to mod/fork/rewrite history.

  5. Hmm, that's bad, IMO there should be no GLSL shaders loaded unless the user enables that option. If we haven't confirmed that yet, we should go through all the current effects and make sure.

    All the fancywater is rendered using GLSL. That includes both the water-on-models and the global water planes.

    I think there are two bugs at play here. One is with ShaderTechnique, as it bugs out when the only option is a GLSL shader but preferGLSL isn't set. The other is somewhere in the GUI, which seems to make assumptions about the caller's state that happen to be invalidated by the water effects.

  6. Tried running your code. For me, the JS_EncodeString call in function2 causes an "out of memory" error. I queried the length of the string on the line before that call and it returns "8769178900488".

    The original "textfromscript" version of your code works fine, because the string is const. The "blablubb"/recursive versions cause the error, for the reason I explained earlier.

    Don't know why you can't reproduce this, but at least the theory checks out.

  7. Does the dump show the raw memory contents, including deleted objects, or is it a liveness graph? If it's the latter, then it doesn't help prove or disprove what I wrote earlier...

    If the object is copied, then it persists in the function2 call because of a memory leak and you'd need to free it manually.

    You could create a bunch of short strings and see if it affects the output. eg:


    function jsfunction(s1)
    {
    var textfromscript = "textfromscript";
    function1(textfromscript + s1);
    }
    var countInJs = 7;
    jsfunction("blablubb");

    function rec(i)
    {
    var s = Math.random().toString(36).substring(7);
    if (i > 0)
    rec(i - 1);
    }
    rec(10000); // allocate a bunch of strings

    function2(countInJs);

  8. Yeah, I encountered the "shadow object" possibility, where something could make a GC-ed object actually reappear as the memory was still there. But I doubt your problem is linked to that.

    Right, speaking of "shadow objects", there's also the possibility that since he's passing out a constant, it gets initialised statically so it never gets deleted (though it depends on what those conversion functions do..).

  9. I'm not familiar with Spidermonkey's exact implementation, but I've implemented similar systems in the past. As a result, the following contains a fair deal of assumptions.

    A useful thing to know is that many GC designs don't depend on system malloc(), but keep around one or more large chunks of memory and do their own allocations inside those chunks (it's faster). This means that the memory is reused, and even if a certain object is "deleted" by the GC, it's still kept around in the process's memory until it's overwritten by another allocation.

    Spidermonkey uses a simple type of "mark-and-sweep" GC (afaik) that doesn't move allocated objects around, so anything you allocate has a fixed memory address. Thus, you can access objects directly from C++ pointers, such as JSString*, without worrying that they might move... but when the memory is reclaimed by the GC and reused, the C++ is stuck with invalid pointers.

    So, my guess is that you are dereferencing a dangling C++ pointer that points to an object in GC memory that has been "deleted" but is still in memory and hasn't been overwritten. In theory, if the JS keeps allocating new objects of similar size as that string, you'll eventually overwrite the memory and get nonsense output.

    • Like 1
×
×
  • Create New...