Where to start programming new shaders?

  • januarybef
  • Topic Author
More
7 years 4 months ago #1 by januarybef Where to start programming new shaders? was created by januarybef
I'm an amateur programmer and I want to create some new shaders for Skyrim Special Edition and see how shaders work. But I have no idea where to start, where to add my code, ... . What I want to do is to program and add my own shader to play a certain effect on a simple plane in the game. Where should I start?

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

  • crosire
More
7 years 4 months ago #2 by crosire Replied by crosire on topic Where to start programming new shaders?
You can't do that with ReShade. With ReShade you can write post-processing shaders that work on the entire image at once. Information about specific objects in the scene are not available.
The following user(s) said Thank You: januarybef

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

  • januarybef
  • Topic Author
More
7 years 4 months ago - 7 years 4 months ago #3 by januarybef Replied by januarybef on topic Where to start programming new shaders?
I know about that. But I thought maybe if I could set the plane's texture to a very unusual color, like a high intensity blue, I could tell Reshade to take all of the pixels, forget the ones which are not this specific blue and do a specific action over the blue pixels. Couldn't I?
The question is not about how I can write this specific shader. It was just an example. I want to know how am i even supposed to write a shader using Reshade. Where should I save my shader. How to make Reshade inject my shader. How and which of the files should I include at the top of the program. The documentation seems quite vague (or maybe it's because I'm too amateur to understand it) Does it even have a debugging tool?
Last edit: 7 years 4 months ago by januarybef.

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

  • crosire
More
7 years 4 months ago #4 by crosire Replied by crosire on topic Where to start programming new shaders?
Create an *.fx file and place it in one of the folders that were set under "Effect Search Paths" in ReShade's UI. ReShade will then pick it up, try to compile it and apply all techniques that you enable in the UI to the game.
The format of ReShade FX files (*.fx) is documented here: github.com/crosire/reshade-shaders/blob/master/REFERENCE.md . Since the syntax is similar to the popular HLSL language, you apply most of the things learned from tutorials for HLSL to ReShade FX as well. Here's a good starting point: msdn.microsoft.com/en-us/library/windows...944006(v=vs.85).aspx .
The following user(s) said Thank You: januarybef

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

  • januarybef
  • Topic Author
More
7 years 4 months ago #5 by januarybef Replied by januarybef on topic Where to start programming new shaders?
THANKS! You're a lifesaver. At least now I have a direction to start. ;)

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.