Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
334 stars 59 forks source link

Lights sometimes leaking through brushes and patches (Xonotic mapping) #144

Closed Spike29 closed 1 year ago

Spike29 commented 1 year ago

I only tested it with the Xonotic gamepack. This issue is especially visible with brushes (or patches) directly above a lava brush. The top face of these brushes is brighter than it should be. This is not the only scenario where it happens though.

This is how it looks with latest NRC: image

And this is how it looks with NetRadiant 1.5.0-20220628: image

In this example, the lava brush has a rectangular shape and intersects with the 2 brushes on the left. The brush with the grate texture is placed 4 units above the lava surface.

Lava shader used:

textures/liquids_lava/lava0
{
    qer_editorimage textures/liquids_lava/lava0.tga
    surfaceparm lava
    surfaceparm noimpact
    surfaceparm trans
    cull disable
    deformVertexes wave 150.0 sin 2 5 0.25 0.1
    Q3map_TessSize 128
    q3map_surfacelight 1000
    q3map_lightSubdivide 64
    {
        map textures/liquids_lava/lava0.tga
        blendfunc GL_SRC_ALPHA GL_ONE
    }
}

This test map was compiled with the following settings:

<build name="Final: -bounce 8 -dirty (new Xonotic's default)">
  <command>[q3map2] -bsp -meta -maxarea -samplesize 8 "[MapFile]"</command>
  <command>[q3map2] -vis -saveprt "[MapFile]"</command>
  <command>[q3map2] -light -lightmapsize 1024 -lightmapsearchpower 4 -deluxe -patchshadows -samples 4 -randomsamples -bounce 8 -fastbounce -bouncegrid -dirty -dirtdepth 64 -dirtscale 0.8 -fill "[MapFile]"</command>
</build>

Link to the test map (with the extension changed from .map to .txt, otherwise I can't share it): test.txt

I also reported this issue on the NetRadiant gitlab tracker, since it happens with NetRadiant master as well: https://gitlab.com/xonotic/netradiant/-/issues/189

The-Gig commented 1 year ago

If the compiling settings are exactly the same, then maybe difference are the q3map2 versions bundled with the two Netradiants? Did you try momentarily changing the q3map2 binary from one editor with the one from the other editor?

Garux commented 1 year ago

This is due to new backsplash. Either disable it or remove part of lava under the floor.

Spike29 commented 1 year ago

Thanks! As I explained on the NetRadiant gitlab issue (https://gitlab.com/xonotic/netradiant/-/issues/189), this issue is fixed by disabling the backsplash.

I added -backsplash 0 0 to the the list of q3map2 -light arguments.

But indeed, removing parts of lava under the floor (when possible) is a more elegant fix.