Can I pull input from a file to affect a shader?

  • skypalace
  • Topic Author
More
4 months 1 week ago #1 by skypalace Can I pull input from a file to affect a shader? was created by skypalace
I would really like to create some communication between reshade and what is actually happening in the game.

Currently playing Oblivion Remastered, and getting comfortable using the lua scripting. 

I can now get the time of day, and write that to a file, and it would be great if I could have Reshade ingest that file and adjust parameters to my liking.

That way, I can have different effects for day and night, interior vs exterior, etc.

Can it be done? Can I have a script write to a file, and then have reshade read it and adjust effect parameters dynamically?

Please Log in or Create an account to join the conversation.

  • crosire
More
4 months 1 week ago #2 by crosire Replied by crosire on topic Can I pull input from a file to affect a shader?
You can do all that and more with the ReShade add-on API: reshade.me/docs

So would create an add-on (effectively just a DLL) with the basic template from above documentation (DllMain + registering an event with ReShade). It does assume some very basic knowledge of C++ though (so far as to be able to create a DLL project in e.g. Visual Studio and add the ReShade API header files from github.com/crosire/reshade/tree/main/include ). In your case then probably want to register a callback for the "reshade::addon_event::reshade_begin_effects" event, as that is called right before rendering effects each frame and a good place to update uniform variables etc. Then can use the "reshade::api::effect_runtime" instance passed to the callback to look up uniform variables in your effect ( crosire.github.io/reshade-docs/structres...d32d1d3d4864dacef6e7 ) and update their values ( crosire.github.io/reshade-docs/structres...94e4289d30605a5c9742 ).

Please Log in or Create an account to join the conversation.

  • skypalace
  • Topic Author
More
4 months 6 days ago #3 by skypalace Replied by skypalace on topic Can I pull input from a file to affect a shader?
Thank you for your reply! I shall begin going down this rabbit hole

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.