From cbfadaaa4c0cd605bae85319f609a2a997a960ea Mon Sep 17 00:00:00 2001 From: normalcat Date: Sat, 14 Feb 2026 09:48:55 -0800 Subject: [PATCH 1/2] screenshader docs --- SMODS.ScreenShader.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 SMODS.ScreenShader.md diff --git a/SMODS.ScreenShader.md b/SMODS.ScreenShader.md new file mode 100644 index 0000000..10c7a29 --- /dev/null +++ b/SMODS.ScreenShader.md @@ -0,0 +1,20 @@ +# API Documentation: `SMODS.ScreenShader` +This class allows for drawing a shader on the entire screen, rather than just a singular object. +- **Required parameters:** + - `key` + - `shader` or `path` + - `shader` refers to the key of an existing shader, including mod prefix key. `path` refers to the file of a shader similar to the `path` parameter in `SMODS.Shader` + - Only one of these parameters is required, having both will prioritize `shader` and ignore `path` +- **Optional parameters** *(defaults)*: + - `order` + - Defines the order in which ScreenShaders should be rendered, defaults to 0 + - Lower orders are rendered earlier + + +## API methods +- `should_apply(self) -> boolean` + - Determines whether a ScreenShader should apply to the screen at any given time. If not defined, defaults to always applying. +- `send_vars(self) -> table` + - Returns a table of all variables to send to the shader + - For example, returning `{iTime = G.TIMERS.REAL}` would send the floating point value `iTime`, allowing it to be used in the shader with `extern float iTime;` + - Note that if you do not use all external variables in the shader, it will crash \ No newline at end of file From 614468efb6876bb39c4cb260debb913218bee0c8 Mon Sep 17 00:00:00 2001 From: normalcat Date: Sat, 14 Feb 2026 11:16:56 -0800 Subject: [PATCH 2/2] basic screenshader docs --- SMODS.ScreenShader.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/SMODS.ScreenShader.md b/SMODS.ScreenShader.md index 10c7a29..bdec0fb 100644 --- a/SMODS.ScreenShader.md +++ b/SMODS.ScreenShader.md @@ -8,13 +8,20 @@ This class allows for drawing a shader on the entire screen, rather than just a - **Optional parameters** *(defaults)*: - `order` - Defines the order in which ScreenShaders should be rendered, defaults to 0 - - Lower orders are rendered earlier + - ScreenShaders are rendered in order from lowest to highest. ## API methods - `should_apply(self) -> boolean` - Determines whether a ScreenShader should apply to the screen at any given time. If not defined, defaults to always applying. - `send_vars(self) -> table` - - Returns a table of all variables to send to the shader - - For example, returning `{iTime = G.TIMERS.REAL}` would send the floating point value `iTime`, allowing it to be used in the shader with `extern float iTime;` - - Note that if you do not use all external variables in the shader, it will crash \ No newline at end of file + - Used to send extra vars to the shader, similar to `SMODS.Shader.send_vars` + - One major difference between the two, with `SMODS.ScreenShader.send_vars`, you can pass arrays like so + ```lua + send_vars = function(self) + return { + float_array = {array = {1.5, 2.3, 6.7}}, + vector_array = {array = { {x, y}, {z, w} }} + } + end + ``` \ No newline at end of file