Skip to content

Commit

Permalink
Merge pull request #49 from AlwinEsch/Leia-change
Browse files Browse the repository at this point in the history
Leia change
  • Loading branch information
AlwinEsch authored Oct 31, 2019
2 parents 8feb4f0 + 3f7db20 commit d01ce99
Show file tree
Hide file tree
Showing 22 changed files with 93 additions and 37 deletions.
18 changes: 15 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# build artifacts
build/
obj-x86_64-linux-gnu/
visualization.*/addon.xml

# Debian build files
debian/changelog
debian/files
debian/*.log
debian/*.substvars
debian/.debhelper/
debian/tmp/
debian/kodi-visualization-*/
obj-x86_64-linux-gnu/

# commonly used editors
# vim
*.swp
Expand All @@ -26,5 +35,8 @@ visualization.*/addon.xml
# clion
.idea/

# KDev
*.kdev4
# to prevent add after a "git format-patch VALUE" and "git add ." call
/*.patch

# to prevent add if project code opened by Visual Studio over CMake file
.vs/
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})

find_package(Kodi REQUIRED)
find_package(p8-platform REQUIRED)
find_package(glm REQUIRED)

add_subdirectory(lib/kissfft)

Expand Down Expand Up @@ -50,7 +51,6 @@ elseif(WIN32)
endif()

list(APPEND DEPLIBS kissfft)
list(APPEND DEPENDS glm)

build_addon(visualization.shadertoy SHADERTOY DEPLIBS)

Expand Down
6 changes: 0 additions & 6 deletions debian/changelog

This file was deleted.

2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
9
8 changes: 4 additions & 4 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Source: kodi-visualization-shadertoy
Priority: extra
Maintainer: wsnipex <wsnipex@a1.net>
Build-Depends: debhelper (>= 8.0.0), cmake, libp8-platform-dev, kodi-addon-dev,
libgl1-mesa-dev, libglm-dev
Standards-Version: 3.9.8
Maintainer: Nobody <nobody@kodi.tv>
Build-Depends: debhelper (>= 9.0.0), cmake, kodi-addon-dev, libglm-dev,
libgles2-mesa-dev [arm64 armhf], libgl1-mesa-dev [i386 amd64]
Standards-Version: 4.1.2
Section: libs
Homepage: http://kodi.tv

Expand Down
4 changes: 2 additions & 2 deletions debian/kodi-visualization-shadertoy.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
usr/lib
usr/share
usr/lib/*
usr/share/*
2 changes: 1 addition & 1 deletion depends/common/glm/glm.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7f093f11c49877716bab96813c2e834db6839095281c8c0c65c60c8bdb9504a3
b7c6c746bfee6c3e346b13fc92764e1088c358fc5d18294f575806bdeb05a1d2
2 changes: 1 addition & 1 deletion depends/common/glm/glm.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
glm https://github.com/g-truc/glm/archive/47031aa4b7b079716e4cac496819e7f464b6a713.tar.gz
glm https://github.com/g-truc/glm/releases/download/0.9.9.4/glm-0.9.9.4.7z
2 changes: 1 addition & 1 deletion depends/osx/glm/glm.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7f093f11c49877716bab96813c2e834db6839095281c8c0c65c60c8bdb9504a3
b7c6c746bfee6c3e346b13fc92764e1088c358fc5d18294f575806bdeb05a1d2
2 changes: 1 addition & 1 deletion depends/osx/glm/glm.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
glm https://github.com/g-truc/glm/archive/47031aa4b7b079716e4cac496819e7f464b6a713.tar.gz
glm https://github.com/g-truc/glm/releases/download/0.9.9.4/glm-0.9.9.4.7z
19 changes: 18 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ struct Preset
int channel[4];
};

// NOTE: With "#if defined(HAS_GL)" the use of some shaders is avoided
// as they can cause problems on weaker systems.
const std::vector<Preset> g_presets =
{
{"2D LED Spectrum by un1versal", "2Dspectrum.frag.glsl", 99, -1, -1, -1},
Expand All @@ -54,16 +56,22 @@ const std::vector<Preset> g_presets =
{"Beating Circles by Phoenix72", "beatingcircles.frag.glsl", 99, -1, -1, -1},
{"BPM by iq", "bpm.frag.glsl", 99, -1, -1, -1},
{"Circle Wave by TekF", "circlewave.frag.glsl", 99, -1, -1, -1},
#if defined(HAS_GL)
{"Circuits by Kali", "circuits.frag.glsl", 99, 7, -1, -1},
{"Colored Bars by novalis", "coloredbars.frag.glsl", 99, -1, -1, -1},
{"Cubescape by iq", "cubescape.frag.glsl", 99, 5, -1, -1},
#endif
{"Dancing Metalights by Danguafare", "dancingmetalights.frag.glsl", 99, -1, -1, -1},
{"The Disco Tunnel by poljere", "discotunnel.frag.glsl", 2, 13, 99, -1},
{"Electric pulse by un1versal", "electricpulse.frag.glsl", 99, -1, -1, -1},
#if defined(HAS_GL)
{"Fractal Land by Kali", "fractalland.frag.glsl", 2, 13, 99, -1},
#endif
{"Gameboy by iq", "gameboy.frag.glsl", 99, -1, -1, -1},
{"Input Sound by iq", "input.frag.glsl", 99, -1, -1, -1},
#if defined(HAS_GL)
{"I/O by movAX13h", "io.frag.glsl", 99, -1, -1, -1},
#endif
{"Kaleidoscope Visualizer by Qqwy", "kaleidoscopevisualizer.frag.glsl", 99, 15, -1, -1},
{"LED spectrum by simesgreen", "ledspectrum.frag.glsl", 99, -1, -1, -1},
{"Polar Beats by sauj123", "polarbeats.frag.glsl", 99, -1, -1, -1},
Expand All @@ -74,7 +82,9 @@ const std::vector<Preset> g_presets =
{"symmetrical sound visualiser by thelinked","symmetricalsound.frag.glsl", 99, -1, -1, -1},
{"Twisted Rings by poljere", "twistedrings.frag.glsl", 99, -1, -1, -1},
{"Undulant Spectre by mafik", "undulantspectre.frag.glsl", 99, -1, -1, -1},
#if defined(HAS_GL)
{"Demo - Volumetric Lines by iq", "volumetriclines.frag.glsl", 99, -1, -1, -1},
#endif
{"Waves Remix by ADOB", "wavesremix.frag.glsl", 99, -1, -1, -1}
};

Expand Down Expand Up @@ -163,6 +173,13 @@ uniform sampler2D iChannel3;
#ifndef texture
#define texture texture2D
#endif
#ifndef textureLod
vec4 textureLod(sampler2D sampler, vec2 uv, float lod)
{
return texture2D(sampler, uv, lod);
}
#endif
)shader";

std::string fsFooter =
Expand Down Expand Up @@ -487,7 +504,7 @@ void CVisualizationShadertoy::Launch(int preset)
// how many pixels get the desired fps
double pixels = (1000.0/expected_fps - A) / B;
m_state.fbwidth = sqrtf(pixels * Width() / Height());
if (m_state.fbwidth * 4 >= Width() * 3)
if (m_state.fbwidth >= Width())
m_state.fbwidth = 0;
else if (m_state.fbwidth < 320)
m_state.fbwidth = 320;
Expand Down
26 changes: 13 additions & 13 deletions src/maindx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,19 +758,19 @@ class CVisualizationShadertoy
, public kodi::addon::CInstanceVisualization
{
public:
virtual ~CVisualizationShadertoy();

virtual ADDON_STATUS Create() override;

virtual bool Start(int channels, int samplesPerSec, int bitsPerSample, std::string songName) override;
virtual void AudioData(const float* audioData, int audioDataLength, float* freqData, int freqDataLength) override;
virtual void Render() override;
virtual bool GetPresets(std::vector<std::string>& presets) override;
virtual int GetActivePreset() override;
virtual bool PrevPreset() override;
virtual bool NextPreset() override;
virtual bool LoadPreset(int select) override;
virtual bool RandomPreset() override;
~CVisualizationShadertoy() override;

ADDON_STATUS Create() override;

bool Start(int channels, int samplesPerSec, int bitsPerSample, std::string songName) override;
void AudioData(const float* audioData, int audioDataLength, float* freqData, int freqDataLength) override;
void Render() override;
bool GetPresets(std::vector<std::string>& presets) override;
int GetActivePreset() override;
bool PrevPreset() override;
bool NextPreset() override;
bool LoadPreset(int select) override;
bool RandomPreset() override;
};

//-- Render -------------------------------------------------------------------
Expand Down
15 changes: 13 additions & 2 deletions visualization.shadertoy/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="visualization.shadertoy"
version="1.2.2"
version="1.2.3"
name="Shadertoy"
provider-name="Team Kodi">
<requires>@ADDON_DEPENDS@</requires>
Expand All @@ -10,7 +10,18 @@
library_@PLATFORM@="@LIBRARY_FILENAME@"/>
<extension point="xbmc.addon.metadata">
<summary lang="en">Visualisations from Shadertoy</summary>
<description lang="en">Visualisations from Shadertoy</description>
<description lang="en">This music visualization is based on Shadertoy based GPU programs.</description>
<platform>@PLATFORM@</platform>
<assets>
<icon>resources/icon.png</icon>
<fanart>resources/fanart.jpg</fanart>
<screenshot>resources/screenshot-01.jpg</screenshot>
<screenshot>resources/fanart.jpg</screenshot>
<screenshot>resources/screenshot-02.jpg</screenshot>
<screenshot>resources/screenshot-03.jpg</screenshot>
<screenshot>resources/screenshot-04.jpg</screenshot>
<screenshot>resources/screenshot-05.jpg</screenshot>
<screenshot>resources/screenshot-06.jpg</screenshot>
</assets>
</extension>
</addon>
22 changes: 22 additions & 0 deletions visualization.shadertoy/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
[B]1.2.3[/B]
- Update Debian package creation
- Remove not needed "virtual" on windows related code
- Update glm on depends to version 0.9.9.5
- Add screenshots and fanart images to see what it brings
- Update description text
- Use reduced size always if calculation is lower as screen size
- Prevent some shaders on GLES (can freeze on weak systems)

[B]1.2.2[/B]
- Fix debian packaging

[B]1.2.1[/B]
- On code override GL_RED (if not present) with GL_LUMINANCE (needed on older GLES versions)
- AppVeyor: Use Visual Studio 2017 & add WindowsStore

[B]1.2.0[/B]
- Update build system version and cleanup
- Bring in GL 4.0 support
- Update shader files with a revised copy to a new OpenGL-related folder
- Remove old for Windows not supported shader files

[B]1.1.9[/B]
- Save last used preset

Expand Down
Binary file added visualization.shadertoy/resources/fanart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d01ce99

Please sign in to comment.