From fc63ac2c16918ffa1d3384cddfba2bbc70650bb4 Mon Sep 17 00:00:00 2001 From: Lynn Jarvis Date: Thu, 29 Aug 2024 14:36:04 +0930 Subject: [PATCH] Remove VS files VS2017/VS2022 projects replaced by CMake build Remove unused shaders class --- SPOUTSDK/SpoutGL/SpoutShaders.cpp | 304 -------------- SPOUTSDK/SpoutGL/SpoutShaders.h | 383 ------------------ SPOUTSDK/SpoutGL/VS2017/SpoutSDK.sln | 31 -- SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj | 206 ---------- SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj.user | 4 - SPOUTSDK/SpoutGL/VS2022/SpoutSDK.sln | 31 -- SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj | 206 ---------- SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj.user | 4 - 8 files changed, 1169 deletions(-) delete mode 100644 SPOUTSDK/SpoutGL/SpoutShaders.cpp delete mode 100644 SPOUTSDK/SpoutGL/SpoutShaders.h delete mode 100644 SPOUTSDK/SpoutGL/VS2017/SpoutSDK.sln delete mode 100644 SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj delete mode 100644 SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj.user delete mode 100644 SPOUTSDK/SpoutGL/VS2022/SpoutSDK.sln delete mode 100644 SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj delete mode 100644 SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj.user diff --git a/SPOUTSDK/SpoutGL/SpoutShaders.cpp b/SPOUTSDK/SpoutGL/SpoutShaders.cpp deleted file mode 100644 index 91cee20c..00000000 --- a/SPOUTSDK/SpoutGL/SpoutShaders.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* - SpoutShaders.cpp - - Functions to manage compute shaders - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copyright (c) 2016-2023, Lynn Jarvis. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ======================== - - 14.07.23 - first version - -*/ - -#include "spoutShaders.h" - -// -// Class: spoutShaders -// -// Functions to manage compute shaders -// - -spoutShaders::spoutShaders() { - -} - - -spoutShaders::~spoutShaders() { - - if (m_copyProgram > 0) glDeleteProgram(m_copyProgram); - if (m_brcosaProgram > 0) glDeleteProgram(m_brcosaProgram); - if (m_sharpenProgram > 0) glDeleteProgram(m_sharpenProgram); - if (m_hBlurProgram > 0) glDeleteProgram(m_hBlurProgram); - if (m_vBlurProgram > 0) glDeleteProgram(m_vBlurProgram); - if (m_kuwaharaProgram > 0) glDeleteProgram(m_kuwaharaProgram); - -} - -//--------------------------------------------------------- -// Function: CopyTexture -// -// OpenGL texture copy using compute shader -// bInvert - flip image -// bSwap - swap red/blue (RGBA/BGRA) -// Approximately X2 faster than FBO blit -// Textures must have the same size and internal format type GL_RGBA/GL_BGRA/GL_RGBA8 -// Texture targets can be different, GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB -// Cannot be used with GL/DX interop -bool spoutShaders::Copy(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, bool bInvert, bool bSwap) -{ - return ComputeShader(m_copystr, m_copyProgram, SourceID, DestID, - width, height, bInvert, bSwap); -} - - -//--------------------------------------------------------- -// Function: Flip -// Flip image in place -bool spoutShaders::Flip(GLuint SourceID, unsigned int width, unsigned int height, bool bSwap) -{ - return ComputeShader(m_flipstr, m_flipProgram, SourceID, 0, width, height, bSwap); -} - -//--------------------------------------------------------- -// Function: Mirror -// Mirror image in place -bool spoutShaders::Mirror(GLuint SourceID, unsigned int width, unsigned int height, bool bSwap) -{ - return ComputeShader(m_mirrorstr, m_mirrorProgram, SourceID, 0, width, height); -} -//--------------------------------------------------------- -// Function: Swap -// Texture swap RGBA <> BGRA -bool spoutShaders::Swap(GLuint SourceID, unsigned int width, unsigned int height) -{ - return ComputeShader(m_swapstr, m_swapProgram, SourceID, 0, width, height); -} - - -//--------------------------------------------------------- -// Function: Adjust -// Brightness, contrast, saturation, gamma -// brightness -1 > 1 -// contrast 0 > 1 -// saturation 0 > 1 -// gamma 0 > 1 -bool spoutShaders::Adjust(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, - float brightness, float contrast, - float saturation, float gamma) -{ - return ComputeShader(m_brcosastr, m_brcosaProgram, SourceID, DestID, - width, height, brightness, contrast, saturation, gamma); -} - -//--------------------------------------------------------- -// Function: Sharpen -// Sharpen using unsharp mask -// sharpenWidth - 1 3x3, 2 5x5, 3 7x7 -// sharpenStrength - 1 - 3 typical -bool spoutShaders::Sharpen(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, - float sharpenWidth, float sharpenStrength) -{ - return ComputeShader(m_sharpenstr, m_sharpenProgram, - SourceID, DestID, width, height, sharpenWidth, sharpenStrength); -} - -//--------------------------------------------------------- -// Function: Blur -// Two pass Gaussian blur -// amount - 1 - 4 typical -bool spoutShaders::Blur(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, float amount) -{ - // Horizontal blur - if (ComputeShader(m_hblurstr, m_hBlurProgram, SourceID, DestID, width, height, amount)) { - // Vertical blur on Horizontal blur result - return ComputeShader(m_vblurstr, m_vBlurProgram, SourceID, DestID, width, height, amount); - } - return false; -} - -//--------------------------------------------------------- -// Function: Kuwahara -// Kuwahara filter -// amount - 1 - 4 typical -bool spoutShaders::Kuwahara(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, float amount) -{ - /* - // Load shader from file for debugging - if (m_kuwaharastr.empty()) { - char exepath[MAX_PATH]={}; - GetModuleFileNameA(NULL, exepath, MAX_PATH); - PathRemoveFileSpecA(exepath); - strcat_s(exepath, "\\data\\shaders\\kuwahara.txt"); - m_kuwaharastr = GetFileString(exepath); - // printf("%s\n", m_kuwaharastr.c_str()); - } - */ - return ComputeShader(m_kuwaharastr, m_kuwaharaProgram, - SourceID, DestID, width, height, amount); -} - -//--------------------------------------------------------- -// Function: ComputeShader -// Apply compute shader on source to dest -// or to read/write source with provided uniforms -bool spoutShaders::ComputeShader(std::string shaderstr, GLuint &program, - GLuint SourceID, GLuint DestID, unsigned int width, unsigned int height, - float uniform0, float uniform1, float uniform2, float uniform3) -{ - if (shaderstr.empty() || SourceID == 0) - return false; - - // The number of Y and Y work groups should match image width and height - // Default size 32x32, adjust for aspect ratio - unsigned int nWgX = width / (unsigned int)ceil((float)width / 32.0f); - unsigned int nWgY = nWgX * height / width; - - if (program == 0) { - program = CreateComputeShader(shaderstr, nWgX, nWgY); - if (program == 0) - return false; - } - - glUseProgram(program); - glBindImageTexture(0, SourceID, 0, GL_FALSE, 0, GL_READ_WRITE, GL_RGBA8); - if(DestID > 0) - glBindImageTexture(1, DestID, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA8); - if (uniform0 != -1.0) glUniform1f(0, uniform0); - if (uniform1 != -1.0) glUniform1f(1, uniform1); - if (uniform2 != -1.0) glUniform1f(2, uniform2); - if (uniform3 != -1.0) glUniform1f(3, uniform3); - glDispatchCompute(width / nWgX, height / nWgY, 1); - glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT); - glBindImageTexture(0, 0, 0, GL_FALSE, 0, GL_READ_WRITE, GL_RGBA8); - glBindImageTexture(1, 0, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_RGBA8); - glUseProgram(0); - - return true; - -} - -//--------------------------------------------------------- -// Function: CreateComputeShader -// Create compute shader from a source string -unsigned int spoutShaders::CreateComputeShader(std::string shader, unsigned int nWgX, unsigned int nWgY) -{ - // Compute shaders are only supported since openGL 4.3 - int major = 0; - int minor = 0; - glGetIntegerv(GL_MAJOR_VERSION, &major); - glGetIntegerv(GL_MINOR_VERSION, &minor); - float version = (float)major + (float)minor / 10.0f; - if (version < 4.3f) { - SpoutLogError("CreateComputeShader - OpenGL version > 4.3 required"); - return 0; - } - - // - // Compute shader source initialized in header - // See also GetFileString for testing - // - - // Common - std::string shaderstr = "#version 440\n"; - shaderstr += "layout(local_size_x = "; - shaderstr += std::to_string(nWgX); - shaderstr += ", local_size_y = "; - shaderstr += std::to_string(nWgY); - shaderstr += ", local_size_z = 1) in;\n"; - - // Full shader string - shaderstr += shader; - - // Create the compute shader program - GLuint computeProgram = glCreateProgram(); - if (computeProgram > 0) { - GLuint computeShader = glCreateShader(GL_COMPUTE_SHADER); - if (computeShader > 0) { - // Compile and link shader - GLint status = 0; - const char* source = shaderstr.c_str(); - glShaderSource(computeShader, 1, &source, NULL); - glCompileShader(computeShader); - glAttachShader(computeProgram, computeShader); - glLinkProgram(computeProgram); - glGetProgramiv(computeProgram, GL_LINK_STATUS, &status); - if (status == 0) { - SpoutLogError("CreateComputeShader - glGetProgramiv failed"); - glDetachShader(computeProgram, computeShader); - glDeleteProgram(computeShader); - glDeleteProgram(computeProgram); - } - else { - // After linking, the shader object is not needed - glDeleteShader(computeShader); - return computeProgram; - } - } - else { - SpoutLogError("CreateComputeShader - glCreateShader failed"); - return 0; - } - } - SpoutLogError("CreateComputeShader - glCreateProgram failed"); - return 0; -} - - -//--------------------------------------------------------- -// Function: GetFileString -// Load complete shader source from file -// Used for development. -std::string spoutShaders::GetFileString(const char* filepath) -{ - if (!filepath || !*filepath) return ""; - - std::string path = filepath; - std::string logstr = ""; - - if (!path.empty()) { - // Does the file exist - if (_access(path.c_str(), 0) != -1) { - // Open the file - std::ifstream logstream(path); - // File loaded OK ? - if (logstream.is_open()) { - // Get the file text as a single string - logstr.assign((std::istreambuf_iterator< char >(logstream)), std::istreambuf_iterator< char >()); - logstr += ""; // ensure a NULL terminator - logstream.close(); - } - } - else { - SpoutLogError("GetFileString [%s] not found", path.c_str()); - } - } - return logstr; -} - diff --git a/SPOUTSDK/SpoutGL/SpoutShaders.h b/SPOUTSDK/SpoutGL/SpoutShaders.h deleted file mode 100644 index 0a296d76..00000000 --- a/SPOUTSDK/SpoutGL/SpoutShaders.h +++ /dev/null @@ -1,383 +0,0 @@ -/* - - SpoutShaders.h - - Functions to manage compute shaders - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copyright (c) 2016-2023, Lynn Jarvis. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -#pragma once -#ifndef __spoutShaders__ -#define __spoutShaders__ - -#include -#include "SpoutGLextensions.h" -#include "SpoutCommon.h" -#include "SpoutUtils.h" - -using namespace spoututils; - -class SPOUT_DLLEXP spoutShaders { - - public: - - spoutShaders(); - ~spoutShaders(); - - // Texture copy - bool Copy(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, - bool bInvert = false, bool swap = false); - - // Flip image in place - bool Flip(GLuint SourceID, unsigned int width, unsigned int height, bool bSwap = false); - - // Mirror image in place - bool Mirror(GLuint SourceID, unsigned int width, unsigned int height, bool bSwap = false); - - // Swap RGBA <> BGRA - bool Swap(GLuint SourceID, unsigned int width, unsigned int height); - - // Image adjust - brightness, contrast, saturation, gamma - bool Adjust(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, - float brightness, float contrast, - float saturation, float gamma); - - // Unsharp mask sharpen - bool Sharpen(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, - float sharpenWidth, float sharpenStrength); - - // Gaussian blur - bool Blur(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, float amount); - - // Kuwahara - bool Kuwahara(GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, float amount); - - GLuint m_copyProgram = 0; - GLuint m_flipProgram = 0; - GLuint m_mirrorProgram = 0; - GLuint m_swapProgram = 0; - - GLuint m_brcosaProgram = 0; - float m_brightness = 0.0f; // -1 > 1 - float m_contrast = 1.0f; // 0 > 1 - float m_saturation = 1.0f; // 0 > 1 - float m_gamma = 1.0f; // 0 > 1 - - GLuint m_sharpenProgram = 0; - float m_sharpWidth = 1.0f; // 1=3x3, 2=5x5, 3=7x7 - float m_sharpStrength = 1.0f; // 1 > 3 typical - - GLuint m_hBlurProgram = 0; - GLuint m_vBlurProgram = 0; - float m_blurAmount = 0.0f; // 1 > 4 typical - - GLuint m_kuwaharaProgram = 0; - float m_kuwaharaAmount = 0.0f; // 1 > 4 typical - - protected : - - bool ComputeShader(std::string shader, GLuint &program, - GLuint SourceID, GLuint DestID, - unsigned int width, unsigned int height, - float uniform0 = -1.0, float uniform1 = -1.0, - float uniform2 = -1.0, float uniform3 = -1.0); - GLuint CreateComputeShader(std::string shader, unsigned int nWgX, unsigned int nWgY); - std::string GetFileString(const char* filepath); - - // - // Shader source - // - - // - // Texture copy - // - std::string m_copystr = "layout(rgba8, binding=0) uniform readonly image2D src;\n" - "layout(rgba8, binding=1) uniform writeonly image2D dst;\n" - "layout (location = 0) uniform bool flip;\n" - "layout (location = 1) uniform bool swap;\n" - "void main() {\n" - "vec4 c = imageLoad(src, ivec2(gl_GlobalInvocationID.xy));\n" - "uint ypos = gl_GlobalInvocationID.y;\n" - "if(flip) ypos = imageSize(src).y-ypos;\n" // Flip image option - // Texture copy with output alpha = 1 - "if(swap) {\n" // Swap RGBA<>BGRA option - " imageStore(dst, ivec2(gl_GlobalInvocationID.x, ypos), vec4(c.b,c.g,c.r,c.a));\n" - "}\n" - "else {\n" - " imageStore(dst, ivec2(gl_GlobalInvocationID.x, ypos), vec4(c.r,c.g,c.b,c.a));\n" - "}\n" - "}"; - - // - // Flip in place - // - std::string m_flipstr = "layout(rgba8, binding=0) uniform image2D src;\n" - "layout (location = 0) uniform bool swap;\n" - "void main() {\n" - "if(gl_GlobalInvocationID.y > imageSize(src).y/2)\n" // Half image - " return;\n" - "uint ypos = imageSize(src).y-gl_GlobalInvocationID.y;\n" // Flip y position - "vec4 c0 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy));\n" // This pixel - "vec4 c1 = imageLoad(src, ivec2(gl_GlobalInvocationID.x, ypos));\n" // Flip pixel - "if (swap) {\n" // Swap RGBA<>BGRA option - "c0 = vec4(c0.b, c0.g, c0.r, c0.a);\n" - "c1 = vec4(c1.b, c1.g, c1.r, c1.a);\n" - "}\n" - "imageStore(src, ivec2(gl_GlobalInvocationID.x, ypos), c0);\n" // Move this pixel to flip position - "imageStore(src, ivec2(gl_GlobalInvocationID.xy), c1);\n" // Move flip pixel to this position - "}"; - - // - // Mirror in place - // - std::string m_mirrorstr = "layout(rgba8, binding=0) uniform image2D src;\n" - "layout (location = 0) uniform bool swap;\n" - "void main() {\n" - "if(gl_GlobalInvocationID.x > imageSize(src).x/2)\n" - " return;\n" - "uint xpos = imageSize(src).x-gl_GlobalInvocationID.x;\n" - "vec4 c0 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy));\n" - "vec4 c1 = imageLoad(src, ivec2(xpos, gl_GlobalInvocationID.y));\n" - "if (swap) {\n" - "c0 = vec4(c0.b, c0.g, c0.r, c0.a);\n" - "c1 = vec4(c1.b, c1.g, c1.r, c1.a);\n" - "}\n" - "imageStore(src, ivec2(xpos, gl_GlobalInvocationID.y), c0);\n" - "imageStore(src, ivec2(gl_GlobalInvocationID.xy), c1);\n" - "}"; - - // - // Swap RGBA <> BGRA - // - std::string m_swapstr = "layout(rgba8, binding=0) uniform image2D src;\n" - "void main() {\n" - "vec4 c0 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy));\n" - "imageStore(src, ivec2(gl_GlobalInvocationID.xy), vec4(c0.b, c0.g, c0.r, c0.a));\n" - "}"; - - // - // Adjust - brightness, contrast, saturation, gamma - // - std::string m_brcosastr = "layout(rgba8, binding=0) uniform image2D src;\n" // Read/Write - "layout(rgba8, binding=1) uniform writeonly image2D dst;\n" // Write only - "layout(location = 0) uniform float brightness;\n" - "layout(location = 1) uniform float contrast;\n" - "layout(location = 2) uniform float saturation;\n" - "layout(location = 3) uniform float gamma;\n" - "\n" - "void main() {\n" - "\n" - "vec4 c1 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy)); // rgba\n" - "\n" - // Gamma (0 > 10) default 1 - "vec3 c2 = pow(c1.rgb, vec3(1.0 / gamma)); // rgb\n" - "\n" - // Saturation (0 > 3) default 1 - "float luminance = dot(c2, vec3(0.2125, 0.7154, 0.0721)); // weights sum to 1\n" - "c2 = mix(vec3(luminance), c2, vec3(saturation));\n" - "\n" - // Contrast (0 > 2) default - "c2 = (c2 - 0.5) * contrast + 0.5;\n" - "\n" - // Brightness (-1 > 1) default 0 - "c2 += brightness;\n" - "\n" - // Output with original alpha - "imageStore(dst, ivec2(gl_GlobalInvocationID.xy), vec4(c2, c1.a)); \n" - "}\n"; - - // - // Sharpen - unsharp mask - // - std::string m_sharpenstr = "layout(rgba8, binding=0) uniform image2D src;\n" - "layout(rgba8, binding=1) uniform writeonly image2D dst;\n" - "layout(location = 0) uniform float width;\n" - "layout(location = 1) uniform float strength;\n" - "\n" - "void main() {\n" - "\n" - // Original pixel - "vec4 orig = imageLoad(src, ivec2(gl_GlobalInvocationID.xy)); // rgba\n" - "\n" - // Get the blur neighbourhood - "float dx = width;\n" - "float dy = width;\n" - "\n" - "vec4 c1 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(-dx, -dy));\n" - "vec4 c2 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, -dy));\n" - "vec4 c3 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(dx, -dy));\n" - "vec4 c4 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(-dx, 0.0));\n" - "vec4 c5 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(dx, 0.0));\n" - "vec4 c6 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(-dx, dy));\n" - "vec4 c7 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, dy));\n" - "vec4 c8 = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(dx, dy));\n" - "\n" - // Gaussian blur filter - // [ 1, 2, 1 ] - // [ 2, 4, 2 ] - // [ 1, 2, 1 ] - // c1 c2 c3 - // c4 c5 - // c6 c7 c8 - "vec4 blur = ((c1 + c3 + c6 + c8) + 2.0 * (c2 + c4 + c5 + c7) + 4.0 * orig) / 16.0;\n" - // Subtract the blurred image from the original image - "vec4 coeff_blur = vec4(strength);\n" - "vec4 coeff_orig = vec4(1.0) + coeff_blur;\n" - "vec4 c9 = coeff_orig * orig - coeff_blur * blur;\n" - "\n" - // Output - "imageStore(dst, ivec2(gl_GlobalInvocationID.xy), c9);\n" - "}\n"; - - // - // Gaussian blur - // Adapted from Openframeworks "09_gaussianBlurFilter" example - // https://openframeworks.cc/ - // - - // - // Horizontal Gaussian blur - // - std::string m_hblurstr = "layout(rgba8, binding=0) uniform image2D src;\n" - "layout(rgba8, binding=1) uniform writeonly image2D dst;\n" - "layout(location = 0) uniform float amount;\n" - "\n" - "void main() {\n" - "\n" - "vec4 c1 = 0.000229 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(amount*-4.0, 0.0));\n" - "vec4 c2 = 0.005977 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(amount*-3.0, 0.0));\n" - "vec4 c3 = 0.060598 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(amount*-2.0, 0.0));\n" - "vec4 c4 = 0.241732 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(amount*-1.0, 0.0));\n" - "vec4 c5 = 0.382928 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, 0.0));\n" - "vec4 c6 = 0.241732 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(amount*1.0, 0.0));\n" - "vec4 c7 = 0.060598 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(amount*2.0, 0.0));\n" - "vec4 c8 = 0.005977 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(amount*3.0, 0.0));\n" - "vec4 c9 = 0.000229 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(amount*4.0, 0.0));\n" - "\n" - // Output - "imageStore(dst, ivec2(gl_GlobalInvocationID.xy), (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9));\n" - "\n" - "}\n"; - - // - // Vertical Gaussian blur - // - std::string m_vblurstr = "layout(rgba8, binding=0) uniform image2D src;\n" - "layout(rgba8, binding=1) uniform writeonly image2D dst;\n" - "layout(location = 0) uniform float amount;\n" - "\n" - "void main() {\n" - "\n" - "vec4 c1 = 0.000229 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, amount*-4.0));\n" - "vec4 c2 = 0.005977 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, amount*-3.0));\n" - "vec4 c3 = 0.060598 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, amount*-2.0));\n" - "vec4 c4 = 0.241732 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, amount*-1.0));\n" - "vec4 c5 = 0.382928 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, 0.0));\n" - "vec4 c6 = 0.241732 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, amount*1.0));\n" - "vec4 c7 = 0.060598 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, amount*2.0));\n" - "vec4 c8 = 0.005977 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, amount*3.0));\n" - "vec4 c9 = 0.000229 * imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(0.0, amount*4.0));\n" - "\n" - // Output - "imageStore(dst, ivec2(gl_GlobalInvocationID.xy), (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9));\n" - "\n" - "}\n"; - - - // - // Kuwahara effect - // Adapted from : Jan Eric Kyprianidis (http://www.kyprianidis.com/) - // - std::string m_kuwaharastr = "layout(rgba8, binding=0) uniform image2D src;\n" - "layout(rgba8, binding=1) uniform writeonly image2D dst;\n" - "layout(location = 0) uniform float radius;\n" - "\n" - "void main() {\n" - "\n" - " vec3 m[4];\n" - " vec3 s[4];\n" - " for (int j = 0; j < 4; ++j) {\n" - " m[j] = vec3(0.0);\n" - " s[j] = vec3(0.0);\n" - " }\n" - "\n" - " vec3 c;\n" - " int ir = int(floor(radius));\n" - " for (int j = -ir; j <= 0; ++j) {\n" - " for (int i = -ir; i <= 0; ++i) {\n" - " c = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(i, j)).rgb;\n" - " m[0] += c;\n" - " s[0] += c * c;\n" - " }\n" - " }\n" - "\n" - " for (int j = -ir; j <= 0; ++j) {\n" - " for (int i = 0; i <= ir; ++i) {\n" - " c = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(i, j)).rgb;\n" - " m[1] += c;\n" - " s[1] += c * c;\n" - " }\n" - " }\n" - "\n" - " for (int j = 0; j <= ir; ++j) {\n" - " for (int i = 0; i <= ir; ++i) {\n" - " c = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(i, j)).rgb;\n" - " m[2] += c;\n" - " s[2] += c * c;\n" - " }\n" - " }\n" - "\n" - " for (int j = 0; j <= ir; ++j) {\n" - " for (int i = -ir; i <= 0; ++i) {\n" - " c = imageLoad(src, ivec2(gl_GlobalInvocationID.xy) + ivec2(i, j)).rgb;\n" - " m[3] += c;\n" - " s[3] += c * c;\n" - " }\n" - " }\n" - "\n" - " float min_sigma2 = 1e+2;\n" - " float n = float((radius+1)*(radius+1));\n" - " for (int k = 0; k < 4; ++k) {\n" - " m[k] /= n;\n" - " s[k] = abs(s[k] / n - m[k] * m[k]);\n" - " float sigma2 = s[k].r + s[k].g + s[k].b;\n" - " if (sigma2 < min_sigma2) {\n" - " min_sigma2 = sigma2;\n" - " imageStore(dst, ivec2(gl_GlobalInvocationID.xy), vec4(m[k], 1.0));\n" - " }\n" - " }\n" - "}\n"; - - // ============================================================ - -}; - -#endif diff --git a/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.sln b/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.sln deleted file mode 100644 index 10297cd9..00000000 --- a/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.1300 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpoutSDK", "SpoutSDK.vcxproj", "{62631E0D-AB94-4E97-AF8B-63E7E108C30E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Debug|x64.ActiveCfg = Debug|x64 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Debug|x64.Build.0 = Debug|x64 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Debug|x86.ActiveCfg = Debug|Win32 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Debug|x86.Build.0 = Debug|Win32 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Release|x64.ActiveCfg = Release|x64 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Release|x64.Build.0 = Release|x64 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Release|x86.ActiveCfg = Release|Win32 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {F9FD126F-7195-4BD7-9469-19DF3EA097C0} - EndGlobalSection -EndGlobal diff --git a/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj b/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj deleted file mode 100644 index 31c5e20d..00000000 --- a/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj +++ /dev/null @@ -1,206 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {62631E0D-AB94-4E97-AF8B-63E7E108C30E} - Win32Proj - SpoutSDK - 10.0.17763.0 - - - - DynamicLibrary - true - MultiByte - v141 - - - DynamicLibrary - true - MultiByte - v141 - - - DynamicLibrary - false - true - MultiByte - v141 - - - DynamicLibrary - false - true - MultiByte - v141 - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - Spout - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - Spout - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - Spout - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - Spout - - - - - - Level3 - Disabled - SPOUT_BUILD_DLL;WIN32;_DEBUG;_WINDOWS;_USRDLL;SPOUTSDK_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - - - Level3 - Disabled - SPOUT_BUILD_DLL;WIN32;_DEBUG;_WINDOWS;_USRDLL;SPOUTSDK_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - Level3 - - - MaxSpeed - true - true - SPOUT_BUILD_DLL;WIN32;NDEBUG;_WINDOWS;_USRDLL;SPOUTSDK_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - %(AdditionalIncludeDirectories) - - - Windows - false - true - true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) - - - copy /y /v $(OutDir)$(TargetName).dll "..\Binaries\Win32\" -copy /y /v $(OutDir)$(TargetName).lib "..\Binaries\Win32\" - - - - - - Level3 - - - MaxSpeed - true - true - SPOUT_BUILD_DLL;WIN32;NDEBUG;_WINDOWS;_USRDLL;SPOUTSDK_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - %(AdditionalIncludeDirectories) - - - Windows - true - true - true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) - - - copy /y /v $(OutDir)$(TargetName).dll "..\Binaries\x64\" -copy /y /v $(OutDir)$(TargetName).lib "..\Binaries\x64\" - - - - - - \ No newline at end of file diff --git a/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj.user b/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj.user deleted file mode 100644 index be250787..00000000 --- a/SPOUTSDK/SpoutGL/VS2017/SpoutSDK.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.sln b/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.sln deleted file mode 100644 index 10297cd9..00000000 --- a/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.1300 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpoutSDK", "SpoutSDK.vcxproj", "{62631E0D-AB94-4E97-AF8B-63E7E108C30E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Debug|x64.ActiveCfg = Debug|x64 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Debug|x64.Build.0 = Debug|x64 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Debug|x86.ActiveCfg = Debug|Win32 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Debug|x86.Build.0 = Debug|Win32 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Release|x64.ActiveCfg = Release|x64 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Release|x64.Build.0 = Release|x64 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Release|x86.ActiveCfg = Release|Win32 - {62631E0D-AB94-4E97-AF8B-63E7E108C30E}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {F9FD126F-7195-4BD7-9469-19DF3EA097C0} - EndGlobalSection -EndGlobal diff --git a/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj b/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj deleted file mode 100644 index e2d0c443..00000000 --- a/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj +++ /dev/null @@ -1,206 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {62631E0D-AB94-4E97-AF8B-63E7E108C30E} - Win32Proj - SpoutSDK - 10.0 - - - - DynamicLibrary - true - MultiByte - v143 - - - DynamicLibrary - true - MultiByte - v143 - - - DynamicLibrary - false - true - MultiByte - v143 - - - DynamicLibrary - false - true - MultiByte - v143 - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - Spout - - - true - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - Spout - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - Spout - - - false - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - Spout - - - - - - Level3 - Disabled - SPOUT_BUILD_DLL;WIN32;_DEBUG;_WINDOWS;_USRDLL;SPOUTSDK_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - - - Level3 - Disabled - SPOUT_BUILD_DLL;WIN32;_DEBUG;_WINDOWS;_USRDLL;SPOUTSDK_EXPORTS;%(PreprocessorDefinitions) - - - Windows - true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - Level3 - - - MaxSpeed - true - true - SPOUT_BUILD_DLL;WIN32;NDEBUG;_WINDOWS;_USRDLL;SPOUTSDK_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - %(AdditionalIncludeDirectories) - - - Windows - false - true - true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) - - - copy /y /v $(OutDir)$(TargetName).dll "..\Binaries\Win32\" -copy /y /v $(OutDir)$(TargetName).lib "..\Binaries\Win32\" - - - - - - Level3 - - - MaxSpeed - true - true - SPOUT_BUILD_DLL;WIN32;NDEBUG;_WINDOWS;_USRDLL;SPOUTSDK_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - %(AdditionalIncludeDirectories) - - - Windows - true - true - true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) - - - copy /y /v $(OutDir)$(TargetName).dll "..\Binaries\x64\" -copy /y /v $(OutDir)$(TargetName).lib "..\Binaries\x64\" - - - - - - \ No newline at end of file diff --git a/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj.user b/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj.user deleted file mode 100644 index be250787..00000000 --- a/SPOUTSDK/SpoutGL/VS2022/SpoutSDK.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file