From da1bd6a58a0d184cb0071a6841341e74aec74ee4 Mon Sep 17 00:00:00 2001 From: ChaoticByte Date: Tue, 4 Feb 2025 18:59:57 +0100 Subject: [PATCH] Don't include the shaderlib in the application anymore, instead distribute a zip file with each release --- dist.sh | 14 ++++++++++---- examples/blur.gdshader | 2 +- examples/color_and_pixelate.gdshader | 4 ++-- examples/denoise.gdshader | 2 +- examples/kuwahara.gdshader | 4 ++-- examples/oklab.gdshader | 2 +- examples/place_texture.gdshader | 4 ++-- examples/{project.godot => project.godot_} | 0 examples/shaderlib | 1 + export_presets.cfg | 2 +- shaderlib/_DO_NOT_EDIT.txt | 10 ---------- 11 files changed, 21 insertions(+), 24 deletions(-) rename examples/{project.godot => project.godot_} (100%) create mode 120000 examples/shaderlib delete mode 100644 shaderlib/_DO_NOT_EDIT.txt diff --git a/dist.sh b/dist.sh index 6b0d0a4..c2ddf3a 100755 --- a/dist.sh +++ b/dist.sh @@ -10,13 +10,19 @@ VERSION="$(godot --headless --no-header -s tools/get_version.gd)" godot --headless --export-release "Linux/X11" "dist/Fragmented-${VERSION}.x86_64" +log Packing shaderlib + +ZIP_PATH_SHADERLIB=$(realpath "dist/Fragmented-${VERSION}_shaderlib.zip") + +zip -r "${ZIP_PATH_SHADERLIB}" shaderlib/ + log Packing project template -ZIP_PATH=$(realpath "dist/Fragmented-${VERSION}_project_template.zip") +ZIP_PATH_PROJECT_TEMPLATE=$(realpath "dist/Fragmented-${VERSION}_project_template.zip") -rm -f "${ZIP_PATH}" -zip -r "${ZIP_PATH}" shaderlib/ +rm -f "${ZIP_PATH_PROJECT_TEMPLATE}" ( cd examples/ - zip -r "${ZIP_PATH}" * + mv project.godot_ project.godot && trap "mv project.godot project.godot_" EXIT + zip -r "${ZIP_PATH_PROJECT_TEMPLATE}" * ) diff --git a/examples/blur.gdshader b/examples/blur.gdshader index 8d08069..fa4d87d 100644 --- a/examples/blur.gdshader +++ b/examples/blur.gdshader @@ -1,7 +1,7 @@ shader_type canvas_item; //!load ./images/swamp.jpg -#include "res://shaderlib/blur.gdshaderinc" +#include "./shaderlib/blur.gdshaderinc" void fragment() { COLOR = gaussian_blur(TEXTURE, UV, 48, 24.0); diff --git a/examples/color_and_pixelate.gdshader b/examples/color_and_pixelate.gdshader index dfb5e7b..f490db4 100644 --- a/examples/color_and_pixelate.gdshader +++ b/examples/color_and_pixelate.gdshader @@ -1,7 +1,7 @@ shader_type canvas_item; -#include "res://shaderlib/hsv.gdshaderinc" -#include "res://shaderlib/pixelate.gdshaderinc" +#include "./shaderlib/hsv.gdshaderinc" +#include "./shaderlib/pixelate.gdshaderinc" //!load ./images/swamp.jpg diff --git a/examples/denoise.gdshader b/examples/denoise.gdshader index 09dabb6..229a8da 100644 --- a/examples/denoise.gdshader +++ b/examples/denoise.gdshader @@ -2,7 +2,7 @@ shader_type canvas_item; //!load ./images/noisy.png -#include "res://shaderlib/denoise.gdshaderinc" +#include "./shaderlib/denoise.gdshaderinc" void fragment() { COLOR = smart_denoise(TEXTURE, UV, 12.0, 1.0, .12); diff --git a/examples/kuwahara.gdshader b/examples/kuwahara.gdshader index 345f826..246e162 100644 --- a/examples/kuwahara.gdshader +++ b/examples/kuwahara.gdshader @@ -2,8 +2,8 @@ shader_type canvas_item; //!load ./images/mountain.jpg -#include "res://shaderlib/kuwahara.gdshaderinc" -#include "res://shaderlib/hsv.gdshaderinc" +#include "./shaderlib/kuwahara.gdshaderinc" +#include "./shaderlib/hsv.gdshaderinc" void fragment() { // Kuwahara diff --git a/examples/oklab.gdshader b/examples/oklab.gdshader index 8018695..08f46b5 100644 --- a/examples/oklab.gdshader +++ b/examples/oklab.gdshader @@ -1,6 +1,6 @@ shader_type canvas_item; -#include "res://shaderlib/oklab.gdshaderinc" +#include "./shaderlib/oklab.gdshaderinc" //!load ./images/swamp.jpg diff --git a/examples/place_texture.gdshader b/examples/place_texture.gdshader index 76d01fb..b0c50ca 100644 --- a/examples/place_texture.gdshader +++ b/examples/place_texture.gdshader @@ -1,7 +1,7 @@ shader_type canvas_item; -#include "res://shaderlib/place_texture.gdshaderinc" -#include "res://shaderlib/common.gdshaderinc" +#include "./shaderlib/place_texture.gdshaderinc" +#include "./shaderlib/common.gdshaderinc" //!load ./images/swamp.jpg //!load+ img2 ./images/grass.png diff --git a/examples/project.godot b/examples/project.godot_ similarity index 100% rename from examples/project.godot rename to examples/project.godot_ diff --git a/examples/shaderlib b/examples/shaderlib new file mode 120000 index 0000000..dedec01 --- /dev/null +++ b/examples/shaderlib @@ -0,0 +1 @@ +../shaderlib \ No newline at end of file diff --git a/export_presets.cfg b/export_presets.cfg index 8b50959..4b10743 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -8,7 +8,7 @@ dedicated_server=false custom_features="" export_filter="all_resources" include_filter="" -exclude_filter="screenshot.png, examples/*, tools/*, build-template/*" +exclude_filter="screenshot.png, examples/*, shaderlib/*, tools/*, build-template/*" export_path="dist/Fragmented.x86_64" encryption_include_filters="" encryption_exclude_filters="" diff --git a/shaderlib/_DO_NOT_EDIT.txt b/shaderlib/_DO_NOT_EDIT.txt deleted file mode 100644 index d7fcd79..0000000 --- a/shaderlib/_DO_NOT_EDIT.txt +++ /dev/null @@ -1,10 +0,0 @@ -If you find this inside the project template, editing these gdshaderinc files -does nothing. They are already packed with the application and are only here -for you and the Godot Editor to read (auto complete and so on). - -If you want to change one of the files, copy it to another location, -edit it and #include it in your shader file. - -If you have questions, don't be shy, open a issue :) - -Have fun experimenting! \ No newline at end of file