LogicAndTrick / sledge

An open source alternative to Valve's Hammer Editor for the Goldsource engine. (No longer in development)
https://logicandtrick.github.io/sledge/
BSD 3-Clause "New" or "Revised" License
302 stars 81 forks source link

Rare bug causing insane decal geometry to be generated #218

Open LogicAndTrick opened 8 years ago

LogicAndTrick commented 8 years ago

In very specific positions (within only a few fractions of a unit), the generated decal geometry is very odd:

Screenshot This object replicates the bug:

clipboard
{
    solid
    {
        "id" "2"
        side
        {
            "id" "1"
            "plane" "(-3.18240000 -64.00000000 128.00000000) (-131.18240000 -64.00000000 128.00000000) (-131.18240000 0.00000000 128.00000000)"
            "material" "aaatrigger"
            "uaxis" "[1.00000000 0.00000000 0.00000000 6.389943] 1.75"
            "vaxis" "[0.00000000 -1.00000000 0.00000000 11.42859] 1.75"
            "rotation" "0"
            vertex
            {
                "count" "4"
                "vertex0" "-3.18240000 -64.00000000 128.00000000"
                "vertex1" "-131.18240000 -64.00000000 128.00000000"
                "vertex2" "-131.18240000 0.00000000 128.00000000"
                "vertex3" "-3.18240000 0.00000000 128.00000000"
            }
        }
        side
        {
            "id" "2"
            "plane" "(-131.18240000 -64.00000000 -127.99990000) (-3.18240000 -64.00000000 -127.99990000) (-3.18240000 0.00000000 -127.99990000)"
            "material" "aaatrigger"
            "uaxis" "[1.00000000 0.00000000 0.00000000 6.389943] 1.75"
            "vaxis" "[0.00000000 -1.00000000 0.00000000 11.42859] 1.75"
            "rotation" "0"
            vertex
            {
                "count" "4"
                "vertex0" "-131.18240000 -64.00000000 -127.99990000"
                "vertex1" "-3.18240000 -64.00000000 -127.99990000"
                "vertex2" "-3.18240000 0.00000000 -127.99990000"
                "vertex3" "-131.18240000 0.00000000 -127.99990000"
            }
        }
        side
        {
            "id" "3"
            "plane" "(-3.18240000 -64.00000000 128.00000000) (-3.18240000 -64.00000000 -127.99990000) (-131.18240000 -64.00000000 -127.99990000)"
            "material" "aaatrigger"
            "uaxis" "[1.00000000 0.00000000 0.00000000 6.389943] 1.75"
            "vaxis" "[0.00000000 0.00000000 -1.00000000 11.42872] 1.75"
            "rotation" "0"
            vertex
            {
                "count" "4"
                "vertex0" "-3.18240000 -64.00000000 128.00000000"
                "vertex1" "-3.18240000 -64.00000000 -127.99990000"
                "vertex2" "-131.18240000 -64.00000000 -127.99990000"
                "vertex3" "-131.18240000 -64.00000000 128.00000000"
            }
        }
        side
        {
            "id" "4"
            "plane" "(-3.18240000 0.00000000 -127.99990000) (-3.18240000 0.00000000 128.00000000) (-131.18240000 0.00000000 128.00000000)"
            "material" "aaatrigger"
            "uaxis" "[1.00000000 0.00000000 0.00000000 6.389943] 1.75"
            "vaxis" "[0.00000000 0.00000000 -1.00000000 11.42872] 1.75"
            "rotation" "0"
            vertex
            {
                "count" "4"
                "vertex0" "-3.18240000 0.00000000 -127.99990000"
                "vertex1" "-3.18240000 0.00000000 128.00000000"
                "vertex2" "-131.18240000 0.00000000 128.00000000"
                "vertex3" "-131.18240000 0.00000000 -127.99990000"
            }
        }
        side
        {
            "id" "5"
            "plane" "(-3.18240000 0.00000000 128.00000000) (-3.18240000 0.00000000 -127.99990000) (-3.18240000 -64.00000000 -127.99990000)"
            "material" "aaatrigger"
            "uaxis" "[0.00000000 1.00000000 0.00000000 2.285714] 1.75"
            "vaxis" "[0.00000000 0.00000000 -1.00000000 11.42872] 1.75"
            "rotation" "0"
            vertex
            {
                "count" "4"
                "vertex0" "-3.18240000 0.00000000 128.00000000"
                "vertex1" "-3.18240000 0.00000000 -127.99990000"
                "vertex2" "-3.18240000 -64.00000000 -127.99990000"
                "vertex3" "-3.18240000 -64.00000000 128.00000000"
            }
        }
        side
        {
            "id" "6"
            "plane" "(-131.18240000 0.00000000 -127.99990000) (-131.18240000 0.00000000 128.00000000) (-131.18240000 -64.00000000 128.00000000)"
            "material" "aaatrigger"
            "uaxis" "[0.00000000 1.00000000 0.00000000 2.285714] 1.75"
            "vaxis" "[0.00000000 0.00000000 -1.00000000 11.42872] 1.75"
            "rotation" "0"
            vertex
            {
                "count" "4"
                "vertex0" "-131.18240000 0.00000000 -127.99990000"
                "vertex1" "-131.18240000 0.00000000 128.00000000"
                "vertex2" "-131.18240000 -64.00000000 128.00000000"
                "vertex3" "-131.18240000 -64.00000000 -127.99990000"
            }
        }
        editor
        {
            "color" "128 255 128"
            "visgroupshown" "1"
            "visgroupautoshown" "1"
            "parentid" "1"
        }
    }
    entity
    {
        "id" "3"
        "classname" "infodecal"
        "texture" "{target"
        "spawnflags" "0"
        "origin" "-3.99996400 -64.68680000 12.97656000"
        editor
        {
            "color" "128 255 128"
            "visgroupshown" "1"
            "visgroupautoshown" "1"
            "parentid" "1"
        }
    }
}
ST3VI3-RICHI3 commented 5 years ago

Interesting, is it the rendering code or the 3D world code (the 3D space AKA game world, I'm classing this as un-drawn and rendering, well, renders it.)?

LogicAndTrick commented 5 years ago

I think it's the code that generates the decal geometry rather than a rendering bug. In the new release I've mostly just copy-pasted that code, so I wouldn't be surprised if this same bug still exists after the rewrite.