Frictional Games Forum (read-only)
Custom Shader Mod Tool! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Resources (https://www.frictionalgames.com/forum/forum-42.html)
+---- Thread: Custom Shader Mod Tool! (/thread-26356.html)

Pages: 1 2 3


Custom Shader Mod Tool! - Viper85626 - 09-26-2014

Hey everybody! Let me first say that this is my first ever contribution to these forums and I'm really excited about it!

So, I was lurking around the development forums while I was at school a couple days ago and I came upon this thread from 12/30/2012: Black and White Screen Effects?

The only reason I really saw it was because it was still an active thread. The last post was actually a few days ago. But to make a long story short, if you don't know what's in that thread, or you don't want to read through all 6 pages, TheGreatCthulhu actually figured out a way to change the sepia screen effect to a custom one! He created a greyscale and "Predator" effect.

[Image: 8336640972_145a71fa1b_b.jpg]

Now on the very recent posts, everyone was talking about making a tool that could manage these shader mods and incorporate them into FCs since the "/core/shaders" folder is hardcoded into the game and isn't on the "resources.cfg." I figured I would practice some of my programming again and took the first step into this new-ish feature!

Keep in mind that this is a very early/basic tool at the moment. If anyone would like to suggest or even contribute to further this tool, it would be greatly appreciated!

[Image: zTwA153.png]

Instructions:
- Select the target shader folder in which to install your shader mod (preferably in "core/shaders."
- Option to make a backup of .glsl file(s) into a new folder in the target folder called "Original Backup." File extension is also changed to .glslORIG during this process.
- Find your custom shader file from anywhere on your computer. Name does not matter.
- "Load Custom Shader" will take your modded shader, rename it to the proper shader file, then overwrite it in the target folder.

Congratulations! Your new shader is now installed!

There are a few drawbacks to this app at the moment:
- Only the "posteffect_color_conv_tex_frag.glsl" file is accepted in this app due to the fact that it was the only one discussed in the above thread and also because I don't understand .glsl files and do not want to ruin the original installation. (If anyone has any information regarding these files, what they do, and if there is even a point for the program to manipulate the other .glsl files, please let me know.)
- This app does NOT have any association with the .tga files that are the actual gradient maps used by this shader. (Planned in a future update.)

Well, without further ado, here is the download link! Hope you guys enjoy and are able to make a use of this! Big Grin (You can alternatively download the RAR packed file in the attachments below.)

https://www.dropbox.com/s/joe6tz3q9hxwmvr/Amnesia%20Shader%20Tool.exe?dl=1


RE: Custom Shader Mod Tool! - Mudbill - 09-26-2014

Ah, I see you got around to doing it before me. I guess that's the price to pay for being lazy xP

Nice work though! What language is it made in?


RE: Custom Shader Mod Tool! - Viper85626 - 09-26-2014

(09-26-2014, 07:26 AM)Mudbill Wrote: Ah, I see you got around to doing it before me. I guess that's the price to pay for being lazy xP

Nice work though! What language is it made in?

Ha yeah! I made it a little personal goal to get this out before you did Wink It's written in VB 2013.


RE: Custom Shader Mod Tool! - Romulator - 09-26-2014

This is the original post, detailing the manual instructions and/or full explanation of what happens.

Quote:Only the "posteffect_color_conv_tex_frag.glsl" file is accepted in this app due to the fact that it was the only one discussed in the above thread and also because I don't understand .glsl files and do not want to ruin the original installation. (If anyone has any information regarding these files, what they do, and if there is even a point for the program to manipulate the other .glsl files, please let me know.)

You can use a differing file but it must use the same file name. This file can only be read from the core/shaders folder as core is loaded from Amnesia independently from the resources. You cannot use a differing filename - quite simply to avoid Amnesia crashing. Think of it like your application - it looks for a particular file. If it cannot find it, it will likely crash. From what I know, this particular .glsl file messes with the graphics using code called when FadeSepiaColorTo(); is used.

In reality, the .glsl file does not need to be backed up, but is a good idea regardless.

Also - the program does not need to modify any files other than the posteffect_color_conv_tex_frag.glsl. Since you mentioned programming, I assume you are aware of something called Scope. Seeing as your applications purpose is to modify the core files required to create a shader effect, your application does not need to do anything else - which means it is not a Functional Requirement.

Quote:Select the target shader folder in which to install your shader mod (preferably in "core/shaders.")

I would personally not recommend putting the colorconv_sepia.tga file in the core/shaders folder (if this is what you are saying, because that's what it seems like). If you're replacing, it will go in textures/shaders/, otherwise you can 'trick' Amnesia by putting the effect in another folder, and having that placed above the textures entry in the resources.cfg. I'm sorry if that sounds like gibberish, but give it a few reads and you'll understand.



In terms of your future app development:
- Get a readme or a help file. This is called User's Documentation. It tells the user what to do. Put it within the application or in a seperate text file. Perhaps using ToolTips over the text box or the respective button could work too. When programming, assume a user has no idea what to do. How/Where could they get or be helped?
- If you have an idea for the program and do not know how to go about it, as long as it is in VB, feel free to ask.

Chrome may say the file is malicious. It is a false flag. https://www.virustotal.com/en/file/582596c031a5b6c280ea9288be190b9399de3ef84ca62c0dbf44360a329fc2f9/analysis/1411723044/


RE: Custom Shader Mod Tool! - Mudbill - 09-26-2014

Your tool is requesting administrator credentials. Would this be possible to rid? I'm currently unable to run it from here because of this, and it would probably get somewhat annoying to have to write your admin name + password, or press "Yes" (depending) every time it's started.


RE: Custom Shader Mod Tool! - Daemian - 09-26-2014

Good job. Rep+
But let me say I think we are going in the wrong direction.

(09-26-2014, 07:21 AM)Viper85626 Wrote: about making a tool that could manage these shader mods and incorporate them into FCs since the "/core/shaders" folder is hardcoded into the game

In my opinion I don't think that's precisely what we need. You see, our main concern it's the player, cause we can copy files around, but we can't bother the player with tools and programs to have our mod working. If anyone skips this part -of using a given tool-, or gets confused on how to use it, or what it is, he won't be able to see the custom effects we wanted.
So what khutulu suggested is to make one single loader program that could handle all this kind of stuff -invisible to the users-, so they only have to press play.
This loader should handle custom shaders and other stuff by just reading a config file the modder includes in his mod. A flag, a file check, whatever.

That's just my opinion on the subject, if we want players to use custom shaders, we have to make a loader. Just one, friendly, intuitive, simple.


RE: Custom Shader Mod Tool! - Viper85626 - 09-26-2014

(09-26-2014, 09:06 AM)Romulator Wrote:
Quote:Select the target shader folder in which to install your shader mod (preferably in "core/shaders.")

I would personally not recommend putting the colorconv_sepia.tga file in the core/shaders folder (if this is what you are saying, because that's what it seems like). If you're replacing, it will go in textures/shaders/, otherwise you can 'trick' Amnesia by putting the effect in another folder, and having that placed above the textures entry in the resources.cfg. I'm sorry if that sounds like gibberish, but give it a few reads and you'll understand.

Haha, I completely understand what you're saying. I've been developing an FC for the past 6 months already Tongue But this app doesn't deal with .tga files yet. It only deals with .glsl files. That's why I wanted to target the shaders folder.

(09-26-2014, 12:38 PM)Mudbill Wrote: Your tool is requesting administrator credentials. Would this be possible to rid? I'm currently unable to run it from here because of this, and it would probably get somewhat annoying to have to write your admin name + password, or press "Yes" (depending) every time it's started.

I added admin rights because some people may have the target folder somewhere like the Steam directory where the app may not be able to write to without those privileges. I can take them off and reupload if you want. But if it can't write somewhere because of permissions, then you'll need admin rights.

(09-26-2014, 03:50 PM)Daemian Wrote: Good job. Rep+
But let me say I think we are going in the wrong direction.

(09-26-2014, 07:21 AM)Viper85626 Wrote: about making a tool that could manage these shader mods and incorporate them into FCs since the "/core/shaders" folder is hardcoded into the game

In my opinion I don't think that's precisely what we need. You see, our main concern it's the player, cause we can copy files around, but we can't bother the player with tools and programs to have our mod working. If anyone skips this part -of using a given tool-, or gets confused on how to use it, or what it is, he won't be able to see the custom effects we wanted.
So what khutulu suggested is to make one single loader program that could handle all this kind of stuff -invisible to the users-, so they only have to press play.
This loader should handle custom shaders and other stuff by just reading a config file the modder includes in his mod. A flag, a file check, whatever.

That's just my opinion on the subject, if we want players to use custom shaders, we have to make a loader. Just one, friendly, intuitive, simple.

Okay, I get what you're saying. Thanks for the feedback! This app will definitely have future updates, so I'll keep all of that in mind.


RE: Custom Shader Mod Tool! - Acies - 10-01-2014

(09-26-2014, 07:21 AM)Viper85626 Wrote: - Only the "posteffect_color_conv_tex_frag.glsl" file is accepted in this app due to the fact that it was the only one discussed in the above thread and also because I don't understand .glsl files and do not want to ruin the original installation. (If anyone has any information regarding these files, what they do, and if there is even a point for the program to manipulate the other .glsl files, please let me know.)
- This app does NOT have any association with the .tga files that are the actual gradient maps used by this shader. (Planned in a future update.)



Hurray!

I'd like to replace a lot of other shaders though, so adding the possibility of that would be great! Tongue

Basically most of the shaders in redist\core\shaders. Most of those shaders were rewritten/upgraded at the release of AMFP. You can basically go into AMFP shader folder and copy those shaders to your amnesia folder, except "_test_array_support_frag.glsl".

One of the issues I do know of is the how the bloom works. Take a look at this for example:
Spoiler below!

Original bloom shader:
[Image: IBRhrVR.jpg]

AMFP bloom shader:
[Image: 7vFLALI.jpg]


Basically the original bloom overbrightens (and drowns out) colors, especially white which just becomes a pure white smudge.

I can assume that the other changes made to the shaders fix similiar problems!

So, in order to get a better looking game it's either a scenario of 'everyone replaces their shaders as part of the AMFP patch (https://www.frictionalgames.com/forum/thread-23378.html) or I replace every shader for my mod :]


RE: Custom Shader Mod Tool! - Viper85626 - 10-01-2014

(10-01-2014, 03:20 PM)Acies Wrote:
(09-26-2014, 07:21 AM)Viper85626 Wrote: - Only the "posteffect_color_conv_tex_frag.glsl" file is accepted in this app due to the fact that it was the only one discussed in the above thread and also because I don't understand .glsl files and do not want to ruin the original installation. (If anyone has any information regarding these files, what they do, and if there is even a point for the program to manipulate the other .glsl files, please let me know.)
- This app does NOT have any association with the .tga files that are the actual gradient maps used by this shader. (Planned in a future update.)



Hurray!

I'd like to replace a lot of other shaders though, so adding the possibility of that would be great! Tongue

Basically most of the shaders in redist\core\shaders. Most of those shaders were rewritten/upgraded at the release of AMFP. You can basically go into AMFP shader folder and copy those shaders to your amnesia folder, except "_test_array_support_frag.glsl".

One of the issues I do know of is the how the bloom works. Take a look at this for example:
Spoiler below!

Original bloom shader:
[Image: IBRhrVR.jpg]

AMFP bloom shader:
[Image: 7vFLALI.jpg]


Basically the original bloom overbrightens (and drowns out) colors, especially white which just becomes a pure white smudge.

I can assume that the other changes made to the shaders fix similiar problems!

So, in order to get a better looking game it's either a scenario of 'everyone replaces their shaders as part of the AMFP patch (https://www.frictionalgames.com/forum/thread-23378.html) or I replace every shader for my mod :]

I'll add all .glsl compatibility ASAP! A little offtopic: Do you think it's fine that I don't have the AMFP patch? I never bought AMFP, so that's the reason I never got it. Plus I've been developing my FC for a while and I'm using a lot of custom assets anyway.


RE: Custom Shader Mod Tool! - Romulator - 10-01-2014

If you have the AAMFP patch, it makes it a little bit easier to work with outdoor environments, gives you a few more entities to muck around with at the cost of your brute, gives you a little more creativity - however you have to supply all things like you would with your FC. I personally would not recommend it as it is not needed for a good story.