fix shader for asus transformer - it's doing strange things in smoothstep..
This commit is contained in:
parent
f32aa5d431
commit
c5ace62b61
@ -40,20 +40,21 @@ class Shaders {
|
|||||||
+ " lowp float len;"
|
+ " lowp float len;"
|
||||||
+ " lowp float fuzz;"
|
+ " lowp float fuzz;"
|
||||||
+ " lowp float width = u_mode[1];"
|
+ " lowp float width = u_mode[1];"
|
||||||
+ " if (v_st.t == zero){ "
|
// + " if (v_st.t == zero){ "
|
||||||
+ " fuzz = fwidth(v_st.s) * fuzzf;"
|
// + " fuzz = fwidth(v_st.s) * fuzzf;"
|
||||||
+ " len = width - abs(v_st.s);"
|
// + " len = width - abs(v_st.s);"
|
||||||
+ " } else {"
|
// + " } else {"
|
||||||
+ " fuzz = max(fwidth(v_st.s), fwidth(v_st.t)) * fuzzf;"
|
+ " fuzz = max(fwidth(v_st.s), fwidth(v_st.t)) * fuzzf;"
|
||||||
+ " len = width - length(v_st);"
|
+ " len = width - length(v_st);"
|
||||||
+ " } "
|
// + " } "
|
||||||
// + " if (len < min_fuzz)"
|
// + " if (len < min_fuzz)"
|
||||||
// + " discard;"
|
// + " discard;"
|
||||||
// + " alpha = zero;"
|
// + " alpha = zero;"
|
||||||
// + " if (len < fuzz) {"
|
+ " if (len < fuzz) {"
|
||||||
+ " lowp float min_fuzz = -fuzz * u_mode[0];"
|
+ " lowp float min_fuzz = -fuzz * u_mode[0];"
|
||||||
+ " color.a *= smoothstep(min_fuzz, fuzz, len);"
|
+ " color.a *= smoothstep(min_fuzz, fuzz, len);"
|
||||||
// + " }"
|
// + " if (color.a == 0.0 ) color = vec4(1.0,0.0,0.0,1.0);"
|
||||||
|
+ " }"
|
||||||
+ " gl_FragColor = color;"
|
+ " gl_FragColor = color;"
|
||||||
+ "}";
|
+ "}";
|
||||||
|
|
||||||
@ -86,6 +87,7 @@ class Shaders {
|
|||||||
// + " } "
|
// + " } "
|
||||||
// + "glFragColor = color"
|
// + "glFragColor = color"
|
||||||
// + "}";
|
// + "}";
|
||||||
|
|
||||||
// final static String gLineFragmentShader = ""
|
// final static String gLineFragmentShader = ""
|
||||||
// + "#extension GL_OES_standard_derivatives : enable\n"
|
// + "#extension GL_OES_standard_derivatives : enable\n"
|
||||||
// + "precision mediump float;"
|
// + "precision mediump float;"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user