Jump to content
The Dark Mod Forums

Desaturated light shader


Durandall

Recommended Posts

Is it possible to create a greyscale light shader or do we already have one?

It would make for a great moonlight effect.

I tried messing around with the shaders to average the colors, but I have no experience with shaders and everything I try leads to no effect or a shader error.

 

Also, how might one go about altering the hue of an existing texture?

I tried this as well, but the results are a mess. I don't know if I need to alter it's shader or something.

We only have one good set of manor wood texture and it's that same orange.

Some color modification would give some nice variety.

 

Link to comment
Share on other sites

You can tint a diffuse texture inside the material file with the "rgb" keyword -- several of our textures use this method, like the darkbrown wood panels. It's, of course, limited by the original color of the diffuse, so your mileage will vary.

 

As for a shader, do you mean a type of light that desaturates the colors it shines on? That sounds pretty interesting, but I don't know if it would simulate moonlight that well. Perhaps something like a filter light might do it... but as far as shaders go, not sure anyone would be up for making one from scratch for this sort of thing.

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

The makeIntensity keyword can turn any uncompressed image to greyscale.

 

https://www.iddevnet.com/doom3/materials.php

 

You can then add a color image and use the RGB keyword to reduce the influence of the color stage in the shader

 

Example:

 

lights/desaturated_test
{

lightFalloffImage _noFalloff // by default, stay bright almost all the way to the end

        {
                map makeIntensity(lights/example_color_tex)
                colored
                zeroClamp
                rgb 0.7
        }

        {
               map lights/example_color_tex
               colored
               zeroClamp
               rgb 0.3
        }
}

Another option is to create override cubicLight ARB shaders and change the way color is processed there.

You'd just have to give up on Cubemap lights working and use the extra "light type" slot for your custom version.

 

And yet another option is to override the post process shader with changes discussed here:

 

http://wiki.thedarkmod.com/index.php?title=Advanced_TDM_Visuals_Tweaking

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

For a true desaturated look, or any other kind of color grading, what you want is Rich's awesome Color Grading Shader:

 

http://forums.thedarkmod.com/topic/18972-color-grading-shader/

 

It has huge potential in giving each mission a unique look, or at least scenes inside a given mission, like a dream sequence you want to have in black and white or something.

 

As for the moonlight, Im sure there must be more missions nowadays that use it, though I havent played any. But you can always check out mine and see if that one works for you. Just copy and paste it into your map.

Link to comment
Share on other sites

Rich's awesome Color Grading Shader won't work as I don't want the entire mission in greyscale.

Just wanted moonlight from windows and outdoors, but it's low priority, so I'll check into it further later.

I assume makeIntensity would work, but the doc description is rather vague.

I must admit, I'm not even certain what a "texture map" is. preposition

 

I got the polished_shiny floor texture hue shifted this time, I'm not sure what I did differently.

I might need to consider tga format as recompressing the dds is noticeable.

Now I just need to get consistent results for all the orangy manor textures...

I'll look into the rgb keyword first though. I can only imagine it's going to be a nightmare restarting the engine to view the textures each change.

 

One final off topic question.

I have a light source above a building and it casts a moonlight shadow.

This kills the framerate.

Well, at certain very specific locations. I'm going to look into various maps tonight and gather some info.

I find it strange that most positions and view angles have no trouble.

Is this kind of light a bad idea or do I have something weird going on?

Link to comment
Share on other sites

 

I'll look into the rgb keyword first though. I can only imagine it's going to be a nightmare restarting the engine to view the textures each change.

 

You don't have to, type ReloadDecls, ReloadImages or ReloadSurface when the crosshair is over the texture, to reload it in-game. As for the question, the light probably calculates the shadows from everything inside and that's causing the catastrophic drop in frames. Not sure why it's only noticeable at some points (probably visleaf related), but yes, kind of a bad idea. You could make a bunch of smaller lights that cover the areas you want to be moonlit and drag their light_origin points to the same place. I'm certain that'd alleviate at least some of the lag.

Edited by Spooks

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

The color grading shader isnt about greyscale, it can give the mission any tint you want, as was demonstrated in the thread. You could have it sepia, or natural colors but slightly desaturated, increase the contrast, or maybe you want the dark colors to be blueish, etc.

 

As for the things you want to achieve, unless you want to be able to look through those windows directly to the outside and thats crucial to your gameplay idea, you would be better off using an opaque window glass texture and fake the moolight by using a light with texture beaming inside. Loads of examples to look into. Outside, you would need a parallel light, sure. Since it showers everywhere, it will be hitting a lot of geometry, so you have to take care all unnecessary props will be noshadow, etc. It will get into unsealed rooms as well, maybe thats what is giving you bad performance (as the geometry adds up or other lights are getting overlapped). Just seal everything. Make sure your exterior is not a single space with the house in the middle, break it up into narrower sections, spaces you can seal with visportals.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...