+++ /dev/null
-#version 450
-
-out vec4 color;
-
-void main()
-{
- color = vec4(1.0, 0.0, 1.0, 1.0);
-}
+++ /dev/null
-#version 450
-
-uniform mat4 mmviewproj;
-
-layout(location = 1) in vec3 attr_pos;
-
-void main()
-{
- gl_Position = mmviewproj * vec4(attr_pos, 1.0);
-}
+++ /dev/null
-#version 450
-
-#define SHADING_UNIFORMS 1
-
-layout(binding = 0) uniform sampler2D tex;
-layout(binding = 1) uniform samplerCube dstex;
-
-layout(std140, binding = SHADING_UNIFORMS) uniform fu {
- vec4 diffuse;
- vec4 specular;
- float shininess;
- float fog_density;
-} s;
-
-const vec3 sky_color = vec3(0.35, 0.5, 0.65);
-// const float fog_density = 0.005;
-
-/* varyings */
-layout(location = 4) in vec3 pos;
-layout(location = 5) in vec2 tex_coord;
-layout(location = 6) in vec3 world_normal;
-
-layout(location = 0) out vec4 color;
-
-void main()
-{
- vec4 itexel = textureCube(dstex, normalize(world_normal));
-
- float dist = -pos.z;
- float fog = clamp(exp(-s.fog_density * dist), 0.0, 1.0);
-
- vec4 texel = texture2D(tex, tex_coord);
-
- // vec3 object_color = (diffuse.xyz * cdiff * texel.xyz + specular.xyz * cspec) * itexel.xyz;
- vec3 object_color = s.diffuse.xyz * texel.xyz * itexel.xyz;
-
- color.xyz = mix(sky_color, object_color, fog);
- color.w = 1.0;
-}
+++ /dev/null
-#version 450
-
-#define MATRIX_UNIFORMS 0
-
-layout(std140, binding = MATRIX_UNIFORMS) uniform vu {
- mat4 mview;
- uniform mat4 mmviewproj;
- uniform mat4 mmod;
-} m;
-
-const vec3 lpos = vec3(-10.0, 100.0, 10.0);
-
-/* attributes */
-layout(location = 1) in vec3 attr_pos;
-layout(location = 2) in vec3 attr_normal;
-layout(location = 3) in vec2 attr_tex;
-
-/* varyings */
-layout(location = 4) out vec3 pos;
-layout(location = 5) out vec2 tex_coord;
-layout(location = 6) out vec3 world_normal;
-
-void main()
-{
- gl_Position = m.mmviewproj * vec4(attr_pos, 1.0);
-
- pos = (m.mview * vec4(attr_pos, 1.0)).xyz;
- tex_coord = attr_tex;
-
- world_normal = (m.mmod * vec4(attr_normal, 1.0)).xyz;
-}
+++ /dev/null
-#version 450
-
-#define SHADING_UNIFORMS 1
-
-layout(binding = 0) uniform sampler2D tex;
-layout(binding = 1) uniform samplerCube dstex;
-
-layout(std140, binding = SHADING_UNIFORMS) uniform fu {
- vec4 diffuse;
- vec4 specular;
- float shininess;
- float fog_density;
-} s;
-
-/* varyings */
-layout(location = 4) in vec3 pos;
-layout(location = 5) in vec2 tex_coord;
-layout(location = 6) in vec3 world_normal;
-
-layout(location = 0) out vec4 color;
-
-const vec3 sky_color = vec3(0.35, 0.5, 0.65);
-
-void main()
-{
- vec4 itexel = textureCube(dstex, normalize(world_normal));
- vec4 texel = texture2D(tex, tex_coord);
- vec3 object_color = s.diffuse.xyz * texel.xyz * itexel.xyz;
- float dist = -pos.z;
- float fog = clamp(exp(-s.fog_density * dist), 0.0, 1.0);
-
- color.xyz = mix(sky_color, object_color, fog);
- color.w = 1.0;
-}
+++ /dev/null
-#version 450
-
-#define MATRIX_UNIFORMS 0
-#define MORPHING_UNIFORMS 3
-
-layout(std140, binding = MATRIX_UNIFORMS) uniform vu {
- mat4 mview;
- uniform mat4 mmviewproj;
- uniform mat4 mmod;
-} m;
-
-layout(std140, binding = MORPHING_UNIFORMS) uniform mvu {
- float t;
-} time;
-
-/* attributes */
-layout(location = 1) in vec3 attr_pos;
-layout(location = 2) in vec3 attr_normal;
-layout(location = 3) in vec2 attr_tex;
-
-/* varyings */
-layout(location = 4) out vec3 pos;
-layout(location = 5) out vec2 tex_coord;
-layout(location = 6) out vec3 world_normal;
-
-const float half_height = 0.855;
-
-void main()
-{
- vec3 sph_pos = normalize(vec3(attr_pos.x, attr_pos.y - half_height, attr_pos.z));
-
- vec3 sph_normal = sph_pos;
- sph_pos.y += half_height;
-
- vec3 p = mix(attr_pos, sph_pos, time.t);
- vec3 n = mix(attr_normal, sph_normal, time.t);
-
- gl_Position = m.mmviewproj * vec4(p, 1.0);
-
- pos = (m.mview * vec4(p, 1.0)).xyz;
-
- tex_coord = attr_tex;
- world_normal = (m.mmod * vec4(attr_normal, 1.0)).xyz;
-}
+++ /dev/null
-#version 450
-
-layout(binding = 0) uniform samplerCube stex;
-
-in vec3 normal;
-out vec4 color;
-
-void main()
-{
- vec4 texel = textureCube(stex, normalize(normal));
-
- color.rgb = texel.rgb;
- color.a = 1.0;
-}
+++ /dev/null
-#version 450
-
-#define SKY_MATRIX_UNIFORMS 2
-
-layout(std140, binding = SKY_MATRIX_UNIFORMS) uniform svu {
- mat4 mviewproj;
-} s;
-
-
-layout(location = 1) in vec3 attr_pos;
-layout(location = 2) in vec3 attr_normal;
-
-out vec3 normal;
-
-void main()
-{
- gl_Position = s.mviewproj * vec4(attr_pos, 1.0);
- normal = attr_normal;
-}
--- /dev/null
+#version 450
+
+out vec4 color;
+
+void main()
+{
+ color = vec4(1.0, 0.0, 1.0, 1.0);
+}
--- /dev/null
+#version 450
+
+uniform mat4 mmviewproj;
+
+layout(location = 1) in vec3 attr_pos;
+
+void main()
+{
+ gl_Position = mmviewproj * vec4(attr_pos, 1.0);
+}
--- /dev/null
+#version 450
+
+#define SHADING_UNIFORMS 1
+
+layout(binding = 0) uniform sampler2D tex;
+layout(binding = 1) uniform samplerCube dstex;
+
+layout(std140, binding = SHADING_UNIFORMS) uniform fu {
+ vec4 diffuse;
+ vec4 specular;
+ float shininess;
+ float fog_density;
+} s;
+
+const vec3 sky_color = vec3(0.35, 0.5, 0.65);
+// const float fog_density = 0.005;
+
+/* varyings */
+layout(location = 4) in vec3 pos;
+layout(location = 5) in vec2 tex_coord;
+layout(location = 6) in vec3 world_normal;
+
+layout(location = 0) out vec4 color;
+
+void main()
+{
+ vec4 itexel = textureCube(dstex, normalize(world_normal));
+
+ float dist = -pos.z;
+ float fog = clamp(exp(-s.fog_density * dist), 0.0, 1.0);
+
+ vec4 texel = texture2D(tex, tex_coord);
+
+ // vec3 object_color = (diffuse.xyz * cdiff * texel.xyz + specular.xyz * cspec) * itexel.xyz;
+ vec3 object_color = s.diffuse.xyz * texel.xyz * itexel.xyz;
+
+ color.xyz = mix(sky_color, object_color, fog);
+ color.w = 1.0;
+}
--- /dev/null
+#version 450
+
+#define MATRIX_UNIFORMS 0
+
+layout(std140, binding = MATRIX_UNIFORMS) uniform vu {
+ mat4 mview;
+ uniform mat4 mmviewproj;
+ uniform mat4 mmod;
+} m;
+
+const vec3 lpos = vec3(-10.0, 100.0, 10.0);
+
+/* attributes */
+layout(location = 1) in vec3 attr_pos;
+layout(location = 2) in vec3 attr_normal;
+layout(location = 3) in vec2 attr_tex;
+
+/* varyings */
+layout(location = 4) out vec3 pos;
+layout(location = 5) out vec2 tex_coord;
+layout(location = 6) out vec3 world_normal;
+
+void main()
+{
+ gl_Position = m.mmviewproj * vec4(attr_pos, 1.0);
+
+ pos = (m.mview * vec4(attr_pos, 1.0)).xyz;
+ tex_coord = attr_tex;
+
+ world_normal = (m.mmod * vec4(attr_normal, 1.0)).xyz;
+}
--- /dev/null
+#version 450
+
+#define SHADING_UNIFORMS 1
+
+layout(binding = 0) uniform sampler2D tex;
+layout(binding = 1) uniform samplerCube dstex;
+
+layout(std140, binding = SHADING_UNIFORMS) uniform fu {
+ vec4 diffuse;
+ vec4 specular;
+ float shininess;
+ float fog_density;
+} s;
+
+/* varyings */
+layout(location = 4) in vec3 pos;
+layout(location = 5) in vec2 tex_coord;
+layout(location = 6) in vec3 world_normal;
+
+layout(location = 0) out vec4 color;
+
+const vec3 sky_color = vec3(0.35, 0.5, 0.65);
+
+void main()
+{
+ vec4 itexel = textureCube(dstex, normalize(world_normal));
+ vec4 texel = texture2D(tex, tex_coord);
+ vec3 object_color = s.diffuse.xyz * texel.xyz * itexel.xyz;
+ float dist = -pos.z;
+ float fog = clamp(exp(-s.fog_density * dist), 0.0, 1.0);
+
+ color.xyz = mix(sky_color, object_color, fog);
+ color.w = 1.0;
+}
--- /dev/null
+#version 450
+
+#define MATRIX_UNIFORMS 0
+#define MORPHING_UNIFORMS 3
+
+layout(std140, binding = MATRIX_UNIFORMS) uniform vu {
+ mat4 mview;
+ uniform mat4 mmviewproj;
+ uniform mat4 mmod;
+} m;
+
+layout(std140, binding = MORPHING_UNIFORMS) uniform mvu {
+ float t;
+} time;
+
+/* attributes */
+layout(location = 1) in vec3 attr_pos;
+layout(location = 2) in vec3 attr_normal;
+layout(location = 3) in vec2 attr_tex;
+
+/* varyings */
+layout(location = 4) out vec3 pos;
+layout(location = 5) out vec2 tex_coord;
+layout(location = 6) out vec3 world_normal;
+
+const float half_height = 0.855;
+
+void main()
+{
+ vec3 sph_pos = normalize(vec3(attr_pos.x, attr_pos.y - half_height, attr_pos.z));
+
+ vec3 sph_normal = sph_pos;
+ sph_pos.y += half_height;
+
+ vec3 p = mix(attr_pos, sph_pos, time.t);
+ vec3 n = mix(attr_normal, sph_normal, time.t);
+
+ gl_Position = m.mmviewproj * vec4(p, 1.0);
+
+ pos = (m.mview * vec4(p, 1.0)).xyz;
+
+ tex_coord = attr_tex;
+ world_normal = (m.mmod * vec4(attr_normal, 1.0)).xyz;
+}
--- /dev/null
+#version 450
+
+layout(binding = 0) uniform samplerCube stex;
+
+in vec3 normal;
+out vec4 color;
+
+void main()
+{
+ vec4 texel = textureCube(stex, normalize(normal));
+
+ color.rgb = texel.rgb;
+ color.a = 1.0;
+}
--- /dev/null
+#version 450
+
+#define SKY_MATRIX_UNIFORMS 2
+
+layout(std140, binding = SKY_MATRIX_UNIFORMS) uniform svu {
+ mat4 mviewproj;
+} s;
+
+
+layout(location = 1) in vec3 attr_pos;
+layout(location = 2) in vec3 attr_normal;
+
+out vec3 normal;
+
+void main()
+{
+ gl_Position = s.mviewproj * vec4(attr_pos, 1.0);
+ normal = attr_normal;
+}
{
switch(api) {
case GFX_GL:
- return (char *)"gl_shaders";
+ return (char *)"shaders";
case GFX_VK:
- return (char *)"vk_shaders/spirv";
+ return (char *)"shaders/spirv";
}
return (char *)"";
}
+++ /dev/null
-#version 450
-
-out vec4 color;
-
-void main()
-{
- color = vec4(1.0, 0.0, 1.0, 1.0);
-}
+++ /dev/null
-#version 450
-
-uniform mat4 mmviewproj;
-
-layout(location = 1) in vec3 attr_pos;
-
-void main()
-{
- gl_Position = mmviewproj * vec4(attr_pos, 1.0);
-}
+++ /dev/null
-#version 450
-
-layout(binding = 0) uniform sampler2D tex;
-layout(binding = 0) uniform samplerCube dstex;
-
-layout(std140, binding = 0) uniform shading_state {
- vec4 diffuse;
- vec4 specular;
- float shininess;
- float fog_density;
-} s;
-
-layout(location = 0) in vec3 pos;
-layout(location = 1) in vec2 tex_coord;
-layout(location = 2) in vec3 world_normal;
-
-// const float fog_density = 0.005;
-const vec3 sky_color = vec3(0.35, 0.5, 0.65);
-
-layout(location = 0) out vec4 color;
-
-void main()
-{
- /*vec4 itexel = textureCube(dstex, normalize(world_normal)); */
- vec4 itexel = texture(dstex, normalize(world_normal));
-
-/* vec3 p = normalize(pos); // view space dir
- vec3 n = normalize(normal);
- vec3 l = normalize(ldir);
-
- vec3 r = normalize(-reflect(l, n));
- vec3 vdir = normalize(-p);
-
- float cdiff = max(dot(l, n), 0.0);
- float cspec = pow(max(dot(r, vdir), 0.0), shininess);
-*/
-
- float dist = -pos.z;
- float fog = clamp(exp(-s.fog_density * dist), 0.0, 1.0);
-
- vec4 texel = texture(tex, tex_coord);
-
- // vec3 object_color = (diffuse.xyz * cdiff * texel.xyz + specular.xyz * cspec) * itexel.xyz;
- vec3 object_color = s.diffuse.xyz * texel.xyz * itexel.xyz;
-
- color.xyz = mix(sky_color, object_color, fog);
- color.w = 1.0;
-}
+++ /dev/null
-#version 450
-//#extension GL_ARB_separate_shader_objects : enable
-
-layout(std140, binding = 0) uniform matrix_state {
- uniform mat4 mview;
- uniform mat4 mmviewproj;
- uniform mat4 mmod;
-} m;
-
-layout(location = 0) out vec3 pos;
-layout(location = 1) out vec2 tex_coord;
-layout(location = 2) out vec3 world_normal;
-
-const vec3 lpos = vec3(-10.0, 100.0, 10.0);
-
-/* attributes */
-layout(location = 1) in vec3 attr_pos;
-layout(location = 2) in vec3 attr_normal;
-layout(location = 3) in vec2 attr_tex;
-
-void main()
-{
- gl_Position = m.mmviewproj * vec4(attr_pos, 1.0);
-
- pos = (m.mview * vec4(attr_pos, 1.0)).xyz;
- tex_coord = attr_tex;
-
- world_normal = (m.mmod * vec4(attr_normal, 1.0)).xyz;
-}
+++ /dev/null
-#version 450
-
-layout(binding = 0) uniform sampler2D tex;
-layout(binding = 0) uniform samplerCube dstex;
-
-layout(std140, binding = 0) uniform shading_state {
- vec4 diffuse;
- float fog_density;
-} s;
-
-const vec3 sky_color = vec3(0.35, 0.5, 0.65);
-
-layout(location = 0) in vec3 pos;
-layout(location = 1) in vec2 tex_coord;
-layout(location = 2) in vec3 world_normal;
-
-layout(location = 0) out vec4 color;
-
-void main()
-{
- vec4 itexel = texture(dstex, normalize(world_normal));
- vec4 texel = texture(tex, tex_coord);
-
- vec3 object_color = s.diffuse.xyz * texel.xyz * itexel.xyz;
- float dist = -pos.z;
- float fog = clamp(exp(-s.fog_density * dist), 0.0, 1.0);
-
- color.xyz = mix(sky_color, object_color, fog);
- color.w = 1.0;
-}
+++ /dev/null
-#version 450
-
-layout(std140, binding = 0) uniform matrix_state {
- mat4 mview;
- mat4 mmviewproj;
- mat4 mmod;
- float t;
-} m;
-
-const float half_height = 0.855;
-
-layout(location = 0) out vec3 pos;
-layout(location = 1) out vec2 tex_coord;
-layout(location = 2) out vec3 world_normal;
-
-/* attributes */
-layout(location = 1) in vec3 attr_pos;
-layout(location = 2) in vec3 attr_normal;
-layout(location = 3) in vec2 attr_tex;
-
-void main()
-{
- vec3 sph_pos = normalize(vec3(attr_pos.x, attr_pos.y - half_height, attr_pos.z));
-
- vec3 sph_normal = sph_pos;
- sph_pos.y += half_height;
-
- vec3 p = mix(attr_pos, sph_pos, m.t);
- vec3 n = mix(attr_normal, sph_normal, m.t);
-
- gl_Position = m.mmviewproj * vec4(p, 1.0);
-
- pos = (m.mview * vec4(p, 1.0)).xyz;
- // ldir = (mview * vec4(lpos, 1.0)).xyz;
-
- // mat3 normal_matrix = mat3(mview);
- // normal = normal_matrix * n;
-
- tex_coord = attr_tex;
- world_normal = (m.mmod * vec4(attr_normal, 1.0)).xyz;
-}
+++ /dev/null
-#version 450
-
-layout(binding = 0) uniform samplerCube stex;
-
-layout (location = 0) in vec3 normal;
-layout (location = 0) out vec4 color;
-
-void main()
-{
- vec4 texel = texture(stex, normalize(normal));
-
- color.rgb = texel.rgb;
- color.a = 1.0;
-}
+++ /dev/null
-#version 450
-
-layout(binding = 0) uniform matrix_state {
- mat4 mviewproj;
-} m;
-
-layout(location = 1) in vec3 attr_pos;
-layout(location = 2) in vec3 attr_normal;
-
-layout(location = 0) out vec3 normal;
-
-void main()
-{
- gl_Position = m.mviewproj * vec4(attr_pos, 1.0);
- normal = attr_normal;
-}