Branimir Karadžić 8 years ago
parent
commit
9b218c9644
2 changed files with 10 additions and 10 deletions
  1. 1 10
      examples/33-pom/fs_pom.sc
  2. 9 0
      examples/common/shaderlib.sh

+ 1 - 10
examples/33-pom/fs_pom.sc

@@ -60,15 +60,6 @@ vec2 parallax_uv(vec2 uv, vec3 view_dir)
 	}
 	}
 }
 }
 
 
-vec2 texture2DBc4(sampler2D _sampler, vec2 _uv)
-{
-#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 3
-	return texture2D(_sampler, _uv).yx;
-#else
-	return texture2D(_sampler, _uv).xy;
-#endif
-}
-
 void main()
 void main()
 {
 {
 	vec3 light_dir = normalize(v_ts_light_pos - v_ts_frag_pos);
 	vec3 light_dir = normalize(v_ts_light_pos - v_ts_frag_pos);
@@ -97,7 +88,7 @@ void main()
 	}
 	}
 	else
 	else
 	{
 	{
-		normal.xy = texture2DBc4(s_texNormal, uv) * 2.0 - 1.0;
+		normal.xy = texture2DBc5(s_texNormal, uv) * 2.0 - 1.0;
 		normal.z  = sqrt(1.0 - dot(normal.xy, normal.xy) );
 		normal.z  = sqrt(1.0 - dot(normal.xy, normal.xy) );
 	}
 	}
 
 

+ 9 - 0
examples/common/shaderlib.sh

@@ -383,4 +383,13 @@ vec3 fixCubeLookup(vec3 _v, float _lod, float _topLevelCubeSize)
 	return _v;
 	return _v;
 }
 }
 
 
+vec2 texture2DBc5(sampler2D _sampler, vec2 _uv)
+{
+#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 3
+	return texture2D(_sampler, _uv).yx;
+#else
+	return texture2D(_sampler, _uv).xy;
+#endif
+}
+
 #endif // __SHADERLIB_SH__
 #endif // __SHADERLIB_SH__