Vanilla Shader Resource

[Open Assets] Vanilla Shader Resource 1.0.0

If you add this file and nothing looks different, that's great news.

This is a direct port of the internal hardcode shaders into an addon. This is for reference to anyone who wants to explore making custom shaders.

Hopefully this can act as a guide to experiment with your own shaders, and can also be used as a starting point.

The contents are explained as follows:
SHADERS.cfgThe config that maps the shaders to their targets
Ref.txtA file that has some hardcode references and some more info
ShadersA folder that contains the actual shader code
sh_DefaultFS.glslDefault Fragment shader, unused
sh_DefaultVS.glslDefault Vertex shader, used by most targets
sh_FogFS.glslThe fragment shader for fog
sh_ModelLightingFS.glslThe fragment shader for model lighting
sh_ModelLightingVS.glslThe vertex shader for model lighting
sh_SkyFS.glslThe sky dome fragment shader
sh_SoftwareFS.glslThe standard fragment shader used by most targets
sh_WaterRippleFS.glslThe fragment shader used by liquids

The SHADERS.cfg file and the Shaders folder are required. Everything else is not mandatory, and should be used as necessary, based on what shaders you want to include or modify.
The SHADERS.cfg file only needs to include the targets you want to replace. The shaders can be named however you want, but in a pk3, they must start with sh_, and must match the name in the SHADERS.cfg file.

If you want to learn more about shaders, I suggest researching GLSL. This is the shader language used here, and more info can be found in resources such as https://www.khronos.org/opengl/wiki/OpenGL_Shading_Language

Here is a good guide by Hannu_Hanhi that goes into more detail about shaders in SRB2.
https://git.do.srb2.org/Hannu_Hanhi/SRB2/wikis/SRB2-Shader-Guide

I have a script I use to assist in my workflow.
Compile.bat:
for %%I in (.) do set CurrDirName=%%~nxI
set fileName=%CurrDirName%.pk3
"C:\Program Files\7-Zip\7z.exe" a -tzip -x"!%~nx0" -x"!%fileName%" "%fileName%" "*"
This is a windows bat script that assumes you have 7zip installed in the default directory.
If you use this, you can use it as follows:
  1. Create a named folder for what you want your pk3 to be called.
  2. Add this bat file into the folder, and add the other parts required for the shader.
  3. Modify the files freely.
  4. When you are ready to test your shader, run the bat.
  5. It will compile the parts in the folder into a pk3 named after the folder that can be added.
  6. You can re-run the script and it will recreate the pk3 with the latest changes.

As these are shaders, it's for opengl only.
The shaders are up to date as of the 2.2.9 pre-release.

Have fun exploring the world of shaders!
Author
DarkTechno
Downloads
1,243
Views
6,255
Extension type
pk3
File size
5.6 KB
MD5 Hash
81cd8ece7b18000967cb9d7ed141f944
First release
Last update

Share this resource

Latest reviews

Welcome to releases!
Upvote 0
Back
Top