Jump to content
The Dark Mod Forums

Arcturus

Development Role
  • Posts

    1930
  • Joined

  • Last visited

  • Days Won

    62

Posts posted by Arcturus

  1. Works nicely. It doesn't desaturate primary colors (like AgX does) but one could argue that's an advanced feature.

    14 hours ago, stgatilov said:

    modern Unreal Engine (which most likely has proper PBR implementation)

    Interestingly, Filmic tonemapper used in Unreal as I understand is based on ACES - standard established by American Film Academy:

    https://dev.epicgames.com/documentation/en-us/unreal-engine/color-grading-and-the-filmic-tonemapper-in-unreal-engine

    Troy Sobotka (a film industry veteran himself) was very critical of ACES. And I don't think it's just a crazy person's talk cause from what I've seen in discussions around web many agree with him. Just because something is le industry standard, doesn't necessarily mean it's absolutely best.

  2. MeqoiiJ.jpeg

    The key to make metals using specularmaps only, without relying on cubemaps, is to increase specular to diffuse ratio.

    diffusemap:

    painting01_d.jpg.208aaa8d972874919712b7e8451b2a0a.jpg

    specularmap:

    painting01_s.jpg.0629b8cc0fa074ea2404c1532bd6f303.jpg

    and also making the specularmap colored (in case of colored metals). This is more convincing on bumpy surfaces that don't require mirror reflections.

    With a different normalmap:

    XjBPY4Y.jpeg

    With a cubemap:

     

    • Like 3
  3. Elite merc is one of the better looking NPCs in the game, but I think we can improve couple of things.

    New material looks like this:

    Spoiler

    models/md5/chars/guards/merc_elite/merc_elite_armor
    {
        qer_editorimage    models/md5/chars/guards/merc_elite/merc_elite_cloth_ed
        surftype15
        description "armor_plate"
        
        noShadows
        bumpmap addnormals(models/md5/chars/guards/merc_elite/merc_elite_local, heightmap( models/md5/chars/guards/merc_elite/merc_elite_cloth_h, 0.5 ) )
        {
        blend    diffusemap
        map        models/md5/chars/guards/merc_elite_cloth
        rgb        0.7
        }
        {
        blend    specularmap
        map        models/md5/chars/guards/merc_elite_cloth_s
        rgb 0.3
        }
        {
            forceHighQuality
            blend gl_dst_color, gl_src_color
            cubeMap env/studio_01/studio_01
            texgen reflect
            rgb 1.2
        }
    }

    I modified the specularmap slightly. Since he has a sword i updated that too:

    The handle and blade use different cubemaps.

    There's no reason why elite guards shouldn't have polished shoes.

    Although the uv mapping on those is atrocious so don't look too closely. That's why the fronts of the soles are too shiny.

    merc_boot_uv.thumb.JPG.7b936431f021168b3713696878079f3b.JPG

    Importing and fixing the .md5 mesh in Blender is practically impossible because of this issue:

    Not that I want to get into that. I think the excessive shininess of soles can be mitigated by creating a separate specularmap, as the boots and armor are in separate materials.

    • Like 1
  4. On 11/24/2024 at 12:11 PM, stgatilov said:

    Here is some simplistic approach.

    It multiplies the whole image by alpha = 0.7, making is darker.
    But if the original color is brighter than 1 in any component, then the max color component is transformed as:

    • x -> 1 - A / (B+x)

    The proportion between RGB components is saved.

    You can try to tweak alpha in shader, but it is a compromise between darkening normal images (e.g. color < 1 ones) and making overly high colors more distinguishable (color > 1 case).

    Note that you can run reloadGLSLPrograms in console after editing shader, no need to restart game.

    tonemap.frag.glsl 6.5 kB · 1 download

    Out of the box it makes the image darker, so I increased brightness in settings:

    Spoiler

    32 bit, no bloom:

    tD7JhOS.jpeg

    64 bit, no bloom:

    ovwJHU6.jpeg

    64 bit, medium bloom:

    U69H3TK.jpeg

    64 bit, high bloom:

    sD4vrG7.jpeg

    32 bit, no bloom:

    xLOfdue.jpeg

    64 bit, no bloom:

    Nii0mYn.jpeg

     

    Original .glsl for comparison:

    Spoiler

    original 32 bit, no bloom:

    y6zamhK.jpeg

    original, 64 bit, no bloom:

    8iANUxi.jpeg

    original, 64 bit, medium bloom:

    u5aWbbM.jpeg

    original, 64 bit, high bloom:

    q36m78E.jpeg

    original 32 bit, no bloom:

    tltbspE.jpeg

    original, 64 bit, no bloom:

    cdpYJDf.jpeg


    AgX:

    Spoiler

    AgX:

    32 bit, no bloom:

    No04Y4C.jpeg

    64 bit, no bloom:

    XAFBEZy.jpeg

    64 bit, medium bloom:

    QT7rr7s.jpeg

    64 bit, high bloom:

    4VFjzyN.jpeg

    32 bit, no bloom:

    3IH1weE.jpeg

    64 bit, no bloom:

    zqQFHqQ.jpeg

     

  5. In reality reflection changes based on an angle. But when reflection is uniform like here, then that suggests heavy scattering of light due to some tiny fibers or dust.

    Not all materials necessarily need to be super realistic, it's more important that picture is pretty to look at.

  6. 20 minutes ago, MirceaKitsune said:

    In the meantime I'll likely give your material a try as the result clearly looks better: Thanks for sharing that! I was wondering if I could bend the reflection with the texture's normal map but didn't hope for a way. I'll definitely want to put the specular map back on as I don't want to lose its effect either.

    I believe mirrors have been rewritten completely at some point. As I mentioned this material doesn't interact with lights so it has very limited use cases.

  7. It looks bad with or without the bloom, as you can see in my last video. With bloom set to half it looks only slightly less bad than with bloom set to max — but still bad.

    Yes, there's no consistency to anything in darkmod because it was made by a bunch of amateurs. What's your point exactly? That nothing should be changed until the game is completely refactored to meet some nebulous standards of physical and mathematical correctness? Because I was told that is never going to happen (and I agree). So at the very least we can make the game look slightly less bad for now.

  8. 8 hours ago, peter_spy said:

    IIRC, the lower-resolution mirror was more pixelated than blurry, but I'm not 100% sure about that :)

    Ok, maybe low res reflection itself didn't look so nice, but when paired with heathaze effect it looked nice.

    This one uses the heatHazeWithMaskAndBlur.vfp (in this case the stronger version that I made). Unfortunately it doesn't react to light at all. It's also very buggy.
     

    Spoiler

    // Author: STiFU
    textures/darkmod/stone/flat/marble_flower_mosaic_cracked
    {
        surftype15
        description "tile"

        qer_editorimage textures/darkmod/stone/flat/marble_flower_mosaic_cracked_ed
        //specularmap     textures/darkmod/stone/flat/marble_flower_mosaic_cracked_s
        bumpmap        textures/darkmod/stone/flat/marble_flower_mosaic_cracked_local
        {
            fragmentProgram        heatHazeWithMaskAndDepth.vfp
            fragmentMap            0        _currentRender
            fragmentMap            1        textures/darkmod/stone/flat/marble_flower_mosaic_cracked_local  // the normal map for distortion
            fragmentMap            2        _white  // the distortion blend map
            fragmentMap         3       _currentDepth
        }
        {
        blend add
        mirrorrendermap
        rgb 0.1
        }
        {
            vertexProgram        heatHazeWithMaskAndStrongerBlur.vfp
            vertexParm            0        0    // texture scrolling
            vertexParm            1        10        // magnitude of the distortion
        }
        {
        blend    gl_one , gl_one
        map textures/darkmod/stone/flat/marble_flower_mosaic_cracked
        rgb 0.2
        }
    }

     

     

     

    • Like 2
    • Thanks 1
  9. 14 hours ago, peter_spy said:

    Are you using default bloom settings? I don't remember Gemcutter being that overblown in highlights. These are the defaults:
    seta r_bloom_blursteps "2"
    seta r_bloom_downsample_limit "128"
    seta r_bloom_weight "0.3"
    seta r_bloom_detailblend "0.5"
    seta r_bloom_threshold_falloff "8"
    seta r_bloom_threshold "0.7"

    r_bloom_weight is set to "0.7" both in my 2.12 installation and in main repository. I never touched those values which means the default must be 0.7.

    8 hours ago, stgatilov said:

    Does anyone know the paper explaining AgX?

    I can only find a repo with function values (aka LUT), and another repo with same function converted analytic form (from some paper which I can't find).
    The code also contains colorspace conversion (no comment which one), and switching to logarithmic scale with clamping, then the curve is called sigmoid while it is not (in fact, logarithmic conversion is sigmoid here).

    Troy Sobotka is the original creator of AgX. He was active on Blender forums where he had long philosophical arguments about color with people. Also on Blender developer forums. I don't know if there's much more beyond those and his github page: https://github.com/sobotka

    Edit @stgatilov AgX however is a direct continuation of Sobotka's earlier 'Filmic', so there may be more about that: https://github.com/sobotka/filmic-blender

    https://blender.stackexchange.com/questions/164991/are-the-technical-details-of-filmic-available

  10. 1 hour ago, MirceaKitsune said:

    Getting to try realtime reflective floors in practice. Took me well over an hour to figure it out but the setup for a complex shader is ridiculously simple, all you need to do is add a "mirrorRenderMap 256 256" with a "blend add" to any material. FPS is reduced a bit of course but no big deal in a closed space, I'll improve it from the lighting which I abused a bit in this scene.

    ejbTseK.jpeg

    QQdKcDq.jpeg

    7LbIMW5.jpeg

    8JED2Uz.jpeg

    The 256 256 doesn't seem to do anything here, the reflection looks very sharp. Apparently rendering reflections at lower resolutions has been disabled:

    If I remember correctly, rendering mirrorRenderMap at lower resolutions used to help with performance but also had added benefit of nice blurry reflections. Which would probably look better on a floor like this.

    You can make it fainter by adding RGB 0.3 for example.

    • Like 2
  11. 1 hour ago, stgatilov said:

    I'm certainly against including any AI-generated code.

    It's just a mockup. I don't advocate for any particular code as I know nothing about coding.

    As I understand, other than compressing high dynamic range into low dynamic range, tonemappers like the Blender's "filmic" or Unreal's "filmic" try to shape the image in a way similar to traditional film emulsion. Hence the 'filmic' moniker. They come with look up tables.

    Here's for example Blender's AgX implemenation in Unity. Its advertised feature is that by desaturating highlights even earlier than 'Filmic', the image is perceived as having more detail. That's advanced, esoteric stuff. Right now it's too easy to blow out the image in Darkmod and it can be improved in my opinion.

×
×
  • Create New...