Jump to content
The Dark Mod Forums

Color Grading Shader


rich_is_bored

Recommended Posts

Just tested it in Mother Rose and went into the house...

 

nvmvetn.jpg

 

I want to say it's a graphics setting but at the same time the shader obviously runs because you've posted screenshots above. Try Mother Rose again but this time hide the HUD with g_showHud and test the shader directly with g_testPostProcess. At least then we will know for certain if it's the gui overlay or not.

  • Like 1
Link to comment
Share on other sites

Indeed my friend, Im afraid it seems to be the GUI implementation. I've tested both versions, following the instructions, and Im always getting the same result. First, there's a black screen with little color dots. If I move around, randomly I get a picture, visually the shader is working as intended, but there is frequent freezing (only the image freezes, I can hear the game going on underneath). It happened in The New Job, Saint Lucia, Training Mission, even my own testing map, the one I used to post the pictures (it doesnt have any portals). My guess is that it was working flawlessly for me before because I was simply applying the shader to the bound sphere. I didnt even try using the g_test command before, thats why I didnt notice the issues at the time.

 

My settings are these, if relevant: ambient rendering - simple, interaction shader - default, post processing - disabled, no bloom.

Edited by RPGista
  • Like 1
Link to comment
Share on other sites

I've tested with your settings and I replicated the freezing picture. I've narrowed it down to post processing being disabled. It makes sense since you're telling the engine that you don't want to run post processing effects.

 

The peculiar thing to me is that anything is visible at all. If you've disabled post processing then in the material shader the conditional "if (fragmentPrograms == 1)" should evaluate to false and the entire stage should be skipped. And yet even on my end, I'm still seeing color grading with post processing disabled.

 

As for the black screen with color dots, that must be unique to your hardware setup. For the record I'm using an NVidia GeForce GTX 970.

Link to comment
Share on other sites

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.

 

Unfortunately, turning the post processing option on results in the exact same problem reported by Spooks, the screen quickly brightens to a solid white...

 

I was looking into the post processing info (here http://wiki.thedarkmod.com/index.php?title=Advanced_TDM_Visuals_Tweaking ), perhaps we are having these issues due to the way the mechanics were written into TDM. I have no technical knowledge on the matter, but the way it sounds is that the implementation was not a straight foward affair, and might have altered the way vanilla idtech4 had this set up, in unpredicatable ways? (Assuming you wrotte the program and shader having the original engine in mind) "During development the team of developers ran into several problems with the original HDR implementation, including performance issues and some visual artifacts, that were hard to circumvent given the fact that the source of idTech 4 is still closed. It was then decided not to work on the basis of an actual "High Dynamic Range", but to still maintain most of the resulting effects. The HDR implementation was altered and split up into the new Enhanced Interaction Shader and the HDR-Lite Post-Processing."

Edited by RPGista
Link to comment
Share on other sites

Yeah, I've read through that but nothing jumps out at me as the cause of this issue. It does however answer a question I had about how bloom is implemented. The fragment programs responsible; brightPass_opt.vfp and finalScenePass_opt.vfp, are called from within the engine. The color grading shader cannot be implemented in the same fashion without modifying the TDM codebase and compiling a custom executable. That's fine if it became a core part of the mod but it's not an option for a single mission.

 

However, there are some slight differences in the materials that may be worth looking into. Take for instance postprocess/finalScenePassOptimized...

material postprocess/finalScenePassOptimized {
    noshadows
    noimpact
    sort    postProcess
    {
        rgba 1
        vertexParm        0     parm0, parm1, parm2, parm3        
        program        finalScenePass_opt.vfp

        fragmentMap 0 forceHighQuality     _currentRender
        fragmentMap 1 linear             _bloomImage
        fragmentMap 2 nopicmip             _cookedMath
    }
}

There is no conditional. "rgba" is set to 1. _currentRender is passed to the fragment program with the parameter forceHighQuality. I can't see what good those changes would do but it might be worth making similar changes to the color grading material so it more closely matches other post process effects. Something like this ...

textures/postprocess/sepia
{
    noshadows
    noimpact
    sort    postProcess
    {
        rgba 1
        vertexProgram clut.vfp
        fragmentProgram    clut.vfp
        fragmentMap 0 forceHighQuality _currentRender
        fragmentMap 1 linear textures/clut/sepia_clut.tga
    }
}

Also, if you suspect bloom and such is interfering with the clut shader, you can override brightPass_opt.vfp and finalScenePass_opt.vfp with dummy files (empty files with no content). The console will complain about it but the net result is those graphics calls will be skipped.

 

I can't test this since it's working on my end. Out of curiosity, what GPU are you using?

 

  • Like 1
Link to comment
Share on other sites

Amazing, making those changes to the material actually fixed the problem! This is brilliant. I was able to playtest for quite a while without any glitches whatsoever. The only downside is that you still get the freezing problem if you turn postprocessing off in the menu settings (or, presumably, if you have it off when starting a mission). So you must have/keep post processing (bloom) on when playing the game with the color grading shader. Do you think theres a way for the shader to force this, and override the menu setting?

 

PS: This feature is so cool, I cant see any reasons for it not to be a part of the core game (apart from the implementation work load, of course). All we would need is for the post processing setting to be always on (and greyed out) whenever the color grading setting were to be set to on.

Edited by RPGista
Link to comment
Share on other sites

That's surprising. I wasn't expecting it to work.

 

Was it editing the material shader alone that did the trick? I'll have to update the package accordingly.

 

I'd really like to put the conditional back in provided it doesn't break anything. Skipping the color grading process is the proper fail safe in the event someone has turned off post processing. Color grading isn't so critical that your map should be unplayable without it.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry, couldnt find the time to play with this further. I shall mess with the args a bit to see if I can pinpoint what made the difference.

Edited by RPGista
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

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 1 reply
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • 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.
      · 7 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
×
×
  • Create New...