[mod] Darker Nights - tiny shaders modification

Discussion in 'Mod Discussions' started by SXX, June 9, 2013.

  1. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    I makevery small shader modification. You might get it here:

    That is currently just Proof of concept that made just for fun. You might see some issues with color gamma and brightness of some objects. Also there is actually not much lighting sources on buildings/units, but even with factory/commander/vehicles it's looks interesting.

    In archive is also easy modification which disable (just commented code) Fog of War effects which really improve dynamic lighting. But it's make actual game harder because you don't see what is actual vision radius is. Warning: it's not disable FoW, only remove visual effect.

    Playing with shaders in PA is easy because engine scan filesystem for changes and compile/reload them on the fly. ;)

    Little comparison of lighting. Default shaders:

    Modified shaders:

    More screenshots:
    http://www.sendspace.com/file/p4j6jx

    Attached Files:

    Last edited: June 10, 2013
    elodea and FlandersNed like this.
  2. Seiniyta

    Seiniyta New Member

    Messages:
    9
    Likes Received:
    0
    Looks pretty good and adds a lot to the game already! And geeze, these mods are going fast. Before the release of the game we'll probably have a total conversion :p
  3. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    I testing these shaders right now. I disabled healthbars and icons and game gives me really immersive experience.
    Moon also looks much better when half of it's hidden in darkness:

    Attached Files:

  4. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    As you've probably noticed your changes are only affecting the terrain. You'll have to edit a hand full of shaders for your changes to show up on tress and units. I'm hoping we implement something that lets us do includes in our glsl files so you will only have to change it in one place.
  5. Col_Jessep

    Col_Jessep Moderator Alumni

    Messages:
    4,227
    Likes Received:
    257
    OMG, sxx, that looks absolutely beautiful!

    Ben, how expensive is it for the graphic card to render like 4-8 lights per building? Would it be possible to make bases look like a X-mas tree at night without melting the GPU?
  6. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    I changed terrain, units and water shaders. There is still some rocks which don't want to be dark, but probably because of textures. I modify trees/stones too (you might notice that stones in day light is much darker).

    But shader used for tree's and stones (prelight_flat.fs) easier than you using for units and terrain. I'm never worked with GLSL before (i'm web programmer with little C++ skill), so I probably need lot of time to figure out how to done same thing what's you're done for Units and terrain.
    And I understand that you use easy shader for reason, there is 100500 trees and stones on planet, it's should eat lot of GPU to calculate self shadowing for each of them on the fly. So if I want tree's looks better I need done that by other way.

    Am I right?


    That would be cool. ;)
  7. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Thank, nice to hear that somebody like it.

    I think it's possible if you don't want to see real dynamic lighting from 300 sources.
    If you combinate some "more realistic" lighting like commander have with some fake lighting sources (made with texture + particles) it's should be looks cool and be suitable for most of GPU's.
  8. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    http://www.youtube.com/watch?v=5Qyl7h7D1Q8&t=13m15s
    That's a video of 1000 lights.

    Every projectile, every muzzle flash, and every explosion has a dynamic light on it right now. That can be thousands of lights, all "real".
  9. garat

    garat Cat Herder Uber Alumni

    Messages:
    3,344
    Likes Received:
    5,376
    I also recommend doing some client side hook up of headlight lights and point lights. That is all client side processed, so the server doesn't care about it, and it will make the "dark night" nights look that much cooler.

    Nice stuff, guys. Already amazing how much you guys are getting into this with the still fairly limited mod options.
  10. veta

    veta Active Member

    Messages:
    1,256
    Likes Received:
    11
    Wow, that is pretty good.

    nice
  11. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Thank for advice, already working on it :)
  12. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
  13. Baleur

    Baleur Member

    Messages:
    122
    Likes Received:
    22
    Love how the darker nights look, or rather darker ambient light.
    But i must say i don't like at all how pitch black the shadows are on the day / sunset/sunrise side is. Imo they would look better a tiny bit smoother and more natural.

    Light scatters in real life, so shadows usually don't become pitch black, unless you're on the moon ofc.
    Is that linked to the night side darkness, to make the shadows & night ambient match?
    It'd be nice to be able to have slightly brighter shadows, but just darker night ambiance.

    This should almost be made vanilla in the next alpha update imo..
    Or at least some half-way point between how it currently is and how this mod makes it.
    See if the majority of alpha testers like it. Then we can keep pushing slightly darker until people think it's too dark.
    But i think we can agree that currently it's a bit too bright.
  14. glinkot

    glinkot Active Member

    Messages:
    250
    Likes Received:
    28
    Yep perhaps a slider in the graphics settings between 'realistic' darkness levels versus having a more ambient lighting situation as the current alpha uses.
  15. mushroomars

    mushroomars Well-Known Member

    Messages:
    1,655
    Likes Received:
    319
    This would be ideal.
  16. pinbender

    pinbender Active Member

    Messages:
    78
    Likes Received:
    137
    So, just a few things here:

    Small lights are fast. "Headlights" are frustum lights with a texture mask (gobo), and an optional shadow. (The shadow only shows up on the "Uber" setting for headlights. It was easy to add, and I wanted to see what it would look like and how well it would run.) "Lamps" are point lights. They're cheaper than headlights, but there's no masking and they're omnidirecitonal. There's a "debug" flag in the light specs that allows the light volume to be visualized.

    Lots of small lights are expected to get faster. Right now, they're individual draw calls, but eventually they should be batched together. The batching interface just barely went in, so it's not hooked up to the lighting engine yet.

    Big lights are slow. The lighting pipeline is post-processed, so each light increases the overdraw per-pixel. Video cards are fast, but if you set up lights to be the size of the planet, don't expect them to stay fast for more than a few of them.

    The lighting intensity for both ambient and sun is defined in the planet spec. You should be able to increase the contrast by changing the specs without disabling fog of war rendering. See terrain/earth.json.

    A mod for higher-end machines that adds multiple lights to units should be totally reasonable. (And awesome.)
  17. JamaicanPotato

    JamaicanPotato Member

    Messages:
    76
    Likes Received:
    1
    Looks great, hopefully once all the lighting is working something like this will be either added or like this...as a mod.
  18. mushroomars

    mushroomars Well-Known Member

    Messages:
    1,655
    Likes Received:
    319
    [​IMG]
  19. lilbthebasedlord

    lilbthebasedlord Active Member

    Messages:
    249
    Likes Received:
    80
    I approve of this approval

    Great work ssx!
  20. vulstar

    vulstar New Member

    Messages:
    1
    Likes Received:
    0
    If darkness would also affect energy collector's, making it more profitable to attack your enemy at night when his energy income is lower it would be so awesome together with this dark night look.

Share This Page