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

    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
    • Ansome

      Well then, it's been about a week since I released my first FM and I must say that I was very pleasantly surprised by its reception. I had expected half as much interest in my short little FM as I received and even less when it came to positive feedback, but I am glad that the aspects of my mission that I put the most heart into were often the most appreciated. It was also delightful to read plenty of honest criticism and helpful feedback, as I've already been given plenty of useful pointers on improving my brushwork, level design, and gameplay difficulty.
      I've gotten back into the groove of chipping away at my reading and game list, as well as the endless FM catalogue here, but I may very well try my hand at the 15th anniversary contest should it materialize. That is assuming my eyes are ready for a few more months of Dark Radiant's bright interface while burning the midnight oil, of course!
      · 4 replies
×
×
  • Create New...