Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

custom shader for player/ creature models

Maybe it´s a question for the devs too but I was always unhappy how the smoothing groups were lit by the lights in NWN. So would it be possible to create an "ambient only lit" shader for objects/ models in general. So the environment is lit by ambient and diffuse and only specified models are lit by ambient only ?

Well, that would be awesome!!


  • SherincallSherincall Member Posts: 348
    Yes, you could do this yourself now. The engine just exposes all the lights (max 8 currently) to the shaders, and the shaders do the actual lighting calculations.

    Typically, they iterate over all the lights and apply them for every model. You can then clone that shader, and skip the diffuse lighting steps, and use the new shader for the models you care about.

    Unfortunately, currently, you have to specify the new shader in a .txi, which means you'll need to find all the textures/plts that you want to treat this way. And it also means that two instances of the same model (e.g. two goblins) cannot be lit in different ways.
    This part will get much easier with the nwscript->shader interface that's under way.

  • NWN_TömlNWN_Töml Member Posts: 90
    Ok thats great news, realy!

    So if it´s not to much asked can you or someone else give me some start help with that shader. I have no clue how to do it myself for the first time ;)

  • SherincallSherincall Member Posts: 348
    Sure thing. Probably best to stop by the vault discord, there's a few people that can help you get started:
    Feel free to ping me there.

    I've also kind of started writing tutorials for this, but didn't reach the lighting part yet. You can skim it for a quick reference:

  • NWN_TömlNWN_Töml Member Posts: 90
    edited February 2018
    Thank you very much :)

    ...oh my...i maybe a decent modeler/ texture creator but that stuff is beyond my understanding. There is also the language barrier :smiley:

    Post edited by NWN_Töml on
  • NWN_TömlNWN_Töml Member Posts: 90
    We are making progress on this shader guys if your are interested. Once it´s fully working for skinmeshed creatures i´ll post an example for you!

  • SorenSoren Member, Developer Posts: 35
    Out of curiosity, what didn't you like about the way smoothing groups are lit?

    And wouldn't it become an issue in areas that has little or no ambient light?

  • NWN_TömlNWN_Töml Member Posts: 90
    edited February 2018
    Most if not all creatures/ pc models have separated body parts and these polygons overlap. When those overlapping polygons are lit by the engine it creates this "pinoccio" look imo. Once you have ambient only light activated your models look way more "complete" so to say. Only problem is they look a bit more 2D. But much better anyway.

    So you would have to design your areas a bit different and my way is not very practical for an override ;)

    I may post some screens so i can show you what truly gave me this idea.

Sign In or Register to comment.