diff options
| author | realtradam <[email protected]> | 2023-03-26 00:52:13 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-03-26 00:52:13 -0400 |
| commit | 4670ac42a773ea97157f71d78687f79d6ba3c1d9 (patch) | |
| tree | 3c70b7d4073d48ff3c5066c9cf7ab812031a3551 /src/shaders | |
| parent | 2577adf913e292a4a515e7dfc4023e37e8177f46 (diff) | |
| download | RodeoKit-4670ac42a773ea97157f71d78687f79d6ba3c1d9.tar.gz RodeoKit-4670ac42a773ea97157f71d78687f79d6ba3c1d9.zip | |
added loading images as well as loding textures
Diffstat (limited to 'src/shaders')
| -rw-r--r-- | src/shaders/simple.fragment.sc | 18 | ||||
| -rw-r--r-- | src/shaders/simple.vertex.sc | 5 | ||||
| -rw-r--r-- | src/shaders/varying.def.sc | 2 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/shaders/simple.fragment.sc b/src/shaders/simple.fragment.sc index 4ae2f48..ab72ae4 100644 --- a/src/shaders/simple.fragment.sc +++ b/src/shaders/simple.fragment.sc @@ -1,4 +1,4 @@ -$input v_color0, v_texcoord0 +$input v_color0, v_texcoord0, v_texcoord1 #include <bgfx_shader.sh> @@ -17,12 +17,12 @@ SAMPLER2D(texture_0, 1); void main() { - //if(v_texcoord0.y < 0.0) - //{ - gl_FragColor = v_color0 * texture2D(default_texture, v_texcoord0.xy); - //} - //else - //{ - //gl_FragColor = v_color0 * texture2D(texture_0, v_texcoord0.xy); - //} + if(v_texcoord1 == 1.0) + { + gl_FragColor = v_color0 * texture2D(texture_0, v_texcoord0.xy); + } + else + { + gl_FragColor = v_color0 * texture2D(default_texture, v_texcoord0.xy); + } } diff --git a/src/shaders/simple.vertex.sc b/src/shaders/simple.vertex.sc index b90a0c7..cda89a9 100644 --- a/src/shaders/simple.vertex.sc +++ b/src/shaders/simple.vertex.sc @@ -1,5 +1,5 @@ -$input a_position, a_color0, a_texcoord0 -$output v_color0, v_texcoord0 +$input a_position, a_color0, a_texcoord0, a_texcoord1 +$output v_color0, v_texcoord0, v_texcoord1 #include <bgfx_shader.sh> @@ -8,4 +8,5 @@ void main() gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0)); v_color0 = a_color0; v_texcoord0 = a_texcoord0; + v_texcoord1 = a_texcoord1; } diff --git a/src/shaders/varying.def.sc b/src/shaders/varying.def.sc index 5f7be4e..17b1bab 100644 --- a/src/shaders/varying.def.sc +++ b/src/shaders/varying.def.sc @@ -1,8 +1,10 @@ // outputs; vec4 v_color0 : COLOR0; vec3 v_texcoord0 : TEXCOORD0; +float v_texcoord1 : TEXCOORD1; // inputs; vec3 a_position : POSITION; vec4 a_color0 : COLOR0; vec3 a_texcoord0 : TEXCOORD0; +float a_texcoord1 : TEXCOORD1; |
