webgl1 doesn't like backslashes in #define
According to https://www.khronos.org/registry/OpenGL/specs/es/2.0/GLSL_ES_Specification_1.00.pdf , backslashes aren't necessary supported as line continuation characters in preprocessor directives
This commit is contained in:
parent
09e4d7e9eb
commit
e7e9a7cc6c
1 changed files with 5 additions and 10 deletions
|
@ -433,19 +433,14 @@ FRAGMENT_SHADER_CODE
|
||||||
|
|
||||||
#ifdef SHADOW_USE_GRADIENT
|
#ifdef SHADOW_USE_GRADIENT
|
||||||
|
|
||||||
#define SHADOW_TEST(m_ofs) \
|
/* clang-format off */
|
||||||
{ \
|
/* GLSL es 100 doesn't support line continuation characters(backslashes) */
|
||||||
highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \
|
#define SHADOW_TEST(m_ofs) { highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); shadow_attenuation += 1.0 - smoothstep(sd, sd + shadow_gradient, sz); }
|
||||||
shadow_attenuation += 1.0 - smoothstep(sd, sd + shadow_gradient, sz); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define SHADOW_TEST(m_ofs) \
|
#define SHADOW_TEST(m_ofs) { highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); shadow_attenuation += step(sz, sd); }
|
||||||
{ \
|
/* clang-format on */
|
||||||
highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \
|
|
||||||
shadow_attenuation += step(sz, sd); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue