Jump to content


Photo

Color Grading Shader


31 replies to this topic

#1 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 854 posts

Posted 07 July 2017 - 02:53 AM

*
POPULAR

Check this out...

 

Before

FCJQT8W.jpg

 

After

u5R3WEL.jpg

 

With nothing more than a fragment program and a specially crafted image, you can make the game B&W, sepia tone, inverted, pseudo infrared, etc. If it's a color adjustment you can do it in TDM in real time.

 

It's the same method employed in The Witness and Unreal Engine but adapted for use in TDM. If you'd like to read about the details there's a blog post that gives a rough outline over how it works.

 

I've packaged everything into a pk4 and have made it available on my OneDrive.


Edited by rich_is_bored, 22 July 2017 - 10:09 PM.

  • Bikerdude, Judith, Sotha and 10 others like this

#2 Sotha

Sotha

    Vertical Contest Winner

  • Active Developer
  • PipPipPipPipPip
  • 5557 posts

Posted 07 July 2017 - 03:37 AM

*
POPULAR

Very cool!

Those would be awesome if the mapper wants include hallucination or flashbacks into their stories.
  • Bikerdude, HMart, jaxa and 2 others like this
Clipper
-The mapper's best friend.

#3 New Horizon

New Horizon

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 13741 posts

Posted 07 July 2017 - 08:21 AM

Cool!

#4 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1400 posts

Posted 07 July 2017 - 08:50 AM

You are brilliant! I was looking to achieve something like this, had basicly given up as it took a lot more knowledge than I thought (and possessed), so cool to see this in action in TDM! 



#5 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36242 posts

Posted 07 July 2017 - 08:57 AM

I don't know if Obs used the same method, but this kind of thing has been possible for a while:  http://forums.thedar...hread/?p=332341



#6 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5033 posts

Posted 07 July 2017 - 09:14 AM

My shader is a bit simpler, but I guess the approach is similar.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#7 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1400 posts

Posted 07 July 2017 - 01:11 PM

Yes, I experimented with that, but was unable to control the shader. Maybe I set it up incorrectly, but I was also unable to get rid of a strong brightness effect. Still, I havent had time to look into Rich's solution yet, but hopefully it will also allow for custom color grading effects (the rgb editing that is refered to in the blog article linked above), which is actually what Ive been looking for!

Edited by RPGista, 07 July 2017 - 01:13 PM.


#8 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5033 posts

Posted 07 July 2017 - 01:16 PM

Some of the stuff happening in those shaders can require some math, which can be confusing or errorsome if you are not used to work with this. In addition ARB is pretty abstract and hard to read in comparision to modern programming languages. Easy to make mistakes when working with this stuff. :(


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#9 NeonsStyle

NeonsStyle

    Advanced Member

  • Member
  • PipPipPip
  • 1148 posts

Posted 08 July 2017 - 03:03 PM

Yeh that'd work beautifully for flashbacks


I have a small YouTube channel making videos on a variety of games. Come and have look here:
 
https://www.youtube.com/c/NeonsStyleHD

 

 

 


#10 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1400 posts

Posted 11 July 2017 - 10:35 PM

*
POPULAR

I dont think you guys are really getting all the massive potential that Rich's system is bringing to TDM. Not only can you get crazy, wacky effects (that would work for dreams and allucination scenarios, as some have mentioned), or a black and white scene, etc. - more importantly, you can actually create your own personalised visual style for your work, as an artistic expression. You can setup your own color grading, that means fine tuning your contrast, levels, color channels and saturation to get a specific look throughout your world, enhancing it in several ways. And all of that with a very simple system, where you basicly edit the provided palette in your image editing program. You take a screenshot from your map, make the changes untill you find the look you want, apply that to the LUT palette, and youre done. Its unbelieveable. 

 

Take a look at some quick tests I did inside a concept map Im working on:

 

Original

 

Attached File  testingmap_2017-07-08_00.34.09.jpg   75.28KB   0 downloads

 

Color graded

 

Attached File  testingmap_2017-07-08_00.34.05.jpg   93.18KB   0 downloads

 

Notice the changes in contrast, as well as the color channels.

 

This opens up a lot of opportunities. 

 

Attached File  testingmap_2017-07-08_00.48.10a.jpg   114.02KB   0 downloads

 

I would actually ask you guys to consider making this a built in feature of TDM, maybe experimenting with setups that could be selected in the options menu by the players. Sikkmod has this (several color grading settings you can choose from), we could also have some, like a bit of a sepia to it, or a bit of a colder one, or a grading that increases contrast, one that desaturates a little, etc (it would naturally have to be overidden by the mission's own LUT, if any). I just think it would make TDM that much cooler to look at. 

 

Edit: Editted out part about GUIs.


Edited by RPGista, 12 July 2017 - 09:34 PM.

  • Bikerdude, Judith, HMart and 3 others like this

#11 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5033 posts

Posted 11 July 2017 - 11:55 PM


because right now Im using Obs' idea of a sphere attached to the player to test the shader, and it doesnt affect either of those

I think I told you that this approach was just a test and that you should use a gui overlay instead ;)


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#12 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 519 posts

Posted 12 July 2017 - 03:21 AM

Very cool, and very important feature as well. It would be great to have a step-by-step tutorial for this in the wiki :)



#13 Spooks

Spooks

    Member

  • Member
  • PipPip
  • 358 posts

Posted 13 July 2017 - 04:28 PM

I've packaged everything into a pk4 and have made it available on my OneDrive.


OneDrive deems it "sensitive info" and requires a log in. I've downloaded it, but it would be nice to reupload this somewhere else besides OneDrive.

Edited by Spooks, 13 July 2017 - 04:34 PM.

My FMs: The King of Diamonds (2016)

 

Visit my Mapbook thread sometimes!


#14 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 854 posts

Posted 13 July 2017 - 11:28 PM

You're welcome to host it elsewhere and share the link. I'm not familiar with any other file host that is both free and offers unlimited retention.



#15 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 519 posts

Posted 14 July 2017 - 02:53 AM

I had no filename on the OneDrive screen but the download button worked. Here's the Dropbox link:

 

https://www.dropbox....1/clut.pk4?dl=1



#16 Spooks

Spooks

    Member

  • Member
  • PipPip
  • 358 posts

Posted 14 July 2017 - 07:59 PM

I'm having trouble with this. The post process works half the time and at seemingly random looking angles the screen stops rendering. Without bloom it looks like the image is frozen, with bloom it quickly blooms up to a white screen.

I tried playing with switching interaction shaders, vsync and full screen without any success. It doesn't matter which map I use.

My FMs: The King of Diamonds (2016)

 

Visit my Mapbook thread sometimes!


#17 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 854 posts

Posted 15 July 2017 - 01:08 AM

I saw similar issues when testing using g_testPostProcess. It has something to do with visportals as disabling them fixes the problem.

 

To use this in production you need to modify the hud gui by creating an extra windowDef and applying the material there.

 

I'm not able to whip up a modified GUI ATM but if nobody addresses the problem for you in the next day or so I'll see what I can do.


  • RPGista and Spooks like this

#18 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 854 posts

Posted 16 July 2017 - 12:00 AM

That was simple enough. You'll need to download zzz_clut.pk4. It's been renamed to ensure it is loaded last and successfully overrides tdm_hud.gui.


  • RPGista likes this

#19 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1400 posts

Posted 17 July 2017 - 12:21 AM

Thats awesome! But unfortunately, I was testing this on a couple of maps and Im getting a black screen. The game is running, you can see the HUD items (and see the night skybox in one map), but everything else is black...



#20 freyk

freyk

    Member

  • Member
  • PipPip
  • 441 posts

Posted 17 July 2017 - 05:58 AM

To use this in production you need to modify the hud gui by creating an extra windowDef and applying the material there.

Simple method to color-grade the screen, is to give the hud-gui a transparant background colour.
(but i didnt added an extra windowdef)
Its doesnt have nice effect like in the screenshots above, but it gives the player a low-systemperformance effect.

Edited by freyk, 17 July 2017 - 06:06 AM.


#21 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 854 posts

Posted 17 July 2017 - 07:25 AM

@freyk:

 

Sure, if all you want to do is apply a color cast that works.

 

@RPGista:

 

Are there missions where you don't get a black screen? I've tested it in the training mission and it works fine. I'm not sure how to handle this aside from doing something silly like binding a sphere to the player if the gui overlay approach doesn't work.



#22 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1400 posts

Posted 17 July 2017 - 09:50 AM

Strange... I tried on a few more missions I have here, got an image in Mother Rose, everything was working great in the sense all items but the HUD graphics were being affected by the color grading, but it was extremely dark, several times darker than my clut editing. In A Step too Far, all I get is the starry sky. In my own testing map, only  a black screen. Im posting the console dump, if it is any help.

 

Attached File  mother.txt   31.7KB   1 downloads

 

Attached File  step.txt   31.35KB   0 downloads

 

Attached File  testing.txt   32.72KB   0 downloads

 

PS: In all cases, the HUD graphics are showing fine (player items). Its the world view and hud models that are black. 

Could it be anything related to graphics settings? 

 

PS2: I put the pk4 in the darkmod folder (was using it per mission folder before). I can confirm that the shader works on the training mission, as well as the Saint Lucia one. But both are suffering from strong slow downs on random intervals, the image just freezes, then comes back again. The game doesnt hang, I can escape to the menu and exit the game normally. It just freezes while playing. 


Edited by RPGista, 17 July 2017 - 10:19 AM.


#23 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11682 posts

Posted 17 July 2017 - 10:25 AM

Mother Rose is dark by design inside the Doctor's house.



#24 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1400 posts

Posted 17 July 2017 - 10:38 AM

No, this was a lot darker than that, and I just tested it inside the starting area, the cemetery. It was as if I had lowered the levels almost completely on the LUT palette (it was a notch above completely black), but I was using the same one I used to make the screenshots above. It was definitely something to do with the GUI overlay.

 

The bound sphere thing does work, but it has several setbacks. It wont follow you if you crouch (it hovers over your head). If its too small, you'll come out of it when you are mantling things. If its too big, it will clip models around you. I guess thats why you could use two, one big and one small, to account for these problems. But it wont affect the player's HUD models (arms and weapons) which breaks the effect quite a lot. Hopefully this is not hard to fix, having it on the GUI is the perfect solution! 



#25 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11682 posts

Posted 17 July 2017 - 10:55 AM

IIRC, my solution in Cleighmoor for putting a veil over the player's eyes was to not bind the veil to the player, but to move the veil each frame and place it X units in front of the player's eyes, and rotate it properly so that the forward view vector always intersected the veil's plane at 90 degrees. This way, when the player crouches, the veil also crouches. (I might be wrong, but this is how I remember it.)


  • RPGista likes this



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users