Browse Source

Cleanup imgui shaders (#2476)

* Remove unused Imgui shaders

* Cleanup Imgui shaders position attribute
Hugo Amnov 4 years ago
parent
commit
01b7fc0105

+ 0 - 13
examples/common/imgui/fs_imgui_color.sc

@@ -1,13 +0,0 @@
-$input v_color0
-
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-void main()
-{
-	gl_FragColor = v_color0;
-}

+ 0 - 21
examples/common/imgui/fs_imgui_cubemap.sc

@@ -1,21 +0,0 @@
-$input v_normal
-
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-uniform vec4 u_imageLodEnabled;
-SAMPLERCUBE(s_texColor, 0);
-
-#define u_imageLod     u_imageLodEnabled.x
-#define u_imageEnabled u_imageLodEnabled.y
-
-void main()
-{
-	vec3 color = textureCubeLod(s_texColor, v_normal, u_imageLod).xyz;
-	float alpha = 0.2 + 0.8*u_imageEnabled;
-	gl_FragColor = vec4(color, alpha);
-}

+ 0 - 22
examples/common/imgui/fs_imgui_image_swizz.sc

@@ -1,22 +0,0 @@
-$input v_texcoord0
-
-/*
- * Copyright 2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-uniform vec4 u_imageLodEnabled;
-uniform vec4 u_swizzle;
-SAMPLER2D(s_texColor, 0);
-
-#define u_imageLod     u_imageLodEnabled.x
-#define u_imageEnabled u_imageLodEnabled.y
-
-void main()
-{
-	float color = dot(texture2DLod(s_texColor, v_texcoord0, u_imageLod), u_swizzle);
-	float alpha = 0.2 + 0.8*u_imageEnabled;
-	gl_FragColor = vec4(vec3_splat(color), alpha);
-}

+ 0 - 38
examples/common/imgui/fs_imgui_latlong.sc

@@ -1,38 +0,0 @@
-$input v_texcoord0
-
-/*
- * Copyright 2014-2015 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-uniform vec4 u_imageLodEnabled;
-SAMPLERCUBE(s_texColor, 0);
-
-#define u_imageLod     u_imageLodEnabled.x
-#define u_imageEnabled u_imageLodEnabled.y
-
-vec3 vecFromLatLong(vec2 _uv)
-{
-	float pi    = 3.14159265;
-	float twoPi = 2.0*pi;
-	float phi   = _uv.x * twoPi;
-	float theta = _uv.y * pi;
-
-	vec3 result;
-	result.x = -sin(theta)*sin(phi);
-	result.y = cos(theta);
-	result.z = -sin(theta)*cos(phi);
-
-	return result;
-}
-
-void main()
-{
-	vec3 dir = vecFromLatLong(v_texcoord0);
-	vec3 color = textureCubeLod(s_texColor, dir, u_imageLod).xyz;
-	float alpha = 0.2 + 0.8*u_imageEnabled;
-
-	gl_FragColor = vec4(color, alpha);
-}

+ 0 - 16
examples/common/imgui/fs_imgui_texture.sc

@@ -1,16 +0,0 @@
-$input v_texcoord0, v_color0
-
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-SAMPLER2D(s_texColor, 0);
-
-void main()
-{
-	float alpha = texture2D(s_texColor, v_texcoord0).x;
-	gl_FragColor = vec4(v_color0.xyz, v_color0.w * alpha);
-}

+ 1 - 1
examples/common/imgui/varying.def.sc

@@ -2,7 +2,7 @@ vec4 v_color0    : COLOR0    = vec4(1.0, 0.0, 0.0, 1.0);
 vec3 v_normal    : NORMAL    = vec3(0.0, 0.0, 1.0);
 vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
 
-vec3 a_position  : POSITION;
+vec2 a_position  : POSITION;
 vec4 a_normal    : NORMAL;
 vec4 a_color0    : COLOR0;
 vec2 a_texcoord0 : TEXCOORD0;

+ 0 - 15
examples/common/imgui/vs_imgui_color.sc

@@ -1,15 +0,0 @@
-$input a_position, a_color0
-$output v_color0
-
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-void main()
-{
-	gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0) );
-	v_color0 = a_color0;
-}

+ 0 - 15
examples/common/imgui/vs_imgui_cubemap.sc

@@ -1,15 +0,0 @@
-$input a_position, a_normal
-$output v_normal
-
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-void main()
-{
-	gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
-	v_normal = a_normal.xyz;
-}

+ 0 - 15
examples/common/imgui/vs_imgui_latlong.sc

@@ -1,15 +0,0 @@
-$input a_position, a_texcoord0
-$output v_texcoord0
-
-/*
- * Copyright 2015 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-void main()
-{
-	gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
-	v_texcoord0 = a_texcoord0;
-}

+ 0 - 16
examples/common/imgui/vs_imgui_texture.sc

@@ -1,16 +0,0 @@
-$input a_position, a_texcoord0, a_color0
-$output v_texcoord0, v_color0
-
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bgfx_shader.sh>
-
-void main()
-{
-	gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0) );
-	v_texcoord0 = a_texcoord0;
-	v_color0 = a_color0;
-}