diff --git a/Examples/3D modeller/Modeller3D b/Examples/3D modeller/Modeller3D deleted file mode 100755 index 4fb0ddf..0000000 Binary files a/Examples/3D modeller/Modeller3D and /dev/null differ diff --git a/Examples/3D modeller/assets/shaders/fs1.glsl b/Examples/3D modeller/assets/shaders/fs1.glsl index da8b0c2..c574795 100644 --- a/Examples/3D modeller/assets/shaders/fs1.glsl +++ b/Examples/3D modeller/assets/shaders/fs1.glsl @@ -1,12 +1,13 @@ -//precision highp float; // Set the default precision to medium +#version 310 es +precision mediump float; // Set the default precision to medium uniform sampler2D u_Texture; // texture -varying vec2 v_UV; // Texture UV coordinate -varying vec4 v_diffuseColour; // Diffuse colour -varying vec4 v_fogColour; // Fog colour - +in vec2 v_UV; // Texture UV coordi_nate +in vec4 v_diffuseColour; // Diffuse colour +in vec4 v_fogColour; // Fog colour +out vec4 FragColor; void main() { - vec4 col = texture2D(u_Texture, v_UV) * v_diffuseColour + v_fogColour; - if (col.a > 0.01) gl_FragColor = col; else discard; + vec4 col = texture(u_Texture, v_UV) * v_diffuseColour + v_fogColour; + if (col.a > 0.01) FragColor = col; else discard; } diff --git a/Examples/3D modeller/assets/shaders/vs1.glsl b/Examples/3D modeller/assets/shaders/vs1.glsl index b57eb00..112aa6a 100644 --- a/Examples/3D modeller/assets/shaders/vs1.glsl +++ b/Examples/3D modeller/assets/shaders/vs1.glsl @@ -1,10 +1,11 @@ -//precision highp float; // Set the default precision to medium. We don't need as high of a +#version 310 es +precision mediump float; // Set the default precision to medium uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. -uniform vec3 u_LightPos; // The position of the light in eye space. -uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform vec3 u_LightPos; // The position of the light i_n eye space. +uniform vec4 u_lightColour; // The colour of light i_n eye space. +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -15,17 +16,17 @@ uniform vec4 u_specularColour; uniform vec3 u_fogColour; uniform float u_fogMaxDist; -uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogMinDist) -uniform float u_col32; // a floating point representing RGB +uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogM_i_nDist) +uniform float u_col32; // a floating poi_nt representi_ng RGB -attribute vec3 a_Position; -attribute vec3 a_Normal; -attribute vec2 a_UV; -attribute float a_Colour; +in vec3 a_Position; +in vec3 a_Normal; +in vec2 a_UV; +in float a_Colour; -varying vec2 v_UV; -varying vec4 v_diffuseColour; -varying vec4 v_fogColour; +out vec2 v_UV; +out vec4 v_diffuseColour; +out vec4 v_fogColour; //varying vec3 v_Normal; ///varying vec3 v_LightPos; @@ -49,16 +50,16 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour vec4 ambcol = u_ambientColour; //vec4(0,0,0,0); - //vec4 diffuseCol = vec4(u_diffuseColour.rgb * max(u_lightColour.rgb, u_emissiveColour.rgb*(1.0-fogFactor)), u_diffuseColour.a); - vec4 diffuseCol = u_diffuseColour * emitColour * col; + vec4 diffuseCol = vec4(u_diffuseColour.rgb * max(u_lightColour.rgb, u_emissiveColour.rgb*(1.0-fogFactor)), u_diffuseColour.a); + //vec4 diffuseCol = u_diffuseColour * emitColour * col; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.3); //0.1 fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/3D modeller/makefile b/Examples/3D modeller/makefile index 3890be8..dbe7c80 100644 --- a/Examples/3D modeller/makefile +++ b/Examples/3D modeller/makefile @@ -2,7 +2,7 @@ TARGET = Modeller3D CC = g++ CFLAGS = -std=c++17 -Wall -Wno-switch -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -26,7 +26,7 @@ CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(EDIT_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source diff --git a/Examples/Blocks/Blocks b/Examples/Blocks/Blocks deleted file mode 100755 index cbf305a..0000000 Binary files a/Examples/Blocks/Blocks and /dev/null differ diff --git a/Examples/Blocks/assets/shaders/vs1.glsl b/Examples/Blocks/assets/shaders/vs1.glsl index d9ca17b..685bb19 100644 --- a/Examples/Blocks/assets/shaders/vs1.glsl +++ b/Examples/Blocks/assets/shaders/vs1.glsl @@ -4,7 +4,7 @@ uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. uniform vec3 u_LightPos; // The position of the light in eye space. uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -49,7 +49,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -58,7 +58,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour * col; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.1); fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/Blocks/makefile b/Examples/Blocks/makefile index 68f0745..3660dcc 100644 --- a/Examples/Blocks/makefile +++ b/Examples/Blocks/makefile @@ -2,7 +2,7 @@ TARGET = Blocks CC = g++ CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lGLU -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lGLU -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -26,7 +26,7 @@ CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) SRC_DIR:= $(RJSON_DIR) $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(EDIT_DIR) $(TESS_DIR) $(GLES_DIR) $(FBX_DIR) $(GLTF_DIR) source diff --git a/Examples/CastleCreator/CastleCreator b/Examples/CastleCreator/CastleCreator deleted file mode 100755 index c68c167..0000000 Binary files a/Examples/CastleCreator/CastleCreator and /dev/null differ diff --git a/Examples/CastleCreator/assets/shaders/fs1.glsl b/Examples/CastleCreator/assets/shaders/fs1.glsl index 94e9e73..524c642 100644 --- a/Examples/CastleCreator/assets/shaders/fs1.glsl +++ b/Examples/CastleCreator/assets/shaders/fs1.glsl @@ -1,13 +1,18 @@ -//precision highp float; // Set the default precision to medium +#version 310 es +precision highp float; // Set the default precision to medium //Note high precision is needed to NVidia RTX2060 card uniform sampler2D u_Texture; // texture -varying vec2 v_UV; // Texture UV coordinate -varying vec4 v_diffuseColour; // Diffuse colour -varying vec4 v_fogColour; // Fog colour +in vec2 v_UV; // Texture UV coordinate (i_nterpolated) +in vec4 v_diffuseColour; // Diffuse colour (i_nterpolated) +in vec4 v_fogColour; // Fog colour (i_nterpolated) + + + +out vec4 FragColor; void main() { - vec4 col = texture2D(u_Texture, v_UV) * v_diffuseColour + v_fogColour; - if (col.a > 0.01) gl_FragColor = col; else discard; + vec4 col1 = texture(u_Texture, v_UV) * v_diffuseColour + v_fogColour; + if (col1.a > 0.01) FragColor = col1; else discard; } diff --git a/Examples/CastleCreator/assets/shaders/vs1.glsl b/Examples/CastleCreator/assets/shaders/vs1.glsl index 8663bdf..9cdce8b 100644 --- a/Examples/CastleCreator/assets/shaders/vs1.glsl +++ b/Examples/CastleCreator/assets/shaders/vs1.glsl @@ -1,11 +1,12 @@ -//precision highp float; // Set the default precision to medium. We don't need as high of a +#version 310 es +precision highp float; // Set the default precision to medium. We don't need as high of a //Note high precision is needed to NVidia RTX2060 card uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. -uniform vec3 u_LightPos; // The position of the light in eye space. -uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform vec3 u_LightPos; // The position of the light i_n eye space. +uniform vec4 u_lightColour; // The colour of light i_n eye space. +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -16,15 +17,17 @@ uniform vec4 u_specularColour; uniform vec3 u_fogColour; uniform float u_fogMaxDist; -uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogMinDist) +uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogMi_nDist) -attribute vec3 a_Position; -attribute vec3 a_Normal; -attribute vec2 a_UV; + +//these may need fixed +in vec3 a_Position;// i_nput vertex position from mesh +in vec3 a_Normal;// i_nput vertex normal from mesh +in vec2 a_UV;// (texcoord) i_nput vertex texture coordi_nate from mesh -varying vec2 v_UV; -varying vec4 v_diffuseColour; -varying vec4 v_fogColour; +out vec2 v_UV;// (texcoord) output texture coordi_nate of vertex +out vec4 v_diffuseColour;// +out vec4 v_fogColour;// //varying vec3 v_Normal; ///varying vec3 v_LightPos; @@ -46,7 +49,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -55,7 +58,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.1); fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/CastleCreator/makefile b/Examples/CastleCreator/makefile index 3f3c446..233c51d 100644 --- a/Examples/CastleCreator/makefile +++ b/Examples/CastleCreator/makefile @@ -1,8 +1,30 @@ -TARGET = CastleCreator +UNAME := $(shell uname) +CFLAGS = +LDLIBS = +ifeq ($(UNAME), Linux) + TARGET = CastleCreator.app + UNAME_M := $(shell uname -m) + ifneq ($(filter %86,$(UNAME_M)),) + LDLIBS += -lGL + CFLAGS += -DPI3COPENGL + else + LDLIBS += -lGLESv2 + CFLAGS += -DPI3COPENGLES + endif +else + TARGET = CastleCreator.exe + LDLIBS += -lGL + CFLAGS += -DPI3COPENGL +endif + + + + +#TARGET = CastleCreator CC = g++ -CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +CFLAGS += -std=c++17 -Wall +LDLIBS += -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -24,7 +46,7 @@ CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source diff --git a/Examples/Extruder/Extruder b/Examples/Extruder/Extruder deleted file mode 100755 index f04ead3..0000000 Binary files a/Examples/Extruder/Extruder and /dev/null differ diff --git a/Examples/Extruder/assets/shaders/vs1.glsl b/Examples/Extruder/assets/shaders/vs1.glsl index 3fb6f3a..d2c9fb1 100644 --- a/Examples/Extruder/assets/shaders/vs1.glsl +++ b/Examples/Extruder/assets/shaders/vs1.glsl @@ -4,7 +4,7 @@ uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. uniform vec3 u_LightPos; // The position of the light in eye space. uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -45,7 +45,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -54,7 +54,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.1); fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/Extruder/makefile b/Examples/Extruder/makefile index dee3c44..9017590 100644 --- a/Examples/Extruder/makefile +++ b/Examples/Extruder/makefile @@ -2,7 +2,7 @@ TARGET = Extruder CC = g++ CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -11,19 +11,23 @@ UI_DIR:= ../../SharedCode/ui HELPS_DIR:= ../../SharedCode/helpers TESS_DIR:= ../../SharedCode/glutess RJSON_DIR:= ../../ThirdParty/rapidjson +FBX_DIR:= ../../ThirdParty/openFBX +GLTF_DIR:= ../../ThirdParty/gltf CPATH = $(SHARED_DIR) CPATH = $(FILE_DIR) CPATH = $(UI_DIR) CPATH = $(HELPS_DIR) CPATH = $(TESS_DIR) CPATH = $(RJSON_DIR) +CPATH = $(FBX_DIR) +CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) -SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) Source +SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source BUILD_DIR:= $(addprefix $(BUILDPATH),$(SRC_DIR)) SRC:= $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp $(sdir)/*.c)) diff --git a/Examples/HelloWorld/assets/shaders/fs1.glsl b/Examples/HelloWorld/assets/shaders/fs1.glsl index da8b0c2..890fe67 100644 --- a/Examples/HelloWorld/assets/shaders/fs1.glsl +++ b/Examples/HelloWorld/assets/shaders/fs1.glsl @@ -1,12 +1,13 @@ -//precision highp float; // Set the default precision to medium +#version 310 es +precision highp float; uniform sampler2D u_Texture; // texture -varying vec2 v_UV; // Texture UV coordinate -varying vec4 v_diffuseColour; // Diffuse colour -varying vec4 v_fogColour; // Fog colour - +in vec2 v_UV; // Texture UV coordi_nate +in vec4 v_diffuseColour; // Diffuse colour +in vec4 v_fogColour; // Fog colour +out vec4 FragColor; void main() { vec4 col = texture2D(u_Texture, v_UV) * v_diffuseColour + v_fogColour; - if (col.a > 0.01) gl_FragColor = col; else discard; + if (col.a > 0.01) FragColor = col; else discard; } diff --git a/Examples/HelloWorld/assets/shaders/vs1.glsl b/Examples/HelloWorld/assets/shaders/vs1.glsl index b57eb00..5322a82 100644 --- a/Examples/HelloWorld/assets/shaders/vs1.glsl +++ b/Examples/HelloWorld/assets/shaders/vs1.glsl @@ -1,10 +1,11 @@ -//precision highp float; // Set the default precision to medium. We don't need as high of a +#version 310 es +precision highp float; // Set the default precision to medium. We don't need as high of a uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. -uniform vec3 u_LightPos; // The position of the light in eye space. -uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform vec3 u_LightPos; // The position of the light i_n eye space. +uniform vec4 u_lightColour; // The colour of light i_n eye space. +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -15,17 +16,17 @@ uniform vec4 u_specularColour; uniform vec3 u_fogColour; uniform float u_fogMaxDist; -uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogMinDist) -uniform float u_col32; // a floating point representing RGB +uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogMi_nDist) +uniform float u_col32; // a floati_ng poi_nt representi_ng RGB -attribute vec3 a_Position; -attribute vec3 a_Normal; -attribute vec2 a_UV; -attribute float a_Colour; +in vec3 a_Position; +in vec3 a_Normal; +in vec2 a_UV; +in float a_Colour; -varying vec2 v_UV; -varying vec4 v_diffuseColour; -varying vec4 v_fogColour; +out vec2 v_UV; +out vec4 v_diffuseColour; +out vec4 v_fogColour; //varying vec3 v_Normal; ///varying vec3 v_LightPos; @@ -49,7 +50,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -58,7 +59,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour * col; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.3); //0.1 fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/HelloWorld/makefile b/Examples/HelloWorld/makefile index 95011be..2adb51c 100644 --- a/Examples/HelloWorld/makefile +++ b/Examples/HelloWorld/makefile @@ -2,7 +2,7 @@ TARGET = HelloWorld CC = g++ CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -12,6 +12,8 @@ HELPS_DIR:= ../../SharedCode/helpers EDIT_DIR:= ../../SharedCode/editing TESS_DIR:= ../../SharedCode/glutess RJSON_DIR:= ../../ThirdParty/rapidjson +FBX_DIR:= ../../ThirdParty/openFBX +GLTF_DIR:= ../../ThirdParty/gltf CPATH = $(SHARED_DIR) CPATH = $(FILE_DIR) CPATH = $(UI_DIR) @@ -19,13 +21,15 @@ CPATH = $(HELPS_DIR) CPATH = $(EDIT_DIR) CPATH = $(TESS_DIR) CPATH = $(RJSON_DIR) +CPATH = $(FBX_DIR) +CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) -SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(EDIT_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) Source +SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source BUILD_DIR:= $(addprefix $(BUILDPATH),$(SRC_DIR)) SRC:= $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp $(sdir)/*.c)) diff --git a/Examples/Invaders/Invaders b/Examples/Invaders/Invaders deleted file mode 100755 index abf2543..0000000 Binary files a/Examples/Invaders/Invaders and /dev/null differ diff --git a/Examples/Invaders/assets/shaders/fs1.glsl b/Examples/Invaders/assets/shaders/fs1.glsl index da8b0c2..ff9cfb3 100644 --- a/Examples/Invaders/assets/shaders/fs1.glsl +++ b/Examples/Invaders/assets/shaders/fs1.glsl @@ -1,9 +1,10 @@ -//precision highp float; // Set the default precision to medium +#version 310 es +precision highp float; uniform sampler2D u_Texture; // texture -varying vec2 v_UV; // Texture UV coordinate -varying vec4 v_diffuseColour; // Diffuse colour -varying vec4 v_fogColour; // Fog colour +in vec2 v_UV; // Texture UV coordi_nate +in vec4 v_diffuseColour; // Diffuse colour +in vec4 v_fogColour; // Fog colour void main() { diff --git a/Examples/Invaders/assets/shaders/vs1.glsl b/Examples/Invaders/assets/shaders/vs1.glsl index 2b0be6c..1fec55c 100644 --- a/Examples/Invaders/assets/shaders/vs1.glsl +++ b/Examples/Invaders/assets/shaders/vs1.glsl @@ -1,10 +1,11 @@ -//precision highp float; // Set the default precision to medium. We don't need as high of a +#version 310 es +precision highp float; uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. -uniform vec3 u_LightPos; // The position of the light in eye space. -uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform vec3 u_LightPos; // The position of the light i_n eye space. +uniform vec4 u_lightColour; // The colour of light i_n eye space. +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -15,15 +16,15 @@ uniform vec4 u_specularColour; uniform vec3 u_fogColour; uniform float u_fogMaxDist; -uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogMinDist) +uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogMi_nDist) -attribute vec3 a_Position; -attribute vec3 a_Normal; -attribute vec2 a_UV; +in vec3 a_Position; +in vec3 a_Normal; +in vec2 a_UV; -varying vec2 v_UV; -varying vec4 v_diffuseColour; -varying vec4 v_fogColour; +out vec2 v_UV; +out vec4 v_diffuseColour; +out vec4 v_fogColour; //varying vec3 v_Normal; ///varying vec3 v_LightPos; @@ -45,7 +46,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -54,7 +55,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.1); fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/Invaders/makefile b/Examples/Invaders/makefile index 971026d..ae964d1 100644 --- a/Examples/Invaders/makefile +++ b/Examples/Invaders/makefile @@ -2,7 +2,7 @@ TARGET = Invaders CC = g++ CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -10,18 +10,24 @@ FILE_DIR:= ../../SharedCode/file UI_DIR:= ../../SharedCode/ui HELPS_DIR:= ../../SharedCode/helpers TESS_DIR:= ../../SharedCode/glutess +RJSON_DIR:= ../../ThirdParty/rapidjson +FBX_DIR:= ../../ThirdParty/openFBX +GLTF_DIR:= ../../ThirdParty/gltf CPATH = $(SHARED_DIR) CPATH = $(FILE_DIR) CPATH = $(UI_DIR) CPATH = $(HELPS_DIR) CPATH = $(TESS_DIR) +CPATH = $(RJSON_DIR) +CPATH = $(FBX_DIR) +CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) -SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) Source +SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source BUILD_DIR:= $(addprefix $(BUILDPATH),$(SRC_DIR)) SRC:= $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp $(sdir)/*.c)) diff --git a/Examples/MD viewer/assets/shaders/vs1.glsl b/Examples/MD viewer/assets/shaders/vs1.glsl index 952c49f..43592b1 100644 --- a/Examples/MD viewer/assets/shaders/vs1.glsl +++ b/Examples/MD viewer/assets/shaders/vs1.glsl @@ -4,7 +4,7 @@ uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. uniform vec3 u_LightPos; // The position of the light in eye space. uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -49,7 +49,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -58,7 +58,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour * col; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.1); fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/MD viewer/makefile b/Examples/MD viewer/makefile index 45bc1b8..2b54d90 100644 --- a/Examples/MD viewer/makefile +++ b/Examples/MD viewer/makefile @@ -2,7 +2,7 @@ TARGET = MarkDownViewer CC = g++ CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -10,18 +10,24 @@ FILE_DIR:= ../../SharedCode/file UI_DIR:= ../../SharedCode/ui HELPS_DIR:= ../../SharedCode/helpers TESS_DIR:= ../../SharedCode/glutess +RJSON_DIR:= ../../ThirdParty/rapidjson +FBX_DIR:= ../../ThirdParty/openFBX +GLTF_DIR:= ../../ThirdParty/gltf CPATH = $(SHARED_DIR) CPATH = $(FILE_DIR) CPATH = $(UI_DIR) CPATH = $(HELPS_DIR) CPATH = $(TESS_DIR) +CPATH = $(RJSON_DIR) +CPATH = $(FBX_DIR) +CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) -SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) Source +SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source BUILD_DIR:= $(addprefix $(BUILDPATH),$(SRC_DIR)) SRC:= $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp $(sdir)/*.c)) diff --git a/Examples/NoahsArk/SceneViewer b/Examples/NoahsArk/SceneViewer deleted file mode 100755 index 209d23d..0000000 Binary files a/Examples/NoahsArk/SceneViewer and /dev/null differ diff --git a/Examples/NoahsArk/assets/shaders/vs1.glsl b/Examples/NoahsArk/assets/shaders/vs1.glsl index c29dbec..bda4a12 100644 --- a/Examples/NoahsArk/assets/shaders/vs1.glsl +++ b/Examples/NoahsArk/assets/shaders/vs1.glsl @@ -4,7 +4,7 @@ uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. uniform vec3 u_LightPos; // The position of the light in eye space. uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -49,7 +49,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -58,7 +58,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour * col; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.1); fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/NoahsArk/makefile b/Examples/NoahsArk/makefile index 0a65389..91ddab2 100644 --- a/Examples/NoahsArk/makefile +++ b/Examples/NoahsArk/makefile @@ -2,7 +2,7 @@ TARGET = SceneViewer CC = g++ CFLAGS = -std=c++17 -Wall -Wno-reorder -Wno-unused-variable -Wno-switch -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -10,18 +10,24 @@ FILE_DIR:= ../../SharedCode/file UI_DIR:= ../../SharedCode/ui HELPS_DIR:= ../../SharedCode/helpers TESS_DIR:= ../../SharedCode/glutess +RJSON_DIR:= ../../ThirdParty/rapidjson +FBX_DIR:= ../../ThirdParty/openFBX +GLTF_DIR:= ../../ThirdParty/gltf CPATH = $(SHARED_DIR) CPATH = $(FILE_DIR) CPATH = $(UI_DIR) CPATH = $(HELPS_DIR) CPATH = $(TESS_DIR) +CPATH = $(RJSON_DIR) +CPATH = $(FBX_DIR) +CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) -SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) Source +SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source BUILD_DIR:= $(addprefix $(BUILDPATH),$(SRC_DIR)) SRC:= $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp $(sdir)/*.c)) diff --git a/Examples/PerlinMap/PerlinMap b/Examples/PerlinMap/PerlinMap deleted file mode 100755 index 226237a..0000000 Binary files a/Examples/PerlinMap/PerlinMap and /dev/null differ diff --git a/Examples/PerlinMap/assets/shaders/vs1.glsl b/Examples/PerlinMap/assets/shaders/vs1.glsl index 3fb6f3a..d2c9fb1 100644 --- a/Examples/PerlinMap/assets/shaders/vs1.glsl +++ b/Examples/PerlinMap/assets/shaders/vs1.glsl @@ -4,7 +4,7 @@ uniform mat4 u_ProjMatrix; // view/projection matrix. uniform mat4 u_ModelMatrix; // model matrix. uniform vec3 u_LightPos; // The position of the light in eye space. uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model +uniform int u_illumi_nationModel; // If ==2 then apply illumation model uniform int u_reflective; // uniform vec2 u_animoffset; @@ -45,7 +45,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -54,7 +54,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.1); fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/PerlinMap/makefile b/Examples/PerlinMap/makefile index b8c9d03..0b85e24 100644 --- a/Examples/PerlinMap/makefile +++ b/Examples/PerlinMap/makefile @@ -2,7 +2,7 @@ TARGET = PerlinMap CC = g++ CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -10,18 +10,24 @@ FILE_DIR:= ../../SharedCode/file UI_DIR:= ../../SharedCode/ui HELPS_DIR:= ../../SharedCode/helpers TESS_DIR:= ../../SharedCode/glutess +RJSON_DIR:= ../../ThirdParty/rapidjson +FBX_DIR:= ../../ThirdParty/openFBX +GLTF_DIR:= ../../ThirdParty/gltf CPATH = $(SHARED_DIR) CPATH = $(FILE_DIR) CPATH = $(UI_DIR) CPATH = $(HELPS_DIR) CPATH = $(TESS_DIR) +CPATH = $(RJSON_DIR) +CPATH = $(FBX_DIR) +CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) -SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) Source +SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source BUILD_DIR:= $(addprefix $(BUILDPATH),$(SRC_DIR)) SRC:= $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp $(sdir)/*.c)) diff --git a/Examples/ShaderToy/ShaderToy b/Examples/ShaderToy/ShaderToy deleted file mode 100755 index e67d001..0000000 Binary files a/Examples/ShaderToy/ShaderToy and /dev/null differ diff --git a/Examples/ShaderToy/Shaders/3Dlookup.fs b/Examples/ShaderToy/Shaders/3Dlookup.fs index c021e55..cec8f5c 100644 --- a/Examples/ShaderToy/Shaders/3Dlookup.fs +++ b/Examples/ShaderToy/Shaders/3Dlookup.fs @@ -19,7 +19,7 @@ // #define METHOD 0 -#version 300 es +#version 310 es precision highp float; // Set the default precision to high uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/AbstractTunnel.fs b/Examples/ShaderToy/Shaders/AbstractTunnel.fs index d6b4f08..7ebd368 100644 --- a/Examples/ShaderToy/Shaders/AbstractTunnel.fs +++ b/Examples/ShaderToy/Shaders/AbstractTunnel.fs @@ -11,7 +11,7 @@ */ //https://www.shadertoy.com/view/MlXSWX -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/AlienCavity.fs b/Examples/ShaderToy/Shaders/AlienCavity.fs index cf01ac5..bcfa18c 100644 --- a/Examples/ShaderToy/Shaders/AlienCavity.fs +++ b/Examples/ShaderToy/Shaders/AlienCavity.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/MdccWr -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Atmosphere.fs b/Examples/ShaderToy/Shaders/Atmosphere.fs index 5d3f295..0d80d78 100644 --- a/Examples/ShaderToy/Shaders/Atmosphere.fs +++ b/Examples/ShaderToy/Shaders/Atmosphere.fs @@ -1,7 +1,7 @@ // https://www.shadertoy.com/view/lslXDr // Written by GLtracy -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Auralights.fs b/Examples/ShaderToy/Shaders/Auralights.fs index fd90c53..fd91636 100644 --- a/Examples/ShaderToy/Shaders/Auralights.fs +++ b/Examples/ShaderToy/Shaders/Auralights.fs @@ -1,5 +1,5 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Auroras.fs b/Examples/ShaderToy/Shaders/Auroras.fs index a2a7710..330a819 100644 --- a/Examples/ShaderToy/Shaders/Auroras.fs +++ b/Examples/ShaderToy/Shaders/Auroras.fs @@ -4,7 +4,7 @@ // https://www.shadertoy.com/view/lllGWH // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/BallofFire.fs b/Examples/ShaderToy/Shaders/BallofFire.fs index 3567fc3..baa2694 100644 --- a/Examples/ShaderToy/Shaders/BallofFire.fs +++ b/Examples/ShaderToy/Shaders/BallofFire.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/lsf3RH -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Beehive.fs b/Examples/ShaderToy/Shaders/Beehive.fs index fd6580e..ff2bf62 100644 --- a/Examples/ShaderToy/Shaders/Beehive.fs +++ b/Examples/ShaderToy/Shaders/Beehive.fs @@ -7,7 +7,7 @@ //#define THE_BEE -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Bubbles.fs b/Examples/ShaderToy/Shaders/Bubbles.fs index e42aba9..20cb183 100644 --- a/Examples/ShaderToy/Shaders/Bubbles.fs +++ b/Examples/ShaderToy/Shaders/Bubbles.fs @@ -1,7 +1,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/CaveTunnel.fs b/Examples/ShaderToy/Shaders/CaveTunnel.fs index de1a937..dcd657e 100644 --- a/Examples/ShaderToy/Shaders/CaveTunnel.fs +++ b/Examples/ShaderToy/Shaders/CaveTunnel.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Chasers.fs b/Examples/ShaderToy/Shaders/Chasers.fs index e5e4245..4c0ecdb 100644 --- a/Examples/ShaderToy/Shaders/Chasers.fs +++ b/Examples/ShaderToy/Shaders/Chasers.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Cheap5Dwave.fs b/Examples/ShaderToy/Shaders/Cheap5Dwave.fs index 5fbd58f..6bfec38 100644 --- a/Examples/ShaderToy/Shaders/Cheap5Dwave.fs +++ b/Examples/ShaderToy/Shaders/Cheap5Dwave.fs @@ -1,7 +1,7 @@ //Cheap 5D wave //https://www.shadertoy.com/view/lscyD7 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/CheapTunnel.fs b/Examples/ShaderToy/Shaders/CheapTunnel.fs index 018c8bd..01fbd34 100644 --- a/Examples/ShaderToy/Shaders/CheapTunnel.fs +++ b/Examples/ShaderToy/Shaders/CheapTunnel.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/MstyRS -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/CheapWater.fs b/Examples/ShaderToy/Shaders/CheapWater.fs index 223aaa3..b0162c3 100644 --- a/Examples/ShaderToy/Shaders/CheapWater.fs +++ b/Examples/ShaderToy/Shaders/CheapWater.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/CirclePattern.fs b/Examples/ShaderToy/Shaders/CirclePattern.fs index 1fa328e..ec76e6f 100644 --- a/Examples/ShaderToy/Shaders/CirclePattern.fs +++ b/Examples/ShaderToy/Shaders/CirclePattern.fs @@ -1,7 +1,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Cloud2D.fs b/Examples/ShaderToy/Shaders/Cloud2D.fs index 24e0269..281e166 100644 --- a/Examples/ShaderToy/Shaders/Cloud2D.fs +++ b/Examples/ShaderToy/Shaders/Cloud2D.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/4tdSWr -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/CloudTen.fs b/Examples/ShaderToy/Shaders/CloudTen.fs index 6dd6d9c..05ea66d 100644 --- a/Examples/ShaderToy/Shaders/CloudTen.fs +++ b/Examples/ShaderToy/Shaders/CloudTen.fs @@ -3,7 +3,7 @@ //License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License //https://www.shadertoy.com/view/XtS3DD -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/CloudTunnel.fs b/Examples/ShaderToy/Shaders/CloudTunnel.fs index 39da493..ebb7ec8 100644 --- a/Examples/ShaderToy/Shaders/CloudTunnel.fs +++ b/Examples/ShaderToy/Shaders/CloudTunnel.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/4d3yRH -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/ColdShore.fs b/Examples/ShaderToy/Shaders/ColdShore.fs index 8b56050..311adb6 100644 --- a/Examples/ShaderToy/Shaders/ColdShore.fs +++ b/Examples/ShaderToy/Shaders/ColdShore.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/ColourTess,fs.txt b/Examples/ShaderToy/Shaders/ColourTess,fs.txt index 5dc8786..ba89619 100644 --- a/Examples/ShaderToy/Shaders/ColourTess,fs.txt +++ b/Examples/ShaderToy/Shaders/ColourTess,fs.txt @@ -6,7 +6,7 @@ // Contact the author for other licensing options -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/ColourTess.fs b/Examples/ShaderToy/Shaders/ColourTess.fs index 5dc8786..ba89619 100644 --- a/Examples/ShaderToy/Shaders/ColourTess.fs +++ b/Examples/ShaderToy/Shaders/ColourTess.fs @@ -6,7 +6,7 @@ // Contact the author for other licensing options -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/CurveRays.fs b/Examples/ShaderToy/Shaders/CurveRays.fs index 827bb9f..1f44fcb 100644 --- a/Examples/ShaderToy/Shaders/CurveRays.fs +++ b/Examples/ShaderToy/Shaders/CurveRays.fs @@ -4,7 +4,7 @@ // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License // Contact the author for other licensing options -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/CutePop.fs b/Examples/ShaderToy/Shaders/CutePop.fs index 2887b68..e65c9c7 100644 --- a/Examples/ShaderToy/Shaders/CutePop.fs +++ b/Examples/ShaderToy/Shaders/CutePop.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/4s2cWm -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/DNAtunnel.fs b/Examples/ShaderToy/Shaders/DNAtunnel.fs index b31ead8..6d3fd34 100644 --- a/Examples/ShaderToy/Shaders/DNAtunnel.fs +++ b/Examples/ShaderToy/Shaders/DNAtunnel.fs @@ -5,7 +5,7 @@ * Created by bal-khan */ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Derivative.fs b/Examples/ShaderToy/Shaders/Derivative.fs index 0e6e7c7..e41c9f3 100644 --- a/Examples/ShaderToy/Shaders/Derivative.fs +++ b/Examples/ShaderToy/Shaders/Derivative.fs @@ -1,7 +1,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/DonjonTunnel.fs b/Examples/ShaderToy/Shaders/DonjonTunnel.fs index 23417bd..a21a753 100644 --- a/Examples/ShaderToy/Shaders/DonjonTunnel.fs +++ b/Examples/ShaderToy/Shaders/DonjonTunnel.fs @@ -2,7 +2,7 @@ // Created by Stephane Cuillerdier - Aiekick/2017 (twitter:@aiekick) // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/DriveHome.fs b/Examples/ShaderToy/Shaders/DriveHome.fs index cf6bceb..6e95d09 100644 --- a/Examples/ShaderToy/Shaders/DriveHome.fs +++ b/Examples/ShaderToy/Shaders/DriveHome.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/EarthTunnel.fs b/Examples/ShaderToy/Shaders/EarthTunnel.fs index 5ff82b0..018194d 100644 --- a/Examples/ShaderToy/Shaders/EarthTunnel.fs +++ b/Examples/ShaderToy/Shaders/EarthTunnel.fs @@ -4,7 +4,7 @@ // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/EiffieBox.fs b/Examples/ShaderToy/Shaders/EiffieBox.fs index 3fca2cf..dc89684 100644 --- a/Examples/ShaderToy/Shaders/EiffieBox.fs +++ b/Examples/ShaderToy/Shaders/EiffieBox.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/XlXGWf -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/FastOcean.fs b/Examples/ShaderToy/Shaders/FastOcean.fs index 47b338c..63de074 100644 --- a/Examples/ShaderToy/Shaders/FastOcean.fs +++ b/Examples/ShaderToy/Shaders/FastOcean.fs @@ -1,7 +1,7 @@ //afl_ext 2017 //https://www.shadertoy.com/view/MdXyzX -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Filtering.fs b/Examples/ShaderToy/Shaders/Filtering.fs index 0e49354..2d6d6c9 100644 --- a/Examples/ShaderToy/Shaders/Filtering.fs +++ b/Examples/ShaderToy/Shaders/Filtering.fs @@ -3,7 +3,7 @@ // Copyright © 2013 Inigo Quilez // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Fire.fs b/Examples/ShaderToy/Shaders/Fire.fs index cd8d9e5..8623a5d 100644 --- a/Examples/ShaderToy/Shaders/Fire.fs +++ b/Examples/ShaderToy/Shaders/Fire.fs @@ -3,7 +3,7 @@ ////////////////////// // Fire Flame shader -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/FireWorks.fs b/Examples/ShaderToy/Shaders/FireWorks.fs index 03465a0..9518809 100644 --- a/Examples/ShaderToy/Shaders/FireWorks.fs +++ b/Examples/ShaderToy/Shaders/FireWorks.fs @@ -3,7 +3,7 @@ // Based on https://www.shadertoy.com/view/lscGRl // Email:countfrolic@gmail.com Twitter:@The_ArtOfCode -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Flames.fs b/Examples/ShaderToy/Shaders/Flames.fs index 1410118..194291a 100644 --- a/Examples/ShaderToy/Shaders/Flames.fs +++ b/Examples/ShaderToy/Shaders/Flames.fs @@ -1,7 +1,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/FlowingWater.fs b/Examples/ShaderToy/Shaders/FlowingWater.fs index 4d0f807..2534875 100644 --- a/Examples/ShaderToy/Shaders/FlowingWater.fs +++ b/Examples/ShaderToy/Shaders/FlowingWater.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium //Flowing Water diff --git a/Examples/ShaderToy/Shaders/Flying.fs b/Examples/ShaderToy/Shaders/Flying.fs index ac9f73c..84f5131 100644 --- a/Examples/ShaderToy/Shaders/Flying.fs +++ b/Examples/ShaderToy/Shaders/Flying.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/4ts3DH -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/FractalComplex.fs b/Examples/ShaderToy/Shaders/FractalComplex.fs index 15f8119..9b295a6 100644 --- a/Examples/ShaderToy/Shaders/FractalComplex.fs +++ b/Examples/ShaderToy/Shaders/FractalComplex.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/ltfGzS -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/FractalLand.fs b/Examples/ShaderToy/Shaders/FractalLand.fs index ddb1a31..84f11a1 100644 --- a/Examples/ShaderToy/Shaders/FractalLand.fs +++ b/Examples/ShaderToy/Shaders/FractalLand.fs @@ -5,7 +5,7 @@ // update: Nyan Cat cameo, thanks to code from mu6k: https://www.shadertoy.com/view/4dXGWH -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/FractalTilings.fs b/Examples/ShaderToy/Shaders/FractalTilings.fs index c6a39e6..7bff489 100644 --- a/Examples/ShaderToy/Shaders/FractalTilings.fs +++ b/Examples/ShaderToy/Shaders/FractalTilings.fs @@ -2,7 +2,7 @@ // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. // https://www.shadertoy.com/view/Ml2GWy -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/GasGiant.fs b/Examples/ShaderToy/Shaders/GasGiant.fs index 3916435..f4bba4f 100644 --- a/Examples/ShaderToy/Shaders/GasGiant.fs +++ b/Examples/ShaderToy/Shaders/GasGiant.fs @@ -8,7 +8,7 @@ // STAR/FLARE (mu6k): https://www.shadertoy.com/view/4sX3Rs // RAY V SPHERE (reinder): https://www.shadertoy.com/view/4tjGRh -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/GasPlanet.fs b/Examples/ShaderToy/Shaders/GasPlanet.fs index 84f8f43..6764711 100644 --- a/Examples/ShaderToy/Shaders/GasPlanet.fs +++ b/Examples/ShaderToy/Shaders/GasPlanet.fs @@ -4,7 +4,7 @@ // by Andrew Baldwin. // This work is licensed under a Creative Commons Attribution 4.0 International License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/GhostTunnel.fs b/Examples/ShaderToy/Shaders/GhostTunnel.fs index a04286a..e6a44bb 100644 --- a/Examples/ShaderToy/Shaders/GhostTunnel.fs +++ b/Examples/ShaderToy/Shaders/GhostTunnel.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/MsVyRh -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Gnomonic.fs b/Examples/ShaderToy/Shaders/Gnomonic.fs index 39afcd7..d1310c3 100644 --- a/Examples/ShaderToy/Shaders/Gnomonic.fs +++ b/Examples/ShaderToy/Shaders/Gnomonic.fs @@ -43,7 +43,7 @@ * **/ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Gravity.fs b/Examples/ShaderToy/Shaders/Gravity.fs index f5b5fc7..75a196c 100644 --- a/Examples/ShaderToy/Shaders/Gravity.fs +++ b/Examples/ShaderToy/Shaders/Gravity.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/XlfSWS -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/GreekFrieze.fs b/Examples/ShaderToy/Shaders/GreekFrieze.fs index 5a28682..6ed22e3 100644 --- a/Examples/ShaderToy/Shaders/GreekFrieze.fs +++ b/Examples/ShaderToy/Shaders/GreekFrieze.fs @@ -1,5 +1,5 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Heart2d.fs b/Examples/ShaderToy/Shaders/Heart2d.fs index e2170f2..b41000d 100644 --- a/Examples/ShaderToy/Shaders/Heart2d.fs +++ b/Examples/ShaderToy/Shaders/Heart2d.fs @@ -2,7 +2,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Hell.fs b/Examples/ShaderToy/Shaders/Hell.fs index a8c260e..12d2435 100644 --- a/Examples/ShaderToy/Shaders/Hell.fs +++ b/Examples/ShaderToy/Shaders/Hell.fs @@ -1,7 +1,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Hexagons.fs b/Examples/ShaderToy/Shaders/Hexagons.fs index 5569e32..bf8ba7a 100644 --- a/Examples/ShaderToy/Shaders/Hexagons.fs +++ b/Examples/ShaderToy/Shaders/Hexagons.fs @@ -2,7 +2,7 @@ // Created by inigo quilez - iq/2014 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/HyperXOR.fs b/Examples/ShaderToy/Shaders/HyperXOR.fs index 1d48905..0a4842d 100644 --- a/Examples/ShaderToy/Shaders/HyperXOR.fs +++ b/Examples/ShaderToy/Shaders/HyperXOR.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/4slXWn -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/InfiniteColors.fs b/Examples/ShaderToy/Shaders/InfiniteColors.fs index 88db830..41e8014 100644 --- a/Examples/ShaderToy/Shaders/InfiniteColors.fs +++ b/Examples/ShaderToy/Shaders/InfiniteColors.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/3lXSRl -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Invaders.fs b/Examples/ShaderToy/Shaders/Invaders.fs index f1a29dc..0420780 100644 --- a/Examples/ShaderToy/Shaders/Invaders.fs +++ b/Examples/ShaderToy/Shaders/Invaders.fs @@ -17,7 +17,7 @@ //https://www.shadertoy.com/view/MsjGRt -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Iterations.fs b/Examples/ShaderToy/Shaders/Iterations.fs index c51a9ac..82d2d7a 100644 --- a/Examples/ShaderToy/Shaders/Iterations.fs +++ b/Examples/ShaderToy/Shaders/Iterations.fs @@ -16,7 +16,7 @@ // "worms" : https://www.shadertoy.com/view/ldl3W4 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/IveSeen.fs b/Examples/ShaderToy/Shaders/IveSeen.fs index d52787e..218d232 100644 --- a/Examples/ShaderToy/Shaders/IveSeen.fs +++ b/Examples/ShaderToy/Shaders/IveSeen.fs @@ -17,7 +17,7 @@ Use mouse to look around Sorry for thr unreadable code. ************************************************************************/ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/JaggedLand.fs b/Examples/ShaderToy/Shaders/JaggedLand.fs index b2bfcc0..1a3ca56 100644 --- a/Examples/ShaderToy/Shaders/JaggedLand.fs +++ b/Examples/ShaderToy/Shaders/JaggedLand.fs @@ -1,5 +1,5 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/JudgingBegins.fs b/Examples/ShaderToy/Shaders/JudgingBegins.fs index a70b952..76c098a 100644 --- a/Examples/ShaderToy/Shaders/JudgingBegins.fs +++ b/Examples/ShaderToy/Shaders/JudgingBegins.fs @@ -41,7 +41,7 @@ Winners are the shaders with most points. */ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/JuliaDistance.fs b/Examples/ShaderToy/Shaders/JuliaDistance.fs index 180ad0c..2fce1fb 100644 --- a/Examples/ShaderToy/Shaders/JuliaDistance.fs +++ b/Examples/ShaderToy/Shaders/JuliaDistance.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Kaleidoscope.fs b/Examples/ShaderToy/Shaders/Kaleidoscope.fs index ab28b30..97f50b5 100644 --- a/Examples/ShaderToy/Shaders/Kaleidoscope.fs +++ b/Examples/ShaderToy/Shaders/Kaleidoscope.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/WsSGWG -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/LakeDrops.fs b/Examples/ShaderToy/Shaders/LakeDrops.fs index 5b9183c..05dc019 100644 --- a/Examples/ShaderToy/Shaders/LakeDrops.fs +++ b/Examples/ShaderToy/Shaders/LakeDrops.fs @@ -3,7 +3,7 @@ //Horrible mod to non-cubemap texture! -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/LightRays.fs b/Examples/ShaderToy/Shaders/LightRays.fs index 4dc4ff8..8cb53f3 100644 --- a/Examples/ShaderToy/Shaders/LightRays.fs +++ b/Examples/ShaderToy/Shaders/LightRays.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/lljGDt -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Lightning.fs b/Examples/ShaderToy/Shaders/Lightning.fs index 940c4a2..c3153c1 100644 --- a/Examples/ShaderToy/Shaders/Lightning.fs +++ b/Examples/ShaderToy/Shaders/Lightning.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/MdSGW1 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/LightsInSmoke.fs b/Examples/ShaderToy/Shaders/LightsInSmoke.fs index a4ee868..a2d6660 100644 --- a/Examples/ShaderToy/Shaders/LightsInSmoke.fs +++ b/Examples/ShaderToy/Shaders/LightsInSmoke.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/MdyGzR -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/LightsOn.fs b/Examples/ShaderToy/Shaders/LightsOn.fs index ae548a3..334234a 100644 --- a/Examples/ShaderToy/Shaders/LightsOn.fs +++ b/Examples/ShaderToy/Shaders/LightsOn.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/ld2Gz3 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/MandelLeaves.fs b/Examples/ShaderToy/Shaders/MandelLeaves.fs index 93734f2..ad7cef1 100644 --- a/Examples/ShaderToy/Shaders/MandelLeaves.fs +++ b/Examples/ShaderToy/Shaders/MandelLeaves.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/MttBz8 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/MandelLog.fs b/Examples/ShaderToy/Shaders/MandelLog.fs index 4522937..a0858e6 100644 --- a/Examples/ShaderToy/Shaders/MandelLog.fs +++ b/Examples/ShaderToy/Shaders/MandelLog.fs @@ -4,7 +4,7 @@ // https://www.shadertoy.com/view/lllGWH // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Mandelbrot.fs b/Examples/ShaderToy/Shaders/Mandelbrot.fs index c36d4e2..e763f15 100644 --- a/Examples/ShaderToy/Shaders/Mandelbrot.fs +++ b/Examples/ShaderToy/Shaders/Mandelbrot.fs @@ -15,7 +15,7 @@ // // More info here: http://www.iquilezles.org/www/articles/distancefractals/distancefractals.htm -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Mandelbrot2.fs b/Examples/ShaderToy/Shaders/Mandelbrot2.fs index f521987..d1f1cb9 100644 --- a/Examples/ShaderToy/Shaders/Mandelbrot2.fs +++ b/Examples/ShaderToy/Shaders/Mandelbrot2.fs @@ -1,7 +1,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Mandelbrot3.fs b/Examples/ShaderToy/Shaders/Mandelbrot3.fs index a030039..db991f0 100644 --- a/Examples/ShaderToy/Shaders/Mandelbrot3.fs +++ b/Examples/ShaderToy/Shaders/Mandelbrot3.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/lllGWH -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/MatrixRain.fs b/Examples/ShaderToy/Shaders/MatrixRain.fs index a515eeb..bb6f239 100644 --- a/Examples/ShaderToy/Shaders/MatrixRain.fs +++ b/Examples/ShaderToy/Shaders/MatrixRain.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/MeltingTunnel.fs b/Examples/ShaderToy/Shaders/MeltingTunnel.fs index 02aefda..5905d5e 100644 --- a/Examples/ShaderToy/Shaders/MeltingTunnel.fs +++ b/Examples/ShaderToy/Shaders/MeltingTunnel.fs @@ -3,7 +3,7 @@ // Created by evilryu // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/MengerTunnel.fs b/Examples/ShaderToy/Shaders/MengerTunnel.fs index 82c9b28..8615b05 100644 --- a/Examples/ShaderToy/Shaders/MengerTunnel.fs +++ b/Examples/ShaderToy/Shaders/MengerTunnel.fs @@ -32,7 +32,7 @@ */ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Minecraft.fs b/Examples/ShaderToy/Shaders/Minecraft.fs index 8524766..e516422 100644 --- a/Examples/ShaderToy/Shaders/Minecraft.fs +++ b/Examples/ShaderToy/Shaders/Minecraft.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/4tsGD7 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/MistyMountains.fs b/Examples/ShaderToy/Shaders/MistyMountains.fs index 31022b1..4d34959 100644 --- a/Examples/ShaderToy/Shaders/MistyMountains.fs +++ b/Examples/ShaderToy/Shaders/MistyMountains.fs @@ -1,7 +1,7 @@ // raymarching loop based on "[SH17A] Lava Planet" by P_Malin (https://www.shadertoy.com/view/ldBfDR) // https://www.shadertoy.com/view/Md2fWz -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/MrLegoBoy.fs b/Examples/ShaderToy/Shaders/MrLegoBoy.fs index dead98c..ad6fd21 100644 --- a/Examples/ShaderToy/Shaders/MrLegoBoy.fs +++ b/Examples/ShaderToy/Shaders/MrLegoBoy.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/3lXXzl -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/MysteryMountains.fs b/Examples/ShaderToy/Shaders/MysteryMountains.fs index f1d3c57..19468d4 100644 --- a/Examples/ShaderToy/Shaders/MysteryMountains.fs +++ b/Examples/ShaderToy/Shaders/MysteryMountains.fs @@ -3,7 +3,7 @@ //https://www.shadertoy.com/view/llsGW7 // Add texture layers of differing frequencies and magnitudes... -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/OblivionRadar.fs b/Examples/ShaderToy/Shaders/OblivionRadar.fs index 3c55b90..841f694 100644 --- a/Examples/ShaderToy/Shaders/OblivionRadar.fs +++ b/Examples/ShaderToy/Shaders/OblivionRadar.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/4s2SRt -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/OilOnWater.fs b/Examples/ShaderToy/Shaders/OilOnWater.fs index ed00678..21a8579 100644 --- a/Examples/ShaderToy/Shaders/OilOnWater.fs +++ b/Examples/ShaderToy/Shaders/OilOnWater.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/4tfGzj -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Old3Droad.fs b/Examples/ShaderToy/Shaders/Old3Droad.fs index 0c1c74b..88e5ea6 100644 --- a/Examples/ShaderToy/Shaders/Old3Droad.fs +++ b/Examples/ShaderToy/Shaders/Old3Droad.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/XtlGW4 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/OneTweetVolume.fs b/Examples/ShaderToy/Shaders/OneTweetVolume.fs index 9507e8e..adbf89c 100644 --- a/Examples/ShaderToy/Shaders/OneTweetVolume.fs +++ b/Examples/ShaderToy/Shaders/OneTweetVolume.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Paisaje.fs b/Examples/ShaderToy/Shaders/Paisaje.fs index fbb6f8d..7400ee7 100644 --- a/Examples/ShaderToy/Shaders/Paisaje.fs +++ b/Examples/ShaderToy/Shaders/Paisaje.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/4lXGzj -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/PerlinArchipelago.fs b/Examples/ShaderToy/Shaders/PerlinArchipelago.fs index 8bcbccb..a2bfbd2 100644 --- a/Examples/ShaderToy/Shaders/PerlinArchipelago.fs +++ b/Examples/ShaderToy/Shaders/PerlinArchipelago.fs @@ -1,7 +1,7 @@ //Perlin Archipelago //https://www.shadertoy.com/view/MsS3Wz -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/PerlinPlanet.fs b/Examples/ShaderToy/Shaders/PerlinPlanet.fs index 411bc5b..5d3df35 100644 --- a/Examples/ShaderToy/Shaders/PerlinPlanet.fs +++ b/Examples/ShaderToy/Shaders/PerlinPlanet.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/MdX3RM -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/PhongShading.fs b/Examples/ShaderToy/Shaders/PhongShading.fs index ca5a254..d1110f1 100644 --- a/Examples/ShaderToy/Shaders/PhongShading.fs +++ b/Examples/ShaderToy/Shaders/PhongShading.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/ldlGz8 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Pirates.fs b/Examples/ShaderToy/Shaders/Pirates.fs index 969a21e..5e415ef 100644 --- a/Examples/ShaderToy/Shaders/Pirates.fs +++ b/Examples/ShaderToy/Shaders/Pirates.fs @@ -5,7 +5,7 @@ // A simple and cheap 2D shader to accompany the Pirates of the Caribean music. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Planet.fs b/Examples/ShaderToy/Shaders/Planet.fs index 6e90685..e09e9cb 100644 --- a/Examples/ShaderToy/Shaders/Planet.fs +++ b/Examples/ShaderToy/Shaders/Planet.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/PlanetToy.fs b/Examples/ShaderToy/Shaders/PlanetToy.fs index 3e39110..17780ef 100644 --- a/Examples/ShaderToy/Shaders/PlanetToy.fs +++ b/Examples/ShaderToy/Shaders/PlanetToy.fs @@ -5,7 +5,7 @@ // -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Plasma.fs b/Examples/ShaderToy/Shaders/Plasma.fs index 7d1a75f..2e3d85c 100644 --- a/Examples/ShaderToy/Shaders/Plasma.fs +++ b/Examples/ShaderToy/Shaders/Plasma.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/PottersTunnel.fs b/Examples/ShaderToy/Shaders/PottersTunnel.fs index 52b2eb2..9e1b263 100644 --- a/Examples/ShaderToy/Shaders/PottersTunnel.fs +++ b/Examples/ShaderToy/Shaders/PottersTunnel.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/4st3WX -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/ProcNormalMap.fs b/Examples/ShaderToy/Shaders/ProcNormalMap.fs index d1b6804..7a3f6bf 100644 --- a/Examples/ShaderToy/Shaders/ProcNormalMap.fs +++ b/Examples/ShaderToy/Shaders/ProcNormalMap.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/4ss3W7 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/PulsingTunnel.fs b/Examples/ShaderToy/Shaders/PulsingTunnel.fs index 40bd35a..79947fa 100644 --- a/Examples/ShaderToy/Shaders/PulsingTunnel.fs +++ b/Examples/ShaderToy/Shaders/PulsingTunnel.fs @@ -6,7 +6,7 @@ */ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/RTsphere.fs b/Examples/ShaderToy/Shaders/RTsphere.fs index 3a9b647..14b77e7 100644 --- a/Examples/ShaderToy/Shaders/RTsphere.fs +++ b/Examples/ShaderToy/Shaders/RTsphere.fs @@ -1,6 +1,6 @@ // https://www.shadertoy.com/view/ldS3DW -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/RadialBlur.fs b/Examples/ShaderToy/Shaders/RadialBlur.fs index aabb47c..bc8e13e 100644 --- a/Examples/ShaderToy/Shaders/RadialBlur.fs +++ b/Examples/ShaderToy/Shaders/RadialBlur.fs @@ -1,7 +1,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/RandomPipe.fs b/Examples/ShaderToy/Shaders/RandomPipe.fs index 9c0d120..828f7e4 100644 --- a/Examples/ShaderToy/Shaders/RandomPipe.fs +++ b/Examples/ShaderToy/Shaders/RandomPipe.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/ttsXW7 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/RayMarchPt1.fs b/Examples/ShaderToy/Shaders/RayMarchPt1.fs index 1986a35..271c211 100644 --- a/Examples/ShaderToy/Shaders/RayMarchPt1.fs +++ b/Examples/ShaderToy/Shaders/RayMarchPt1.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/RayMarchPt2.fs b/Examples/ShaderToy/Shaders/RayMarchPt2.fs index fc70daf..76be84a 100644 --- a/Examples/ShaderToy/Shaders/RayMarchPt2.fs +++ b/Examples/ShaderToy/Shaders/RayMarchPt2.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/RayMarchPt3.fs b/Examples/ShaderToy/Shaders/RayMarchPt3.fs index fa59568..5097c4d 100644 --- a/Examples/ShaderToy/Shaders/RayMarchPt3.fs +++ b/Examples/ShaderToy/Shaders/RayMarchPt3.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Rippley.fs b/Examples/ShaderToy/Shaders/Rippley.fs index a55cdf0..a51c491 100644 --- a/Examples/ShaderToy/Shaders/Rippley.fs +++ b/Examples/ShaderToy/Shaders/Rippley.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/SequenceStar.fs b/Examples/ShaderToy/Shaders/SequenceStar.fs index dafcd00..8339c46 100644 --- a/Examples/ShaderToy/Shaders/SequenceStar.fs +++ b/Examples/ShaderToy/Shaders/SequenceStar.fs @@ -3,7 +3,7 @@ // trisomie21 (THANKS!) // My apologies for the ugly code. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Shadowland.fs b/Examples/ShaderToy/Shaders/Shadowland.fs index 6871bfb..907ed36 100644 --- a/Examples/ShaderToy/Shaders/Shadowland.fs +++ b/Examples/ShaderToy/Shaders/Shadowland.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/ltyfDm -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/ShallowRiver.fs b/Examples/ShaderToy/Shaders/ShallowRiver.fs index 0711fdb..1d7ad52 100644 --- a/Examples/ShaderToy/Shaders/ShallowRiver.fs +++ b/Examples/ShaderToy/Shaders/ShallowRiver.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/MsXBRX -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/ShinySuperNova.fs b/Examples/ShaderToy/Shaders/ShinySuperNova.fs index b64d8bc..c3dc1c0 100644 --- a/Examples/ShaderToy/Shaders/ShinySuperNova.fs +++ b/Examples/ShaderToy/Shaders/ShinySuperNova.fs @@ -1,7 +1,7 @@ //https://www.shadertoy.com/view/XljXz3 // Updated from https://www.shadertoy.com/view/XdBSDh# -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Silexars.fs b/Examples/ShaderToy/Shaders/Silexars.fs index c24c600..d19c9c7 100644 --- a/Examples/ShaderToy/Shaders/Silexars.fs +++ b/Examples/ShaderToy/Shaders/Silexars.fs @@ -3,7 +3,7 @@ // http://www.pouet.net/prod.php?which=57245 // If you intend to reuse this shader, please add credits to 'Danilo Guanabara' -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/SimpleGalaxy.fs b/Examples/ShaderToy/Shaders/SimpleGalaxy.fs index fccd5cc..b713707 100644 --- a/Examples/ShaderToy/Shaders/SimpleGalaxy.fs +++ b/Examples/ShaderToy/Shaders/SimpleGalaxy.fs @@ -2,7 +2,7 @@ //Parallax scrolling fractal galaxy. //Inspired by JoshP's Simplicity shader: https://www.shadertoy.com/view/lslGWr -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/SimpleWater.fs b/Examples/ShaderToy/Shaders/SimpleWater.fs index afa1f45..1c2cd1d 100644 --- a/Examples/ShaderToy/Shaders/SimpleWater.fs +++ b/Examples/ShaderToy/Shaders/SimpleWater.fs @@ -3,7 +3,7 @@ // Attribution-ShareAlike CC License. //https://www.shadertoy.com/view/4slGRM -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/SimpleWormhole.fs b/Examples/ShaderToy/Shaders/SimpleWormhole.fs index cfe075e..1a35c4e 100644 --- a/Examples/ShaderToy/Shaders/SimpleWormhole.fs +++ b/Examples/ShaderToy/Shaders/SimpleWormhole.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/ld23Rw -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/SimplexNoise.fs b/Examples/ShaderToy/Shaders/SimplexNoise.fs index 956e60a..319016a 100644 --- a/Examples/ShaderToy/Shaders/SimplexNoise.fs +++ b/Examples/ShaderToy/Shaders/SimplexNoise.fs @@ -18,7 +18,7 @@ // Gradient Noise 3D : https://www.shadertoy.com/view/Xsl3Dl // Simplex Noise 2D : https://www.shadertoy.com/view/Msf3WH -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Sky001.fs b/Examples/ShaderToy/Shaders/Sky001.fs index 051c382..4ec0dd3 100644 --- a/Examples/ShaderToy/Shaders/Sky001.fs +++ b/Examples/ShaderToy/Shaders/Sky001.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/XsVGz3 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/SmallStars.fs b/Examples/ShaderToy/Shaders/SmallStars.fs index 5703985..d4e6bf5 100644 --- a/Examples/ShaderToy/Shaders/SmallStars.fs +++ b/Examples/ShaderToy/Shaders/SmallStars.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/XtlGW4 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Snowy.fs b/Examples/ShaderToy/Shaders/Snowy.fs index 5411440..165d14c 100644 --- a/Examples/ShaderToy/Shaders/Snowy.fs +++ b/Examples/ShaderToy/Shaders/Snowy.fs @@ -1,5 +1,5 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/SquareTunnel.fs b/Examples/ShaderToy/Shaders/SquareTunnel.fs index 4d591ef..6f203dc 100644 --- a/Examples/ShaderToy/Shaders/SquareTunnel.fs +++ b/Examples/ShaderToy/Shaders/SquareTunnel.fs @@ -8,7 +8,7 @@ // // More info: http://www.iquilezles.org/www/articles/tunnel/tunnel.htm -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Stage2boss.fs b/Examples/ShaderToy/Shaders/Stage2boss.fs index 61a49d7..04f70c3 100644 --- a/Examples/ShaderToy/Shaders/Stage2boss.fs +++ b/Examples/ShaderToy/Shaders/Stage2boss.fs @@ -7,7 +7,7 @@ // //////////////////////////////////////////////////////////////// -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Star.fs b/Examples/ShaderToy/Shaders/Star.fs index 34f384c..6b6c6eb 100644 --- a/Examples/ShaderToy/Shaders/Star.fs +++ b/Examples/ShaderToy/Shaders/Star.fs @@ -3,7 +3,7 @@ // This content is under the MIT License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Starline.fs b/Examples/ShaderToy/Shaders/Starline.fs index 47a47d2..f8d6feb 100644 --- a/Examples/ShaderToy/Shaders/Starline.fs +++ b/Examples/ShaderToy/Shaders/Starline.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/MssXDn -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Sunrise.fs b/Examples/ShaderToy/Shaders/Sunrise.fs index 6bf092f..cd467b1 100644 --- a/Examples/ShaderToy/Shaders/Sunrise.fs +++ b/Examples/ShaderToy/Shaders/Sunrise.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/SuperNova.fs b/Examples/ShaderToy/Shaders/SuperNova.fs index e1b5b7e..6dcc763 100644 --- a/Examples/ShaderToy/Shaders/SuperNova.fs +++ b/Examples/ShaderToy/Shaders/SuperNova.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/XdVXWc -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Tentacles.fs b/Examples/ShaderToy/Shaders/Tentacles.fs index eba1238..795b931 100644 --- a/Examples/ShaderToy/Shaders/Tentacles.fs +++ b/Examples/ShaderToy/Shaders/Tentacles.fs @@ -1,7 +1,7 @@ // Created by inigo quilez - iq/2014 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/TheDescent.fs b/Examples/ShaderToy/Shaders/TheDescent.fs index 3b8c128..968d268 100644 --- a/Examples/ShaderToy/Shaders/TheDescent.fs +++ b/Examples/ShaderToy/Shaders/TheDescent.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/llBSWh -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/ThreeBody.fs b/Examples/ShaderToy/Shaders/ThreeBody.fs index 1b83263..6e3ab00 100644 --- a/Examples/ShaderToy/Shaders/ThreeBody.fs +++ b/Examples/ShaderToy/Shaders/ThreeBody.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/wtsSRX -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/TileWater.fs b/Examples/ShaderToy/Shaders/TileWater.fs index 9d25a77..1e889c9 100644 --- a/Examples/ShaderToy/Shaders/TileWater.fs +++ b/Examples/ShaderToy/Shaders/TileWater.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/TinyClouds.fs b/Examples/ShaderToy/Shaders/TinyClouds.fs index 48f7a2a..0517f30 100644 --- a/Examples/ShaderToy/Shaders/TinyClouds.fs +++ b/Examples/ShaderToy/Shaders/TinyClouds.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Tissue.fs b/Examples/ShaderToy/Shaders/Tissue.fs index c32adc3..36a6024 100644 --- a/Examples/ShaderToy/Shaders/Tissue.fs +++ b/Examples/ShaderToy/Shaders/Tissue.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/TransSlices.fs b/Examples/ShaderToy/Shaders/TransSlices.fs index 617d761..dd17ae1 100644 --- a/Examples/ShaderToy/Shaders/TransSlices.fs +++ b/Examples/ShaderToy/Shaders/TransSlices.fs @@ -1,5 +1,5 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/TunnelBeauty.fs b/Examples/ShaderToy/Shaders/TunnelBeauty.fs index a359152..0e889a0 100644 --- a/Examples/ShaderToy/Shaders/TunnelBeauty.fs +++ b/Examples/ShaderToy/Shaders/TunnelBeauty.fs @@ -4,7 +4,7 @@ // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. // Tuned via XShade (http://www.funparadigm.com/xshade/) -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/TunnelSquares.fs b/Examples/ShaderToy/Shaders/TunnelSquares.fs index b85fcbc..53db87d 100644 --- a/Examples/ShaderToy/Shaders/TunnelSquares.fs +++ b/Examples/ShaderToy/Shaders/TunnelSquares.fs @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/TwistedColumns.fs b/Examples/ShaderToy/Shaders/TwistedColumns.fs index c049204..a3f067b 100644 --- a/Examples/ShaderToy/Shaders/TwistedColumns.fs +++ b/Examples/ShaderToy/Shaders/TwistedColumns.fs @@ -5,7 +5,7 @@ // this effect since around 1999. Only now it's antialiased, motion blurred, texture // filtered and high resolution. Uncomment line 40 to see the columns. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Underground.fs b/Examples/ShaderToy/Shaders/Underground.fs index 280ed0b..b6a63af 100644 --- a/Examples/ShaderToy/Shaders/Underground.fs +++ b/Examples/ShaderToy/Shaders/Underground.fs @@ -52,7 +52,7 @@ */ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iFrame; diff --git a/Examples/ShaderToy/Shaders/Velocibox.fs b/Examples/ShaderToy/Shaders/Velocibox.fs index b84b48b..2f1f633 100644 --- a/Examples/ShaderToy/Shaders/Velocibox.fs +++ b/Examples/ShaderToy/Shaders/Velocibox.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/lsdXD8 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/VogelsDistrib,fs.txt b/Examples/ShaderToy/Shaders/VogelsDistrib,fs.txt index 47d4caa..b6e8b42 100644 --- a/Examples/ShaderToy/Shaders/VogelsDistrib,fs.txt +++ b/Examples/ShaderToy/Shaders/VogelsDistrib,fs.txt @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/XtlXDM -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform vec3 iResolution; out vec4 fragColor; diff --git a/Examples/ShaderToy/Shaders/VogelsDistrib.fs b/Examples/ShaderToy/Shaders/VogelsDistrib.fs index b0a94f9..54a97f5 100644 --- a/Examples/ShaderToy/Shaders/VogelsDistrib.fs +++ b/Examples/ShaderToy/Shaders/VogelsDistrib.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/XtlXDM -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform vec3 iResolution; out vec4 fragColor; diff --git a/Examples/ShaderToy/Shaders/VolumetricLines.fs b/Examples/ShaderToy/Shaders/VolumetricLines.fs index 274d77a..0e93025 100644 --- a/Examples/ShaderToy/Shaders/VolumetricLines.fs +++ b/Examples/ShaderToy/Shaders/VolumetricLines.fs @@ -2,7 +2,7 @@ // Created by inigo quilez - iq/2013 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/VoronoiDistances.fs b/Examples/ShaderToy/Shaders/VoronoiDistances.fs index 068de34..fc6caae 100644 --- a/Examples/ShaderToy/Shaders/VoronoiDistances.fs +++ b/Examples/ShaderToy/Shaders/VoronoiDistances.fs @@ -19,7 +19,7 @@ // Smooth: https://www.shadertoy.com/view/ldB3zc // Voronoise: https://www.shadertoy.com/view/Xd23Dh -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Voronot.fs b/Examples/ShaderToy/Shaders/Voronot.fs index 344631e..defb3dc 100644 --- a/Examples/ShaderToy/Shaders/Voronot.fs +++ b/Examples/ShaderToy/Shaders/Voronot.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/4tXGW4 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Warping2.fs b/Examples/ShaderToy/Shaders/Warping2.fs index 5b4c18f..43cccd8 100644 --- a/Examples/ShaderToy/Shaders/Warping2.fs +++ b/Examples/ShaderToy/Shaders/Warping2.fs @@ -8,7 +8,7 @@ //==================================================================== -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/WaterCaustic.fs b/Examples/ShaderToy/Shaders/WaterCaustic.fs index c5d6d31..c7cf529 100644 --- a/Examples/ShaderToy/Shaders/WaterCaustic.fs +++ b/Examples/ShaderToy/Shaders/WaterCaustic.fs @@ -6,7 +6,7 @@ // Inspired by akohdr's "Fluid Fields" // https://www.shadertoy.com/view/XsVSDm -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/Wormhole.fs b/Examples/ShaderToy/Shaders/Wormhole.fs index 36ce5c0..42fe88c 100644 --- a/Examples/ShaderToy/Shaders/Wormhole.fs +++ b/Examples/ShaderToy/Shaders/Wormhole.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/4ll3zX -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/XmasFractals.fs b/Examples/ShaderToy/Shaders/XmasFractals.fs index abe0087..21826a6 100644 --- a/Examples/ShaderToy/Shaders/XmasFractals.fs +++ b/Examples/ShaderToy/Shaders/XmasFractals.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/Xdj3Wh -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/ZoomNoise.fs b/Examples/ShaderToy/Shaders/ZoomNoise.fs index e2aff38..a90a574 100644 --- a/Examples/ShaderToy/Shaders/ZoomNoise.fs +++ b/Examples/ShaderToy/Shaders/ZoomNoise.fs @@ -1,5 +1,5 @@ //https://www.shadertoy.com/view/MlyGWR -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/fs1.glsl b/Examples/ShaderToy/Shaders/fs1.glsl index 511d763..ae97a40 100644 --- a/Examples/ShaderToy/Shaders/fs1.glsl +++ b/Examples/ShaderToy/Shaders/fs1.glsl @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform sampler2D u_Texture; // texture diff --git a/Examples/ShaderToy/Shaders/laserTunnel.fs b/Examples/ShaderToy/Shaders/laserTunnel.fs index b835b11..0917c4f 100644 --- a/Examples/ShaderToy/Shaders/laserTunnel.fs +++ b/Examples/ShaderToy/Shaders/laserTunnel.fs @@ -1,6 +1,6 @@ //https://www.shadertoy.com/view/XdfSz7 -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/rainWaterRipple.fs b/Examples/ShaderToy/Shaders/rainWaterRipple.fs index 16795db..ac73f93 100644 --- a/Examples/ShaderToy/Shaders/rainWaterRipple.fs +++ b/Examples/ShaderToy/Shaders/rainWaterRipple.fs @@ -1,7 +1,7 @@ //Render final image, compute some lighting using normals generated in previews buffers //https://www.shadertoy.com/view/Mt33DH -#version 300 es +#version 310 es precision highp float; // Set the default precision to medium uniform float iTime; diff --git a/Examples/ShaderToy/Shaders/vs1.glsl b/Examples/ShaderToy/Shaders/vs1.glsl index 4af9ce5..f4dbe41 100644 --- a/Examples/ShaderToy/Shaders/vs1.glsl +++ b/Examples/ShaderToy/Shaders/vs1.glsl @@ -1,4 +1,4 @@ -#version 300 es +#version 310 es in vec3 a_Position; diff --git a/Examples/ShaderToy/Source/Shadertoy.cpp b/Examples/ShaderToy/Source/Shadertoy.cpp index 22e0309..96888cd 100644 --- a/Examples/ShaderToy/Source/Shadertoy.cpp +++ b/Examples/ShaderToy/Source/Shadertoy.cpp @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) Pi3Cshader& shader = resource.shaders[shaderRefs[shaderSelect]]; Pi3Cmesh rectmesh = resource.createRect(vec3f(-1.f, -1.f, 0), vec2f(2.f, 2.f), 0xffffffff); - int32_t rectmeshref = resource.addMesh(&rectmesh); + int32_t rectmeshref = resource.addMesh(&rectmesh,0); uint32_t frames = 0; uint32_t timer = SDL_GetTicks(); @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) while (!window.hasquit()) { - std::vector eventList = window.event(); + std::vector eventList = window.events(); for (auto& ev : eventList) { switch (ev) diff --git a/Examples/ShaderToy/makefile b/Examples/ShaderToy/makefile index c50d059..34c0a65 100644 --- a/Examples/ShaderToy/makefile +++ b/Examples/ShaderToy/makefile @@ -2,7 +2,7 @@ TARGET = ShaderToy CC = g++ CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -10,18 +10,24 @@ FILE_DIR:= ../../SharedCode/file UI_DIR:= ../../SharedCode/ui HELPS_DIR:= ../../SharedCode/helpers TESS_DIR:= ../../SharedCode/glutess +RJSON_DIR:= ../../ThirdParty/rapidjson +FBX_DIR:= ../../ThirdParty/openFBX +GLTF_DIR:= ../../ThirdParty/gltf CPATH = $(SHARED_DIR) CPATH = $(FILE_DIR) CPATH = $(UI_DIR) CPATH = $(HELPS_DIR) CPATH = $(TESS_DIR) +CPATH = $(RJSON_DIR) +CPATH = $(FBX_DIR) +CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) -SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) Source +SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source BUILD_DIR:= $(addprefix $(BUILDPATH),$(SRC_DIR)) SRC:= $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp $(sdir)/*.c)) diff --git a/Examples/Snow/Snow b/Examples/Snow/Snow deleted file mode 100755 index a51aa5a..0000000 Binary files a/Examples/Snow/Snow and /dev/null differ diff --git a/Examples/Snow/assets/shaders/fs1.glsl b/Examples/Snow/assets/shaders/fs1.glsl index 9ad6156..6dea8de 100644 --- a/Examples/Snow/assets/shaders/fs1.glsl +++ b/Examples/Snow/assets/shaders/fs1.glsl @@ -1,12 +1,13 @@ -//precision mediump float; // Set the default precision to medium +#version 310 es +precision mediump float; // Set the default precision to medium uniform sampler2D u_Texture; // texture -varying vec2 v_UV; // Texture UV coordinate -varying vec4 v_diffuseColour; // Diffuse colour -varying vec4 v_fogColour; // Fog colour - +in vec2 v_UV; // Texture UV coordi_nate +in vec4 v_diffuseColour; // Diffuse colour +in vec4 v_fogColour; // Fog colour +out vec4 FragColor; void main() { vec4 col = texture2D(u_Texture, v_UV) * v_diffuseColour + v_fogColour; - if (col.a > 0.01) gl_FragColor = col; else discard; + if (col.a > 0.01) FragColor = col; else discard; } diff --git a/Examples/Snow/assets/shaders/vs1.glsl b/Examples/Snow/assets/shaders/vs1.glsl index c6ec3f8..d5ae460 100644 --- a/Examples/Snow/assets/shaders/vs1.glsl +++ b/Examples/Snow/assets/shaders/vs1.glsl @@ -1,11 +1,12 @@ -//precision mediump float; // Set the default precision to medium. We don't need as high of a +#version 310 es +precision mediump float; // Set the default precision to medium -uniform mat4 u_ProjMatrix; // view/projection matrix. -uniform mat4 u_ModelMatrix; // model matrix. -uniform vec3 u_LightPos; // The position of the light in eye space. -uniform vec4 u_lightColour; // The colour of light in eye space. -uniform int u_illuminationModel; // If ==2 then apply illumation model -uniform int u_reflective; // +uniform mat4 u_ProjMatrix; +uniform mat4 u_ModelMatrix; +uniform vec3 u_LightPos; +uniform vec4 u_lightColour; +uniform int u_illumi_nationModel; +uniform int u_reflective; uniform vec2 u_animoffset; uniform vec4 u_diffuseColour; @@ -15,15 +16,15 @@ uniform vec4 u_specularColour; uniform vec3 u_fogColour; uniform float u_fogMaxDist; -uniform float u_fogRange; // effectively 1.0 / (fogMaxDist-fogMinDist) +uniform float u_fogRange; -attribute vec3 a_Position; -attribute vec3 a_Normal; -attribute vec2 a_UV; +in vec3 a_Position; +in vec3 a_Normal; +in vec2 a_UV; -varying vec2 v_UV; -varying vec4 v_diffuseColour; -varying vec4 v_fogColour; +out vec2 v_UV; +out vec4 v_diffuseColour; +out vec4 v_fogColour; //varying vec3 v_Normal; ///varying vec3 v_LightPos; @@ -45,7 +46,7 @@ void main() vec4 emitColour = max(u_lightColour, u_emissiveColour); float fogFactor = (Position.z + u_fogMaxDist) * u_fogRange; // / (fogMaxDist-fogMinDist) fogFactor = clamp(fogFactor, 0.0, 1.0); - //if (u_illuminationModel == 1) fogFactor = 1.0; + //if (u_illumi_nationModel == 1) fogFactor = 1.0; v_fogColour = vec4((u_fogColour * (1.0 - fogFactor)),0.0) * u_lightColour; // Calc lighting and specular and mix into fogColour @@ -54,7 +55,7 @@ void main() vec4 diffuseCol = u_diffuseColour * emitColour; // apply shade and fog ... - if (u_illuminationModel == 2) { + if (u_illumi_nationModel == 2) { float rDotV = max(dot(Normal, lightVector), 0.1); fogFactor = fogFactor * rDotV; //rDotV = max(0.0, dot(lightVector, Normal)); diff --git a/Examples/Snow/makefile b/Examples/Snow/makefile index f750f98..281f85b 100644 --- a/Examples/Snow/makefile +++ b/Examples/Snow/makefile @@ -2,7 +2,7 @@ TARGET = Snow CC = g++ CFLAGS = -std=c++17 -Wall -LDLIBS = -lGL -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDLIBS = -lGLESv2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf LDFLAGS = $(shell sdl2-config --cflags --libs) SHARED_DIR:= ../../SharedCode/core @@ -10,18 +10,24 @@ FILE_DIR:= ../../SharedCode/file UI_DIR:= ../../SharedCode/ui HELPS_DIR:= ../../SharedCode/helpers TESS_DIR:= ../../SharedCode/glutess +RJSON_DIR:= ../../ThirdParty/rapidjson +FBX_DIR:= ../../ThirdParty/openFBX +GLTF_DIR:= ../../ThirdParty/gltf CPATH = $(SHARED_DIR) CPATH = $(FILE_DIR) CPATH = $(UI_DIR) CPATH = $(HELPS_DIR) CPATH = $(TESS_DIR) +CPATH = $(RJSON_DIR) +CPATH = $(FBX_DIR) +CPATH = $(GLTF_DIR) BUILDPATH = ../../../_build/Projects/$(TARGET)/ -GLES_DIR = /opt/vc/include +GLES_DIR = /usr/include CPATH = $(GLES_DIR) -SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) Source +SRC_DIR:= $(SHARED_DIR) $(FILE_DIR) $(UI_DIR) $(HELPS_DIR) $(TESS_DIR) $(GLES_DIR) $(RJSON_DIR) $(FBX_DIR) $(GLTF_DIR) Source BUILD_DIR:= $(addprefix $(BUILDPATH),$(SRC_DIR)) SRC:= $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp $(sdir)/*.c)) diff --git a/Installer.sh b/Installer.sh index a4c352a..c474d7f 100644 --- a/Installer.sh +++ b/Installer.sh @@ -1,89 +1,12 @@ #!/bin/sh -CONFIG=/boot/config.txt -ASK_TO_REBOOT=0 -echo "Installing SDl 2.0 libraries ..." + +echo "Installing SDL 2.0, g++ and glut libraries ..." # Install packages -PACKAGES="libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-net-dev" +PACKAGES="libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-net-dev build-essential freeglut3-dev glslang-tools renderdoc" apt-get update apt-get upgrade -y apt-get install $PACKAGES -y -is_pione() { - if grep -q "^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo; then - return 0 - elif grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[0-36][0-9a-fA-F]$" /proc/cpuinfo ; then - return 0 - else - return 1 - fi -} - -is_pitwo() { - grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]04[0-9a-fA-F]$" /proc/cpuinfo - return $? -} - -is_pizero() { - grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[9cC][0-9a-fA-F]$" /proc/cpuinfo - return $? -} - -is_pifour() { - grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F]3[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo - return $? -} - -#Enable GL driver support (Pi4 / other Pi's) - pinched from Raspi-config settings -if is_pifour ; then - if is_pifour ; then - if ! grep -q -E "^dtoverlay=vc4-fkms-v3d" $CONFIG; then - ASK_TO_REBOOT=1 - fi - else - if ! sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q "^dtoverlay=vc4-fkms-v3d" ; then - ASK_TO_REBOOT=1 - fi - fi - sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/g" - sed $CONFIG -i -e "s/^#dtoverlay=vc4-fkms-v3d/dtoverlay=vc4-fkms-v3d/g" - if ! sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q "^dtoverlay=vc4-fkms-v3d" ; then - printf "[all]\ndtoverlay=vc4-fkms-v3d\n" >> $CONFIG - fi - echo "The fake KMS GL driver is enabled on the Pi4." -else - if ! sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q "^dtoverlay=vc4-kms-v3d" ; then - ASK_TO_REBOOT=1 - fi - sed $CONFIG -i -e "s/^dtoverlay=vc4-fkms-v3d/#dtoverlay=vc4-fkms-v3d/g" - sed $CONFIG -i -e "s/^#dtoverlay=vc4-kms-v3d/dtoverlay=vc4-kms-v3d/g" - if ! sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q "^dtoverlay=vc4-kms-v3d" ; then - printf "[all]\ndtoverlay=vc4-kms-v3d\n" >> $CONFIG - fi - echo "The full KMS GL driver is enabled." -fi - -# If a line containing "gpu_mem" exists -if grep -Fq "gpu_mem" $CONFIG -then - # Replace the line - echo "Modifying gpu_mem" - sed -i "/gpu_mem/c\gpu_mem=64" $CONFIG -else - # Create the definition - echo "gpu_mem not defined. Creating definition" - echo "gpu_mem=64" >> $CONFIG -fi - -# if [ $ASK_TO_REBOOT -eq 1 ]; then -# whiptail --yesno "Would you like to reboot now?" 20 60 2 -# if [ $? -eq 0 ]; then # yes -# sync -# reboot -# fi -# fi - -echo "Install complete, please reboot ..." -#reboot \ No newline at end of file diff --git a/README.md b/README.md index c5bc635..8148d3e 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,68 @@ # Pi3C *v0.0.2 Alpha* -Pi3C is a fast, C++ graphics engine and toolkit tailored for all models of the Raspberry Pi and works on other platforms such as Windows. It's small size and innovative techniques make it fast enough to run highly detailed 3D games; even on the Pi Zero ... +Pi3C is a fast, C++ graphics engine and toolkit tailored for Raspberry Pi 5. It's small size and innovative techniques make it fast enough to run highly detailed 3D games ... + +Supported + +SBC | Supported | Notes +--- | --- | --- | +Raspberry Pi 5 | :white_check_mark: | N/A +Raspberry Pi 4 | N/A | N/A +Raspberry Pi 3 | :x: | N/A +Raspberry Pi 2 | :x: | N/A +Rock 5B | :white_check_mark: | N/A +Windows | :x: | N/A + + + +Examples + + +Example | Working +--- | --- | +CastleCreator | :white_check_mark: +Blocks | :x: +3D modeller | :x: +Extruder | :x: +HelloWorld | :white_check_mark: +Invaders | :x: +MD viewer | :x: +NoahsArk | :x: +PerlinMap | :x: +ShaderToy | :white_check_mark: +Snow | :white_check_mark: + + + + + + + +**click image to watch video** + +[![IMAGE ALT TEXT](https://github.com/timskillman/Pi3C/blob/master/Resources/images/ShipRear.jpg)](https://www.youtube.com/watch?v=u-quGjXq7Wk "Video Title") + -![alt text](https://github.com/timskillman/Pi3C/blob/master/Resources/images/ShipRear.jpg "Complex 3D models even on the Pi Zero") Or, how about a Minecraft style game? ... -![alt text](https://github.com/timskillman/Pi3C/blob/master/Resources/images/Blocks1.jpg "Or, a Minecraft style game!") +**click image to watch video** + +[![IMAGE ALT TEXT](https://github.com/timskillman/Pi3C/blob/master/Resources/images/Blocks1.jpg)](https://www.youtube.com/watch?v=QW6xsagLT6g "Video Title") + +[![IMAGE ALT TEXT](https://github.com/randomnumgen1/Pi3C_RPI5/raw/master/docs/screenshots/castle_example.png)](https://www.youtube.com/watch?v=UHarQpdyqpg "Video Title") + + + + + + + + + + + Pi3C is designed to be simple to use and encourage youngsters (or anyone) new to programming by exploring the basic tutorials, games and apps provided. @@ -18,7 +73,7 @@ These range from a few lines of simple, self explained code to more complex, rea Pi3C tries to avoid the complexities of C++ by providing a top-level class called Pi3C. This class has simple commands to help you start your journey into the exciting world of C++ programming. Pi3C's utilizes the 'Simple DirectMedia Layer' (SDL 2.0) cross-platform development library (https://www.libsdl.org/). -Pi3C provides functions to render Open GLES 2.0 graphics using shaders. It also provides a high speed, Immediate Mode Graphics User Interface (IMGUI) with various buttons, text and common widgets. Using these functions, complex Apps and games can be made with relative ease. +Pi3C provides functions to render Open GLES 3.1 graphics using shaders. It also provides a high speed, Immediate Mode Graphics User Interface (IMGUI) with various buttons, text and common widgets. Using these functions, complex Apps and games can be made with relative ease. Pi3C will also includes tools for 3D modelling and scene arrangemet with 1st person capabilites for testing scenes such as free flight, point and jump, and full screen renderng. Other tools planned will include an IMGUI interface designer and C++ code generator that will jump-start your project. @@ -100,7 +155,7 @@ C++ is one of the most popular, industry standard programming languages. **You will need the following parts** - - Raspberry Pi (preferably 3/4 for faster compiling) + - Raspberry Pi (preferably 4/5 for faster compiling) - 5 volt, 2.5 amp power supply with Micro-USB connector - Keyboard and Mouse - Monitor or TV with HMDI @@ -121,7 +176,7 @@ Git is usually installed with the Raspberry Pi OS, but if not, download Git with Make sure you're in the 'home/pi' directory (indicated by the ~ (tilde character) with nothing after it) and enter; ~~~~ -git clone https://github.com/timskillman/Pi3C.git +git clone https://github.com/randomnumgen1/Pi3C_RPI5.git Pi3C ~~~~ Pi3C will be cloned onto your Pi and a Pi3C directory, with all the necessary code and resources, will be downloaded. diff --git a/SharedCode/core/Pi3CGL.h b/SharedCode/core/Pi3CGL.h index e8bd5cb..d47ebda 100644 --- a/SharedCode/core/Pi3CGL.h +++ b/SharedCode/core/Pi3CGL.h @@ -9,28 +9,13 @@ #pragma comment (lib, "glew32s.lib") #endif /* __WINDOWS__ (*** must come before SDL.h ***) */ -#include +#include #include #include -#ifdef __IPHONEOS__ -#include -#include -#endif /* __IPHONEOS__ */ - -#ifdef __WINDOWS__ -#include -#include -#elif defined (__LINUX__) && defined(__arm__) -#include -#include -#include -#include -#elif defined (__LINUX__) && defined(__i386__) #define GL_GLEXT_PROTOTYPES #include #include -#endif // ======================================================================= // Pi3C Raspberry Pi Graphics Library diff --git a/SharedCode/core/Pi3Cscene.cpp b/SharedCode/core/Pi3Cscene.cpp index 59b4724..8929b5a 100644 --- a/SharedCode/core/Pi3Cscene.cpp +++ b/SharedCode/core/Pi3Cscene.cpp @@ -368,7 +368,7 @@ void Pi3Cscene::renderOffscreen(const viewInfo& viewinfo, Pi3Cmaterial* outlines glGenRenderbuffers(1, &colour_buf); glBindRenderbuffer(GL_RENDERBUFFER, colour_buf); - glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8_OES, width, height); + glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, width, height); glGenRenderbuffers(1, &depth_buf); glBindRenderbuffer(GL_RENDERBUFFER, depth_buf); diff --git a/SharedCode/core/Pi3Cshader.cpp b/SharedCode/core/Pi3Cshader.cpp index 79bc150..c1833e1 100644 --- a/SharedCode/core/Pi3Cshader.cpp +++ b/SharedCode/core/Pi3Cshader.cpp @@ -61,7 +61,7 @@ bool Pi3Cshader::CreateShaderProgram(const GLuint &vertexShader, const GLuint &f std::istringstream ss(attribStr); std::string s; uint32_t a = 0; - while (ss >> s) glBindAttribLocation(program, a++, s.c_str()); + //while (ss >> s) glBindAttribLocation(program, a++, s.c_str()); stride = DEFAULT_STRIDE; glLinkProgram(program); //linking @@ -174,7 +174,7 @@ void Pi3Cshader::setupShader() //Set this AFTER shader.Use // Basic rendering handles - illuminationModelRef = GetUniformLocation("u_illuminationModel"); + illuminationModelRef = GetUniformLocation("u_illumi_nationModel"); fogColourRef = GetSet3f("u_fogColour", fogColour); fogRangeRef = GetSetf("u_fogRange", 1.f / (fogMaxDist - fogMinDist)); fogMaxRef = GetSetf("u_fogMaxDist", fogMaxDist); diff --git a/SharedCode/core/Pi3Cwin.cpp b/SharedCode/core/Pi3Cwin.cpp index 01e436c..0a32bfd 100644 --- a/SharedCode/core/Pi3Cwin.cpp +++ b/SharedCode/core/Pi3Cwin.cpp @@ -22,17 +22,17 @@ void Pi3Cwindow::initOptions(const options &opts) mHeight = opts.height; if (init(opts.title.c_str(), opts.width, opts.height, opts.sdlflags | ((opts.fullscreen) ? SDL_WINDOW_FULLSCREEN : 0) | SDL_WINDOW_ALLOW_HIGHDPI, opts.antialiasLevel)) { - SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); - //SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); + //SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, opts.bufferSize); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, opts.depthSize); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, opts.majorVsn); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, opts.minorVsn); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3/*opts.majorVsn*/); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1/*opts.minorVsn*/); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, (opts.doubleBuffer) ? 1:0); SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); GLcontext = SDL_GL_CreateContext(mWindow); - SDL_GL_SetSwapInterval(-1); + SDL_GL_SetSwapInterval(0); SDL_GL_MakeCurrent(mWindow, GLcontext); glDepthFunc(GL_LEQUAL); glEnable(GL_DEPTH_TEST); diff --git a/SharedCode/helpers/Pi3Cutils.cpp b/SharedCode/helpers/Pi3Cutils.cpp index 93d6457..ebbc95e 100644 --- a/SharedCode/helpers/Pi3Cutils.cpp +++ b/SharedCode/helpers/Pi3Cutils.cpp @@ -165,23 +165,7 @@ namespace Pi3Cutils { void drawRect2D(vec3f pos, vec3f size, uint32_t colour) { - glColor4f((GLfloat)(colour & 255) / 255.f, (GLfloat)((colour >> 8) & 255) / 255.f, (GLfloat)((colour >> 16) & 255) / 255.f, (GLfloat)((colour >> 24) & 255) / 255.f); - //glColor4f(1.f, 1.f, 1.f, 1.f); - - static vec3f verts[4]; - static uint16_t inds[4] = { 0,1,2,3 }; - - verts[0] = pos; - verts[1] = pos + vec3f(0, size.y, 0); - verts[2] = pos + vec3f(size.x, 0, 0); - verts[3] = pos + vec3f(size.x, size.y, 0); - - glDisableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY); - glDisable(GL_BLEND); - glDisable(GL_CULL_FACE); - glVertexPointer(3, GL_FLOAT, 0, verts); - glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_SHORT, inds); + throw std::invalid_argument( "received negative value" ); } } diff --git a/SharedCode/helpers/Pi3Cutils.h b/SharedCode/helpers/Pi3Cutils.h index e9ecb64..f713ec0 100644 --- a/SharedCode/helpers/Pi3Cutils.h +++ b/SharedCode/helpers/Pi3Cutils.h @@ -4,6 +4,7 @@ #include "Pi3Crect.h" #include #include +#include namespace Pi3Cutils { diff --git a/c_m_a_k_e_list.txt b/c_m_a_k_e_list.txt new file mode 100644 index 0000000..1cab392 --- /dev/null +++ b/c_m_a_k_e_list.txt @@ -0,0 +1,35 @@ +# CMakeLists.txt +cmake_minimum_required(VERSION 3.10) + +set(PROJECT_NAME castlecreator) +project(castlecreator) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +# Find package +find_package(OpenGL) +find_package(SDL2 REQUIRED) +find_package(PkgConfig REQUIRED) +pkg_check_modules(SDL2 REQUIRED sdl2 SDL2_ttf SDL2_mixer SDL2_image) +pkg_check_modules(GLEW REQUIRED glew) + +# Include directories +target_include_directories(testapp PUBLIC ${SDL2_INCLUDE_DIRS}) +# +# Find sources recursively +file(GLOB_RECURSE SOURCE_FILES "src/*.cpp") +file(GLOB_RECURSE HEADER_FILES "src/*.h") +file(GLOB_RECURSE DEBUG_SOURCE_FILES "src/*.cc") +file(GLOB_RECURSE DEBUG_HEADER_FILES "src/*.hpp") +# Add executable +add_executable(${PROJECT_NAME} main.cpp) + +# Link libraries +target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES} + ${LIB_GLM_LIBRARIES} + + ) + +# Add compile definitions +add_definitions(${SDL2_CFLAGS_OTHER}) \ No newline at end of file diff --git a/docs/extra.html b/docs/extra.html new file mode 100644 index 0000000..0d1b86c --- /dev/null +++ b/docs/extra.html @@ -0,0 +1,14 @@ + + + + Pi3C - extra + + + + + + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..2b298e8 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,14 @@ + + + + Pi3C - Home + + + + + + + + \ No newline at end of file diff --git a/docs/install.html b/docs/install.html new file mode 100644 index 0000000..39478f2 --- /dev/null +++ b/docs/install.html @@ -0,0 +1,14 @@ + + + + Pi3C - Install + + + + + + + + \ No newline at end of file diff --git a/docs/screenshots/Blocks1.jpg b/docs/screenshots/Blocks1.jpg new file mode 100644 index 0000000..b5b124a Binary files /dev/null and b/docs/screenshots/Blocks1.jpg differ diff --git a/docs/screenshots/ShipRear.jpg b/docs/screenshots/ShipRear.jpg new file mode 100644 index 0000000..f524cee Binary files /dev/null and b/docs/screenshots/ShipRear.jpg differ diff --git a/docs/screenshots/castle_example.png b/docs/screenshots/castle_example.png new file mode 100644 index 0000000..d68a892 Binary files /dev/null and b/docs/screenshots/castle_example.png differ diff --git a/docs/screenshots/snowpath.jpg b/docs/screenshots/snowpath.jpg new file mode 100644 index 0000000..c9867f2 Binary files /dev/null and b/docs/screenshots/snowpath.jpg differ