About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
WebGL Error
Author Message
fatcoder Offline
Member

Post: #1
WebGL Error
I just tried going to the Live Demo at http://www.esenthel.com/?id=live_demo and I received the following error.

Code:
Error accessing ShaderTech "BloomGDSCH" in Shader "Main".
Pixel Shader compilation failed:
(unknown error)
Pixel Shader code:
#ifndef GL_ES
#define GL_ES
#endif
//GLSL
#extension GL_ARB_shader_texture_lod:enable
#extension GL_EXT_shader_texture_lod:enable
#extension GL_EXT_shadow_samplers:enable
#ifdef GL_ES
precision lowp float;
precision lowp int;
#define texture2DLod texture2DLodEXT
#define shadow2DProj shadow2DProjEXT
#endif
#define DoGlow 1
#define DoClamp 1
#define half 1
#ifdef GL_ES
#define HP highp
#define MP mediump
#define LP lowp
#else
#define HP
#define MP
#define LP
#endif
#define PAR uniform
#define VAR varying
#define EPS 0.0001
#define EPSL 0.01
#define PI 3.14159265
#define PI2 6.28318531
#define SBUMP_ZERO 0
#define SBUMP_FLAT 1
#define SBUMP_NORMAL 2
#define FX_NONE 0
#define FX_GRASS 1
#define FX_LEAF 2
#define FX_LEAFS 3
#define FX_BONE 4
#define Sat(x) clamp(x,0.0,1.0)
MP float Sum(MP vec2 v){return v.x+v.y;}
MP float Sum(MP vec3 v){return v.x+v.y+v.z;}
MP float Sum(MP vec4 v){return v.x+v.y+v.z+v.w;}
MP float Sqr(MP float x){return x*x;}
MP vec2 Sqr(MP vec2 x){return x*x;}
MP float Cube(MP float x){return x*x*x;}
HP float Length2(HP vec2 v){return dot(v,v);}
HP float Length2(HP vec3 v){return dot(v,v);}
HP float Length2(HP vec4 v){return dot(v,v);}
MP vec2 Rotate(MP vec2 vec,MP vec2 cos_sin)
{
return vec2(vec.x*cos_sin.x-vec.y*cos_sin.y,
vec.x*cos_sin.y+vec.y*cos_sin.x);
}
MP float LerpR(MP float from,MP float to,MP float v){return(v-from)/(to-from);}
MP float LerpRS(MP float from,MP float to,MP float v){return Sat((v-from)/(to-from));}
LP float LPMax(LP float x,LP float y,LP float z,LP float w){return max(x,max(y,max(z,w)));}
LP float LPMax(LP vec4 v){return LPMax(v.x,v.y,v.z,v.w);}
PAR LP float BloomScale,BloomCut;
#if DoGlow!=0
#define res ((half!=0) ?2:4)
VAR HP vec2 IO_tex;
VAR LP float scale;
#elif half!=0
VAR HP vec2 IO_tex;
#else
VAR HP vec2 IO_tex0,IO_tex1,IO_tex2,IO_tex3;
VAR LP float scale;
#endif
#define AlphaTest(alpha) if(alpha+MaterialColor().a<1.0)discard
PAR sampler2D Col,Col1,Col2,Col3,
Nrm,Nrm1,Nrm2,Nrm3,
Lum;
PAR samplerCube Rfl;
PAR MP float AllowBackFlip;
#define BackFlip(dir) {if(gl_FrontFacing==false)dir*=AllowBackFlip;}
struct ViewportClass
{
HP float from,range;
HP vec2 clamp_min,clamp_max,center,size,size_fov_tan;
HP vec4 FracToPosXY,ScreenToPosXY,PosToScreen;
};
PAR ViewportClass Viewport;
HP vec2 ViewportClamp(HP vec2 screen,const bool do_clamp){return do_clamp?clamp(screen,Viewport.clamp_min,Viewport.clamp_max):screen;}
PAR LP vec4 Color[4];
PAR HP vec2 PixSize;
PAR HP vec4 Coords;
void main()
{
#if DoGlow!=0
LP vec3 color=vec3(0.0,0.0,0.0);
LP vec4 glow=vec4(0.0,0.0,0.0,0.0);
for(int x=0;x<res;x++)
for(int y=0;y<res;y++)
{
LP vec4 c=texture2D(Col,ViewportClamp(IO_tex+PixSize*vec2(x,y),DoClamp!=0));
color+=c.rgb;
glow.rgb+=c.rgb*c.a;
glow.a=max(glow.a,c.a);
}
glow.rgb*=2.0*glow.a/LPMax(vec4(glow.rgb,EPS));
gl_FragColor.rgb=Sat(max(color*scale-BloomCut,glow.rgb));
#elif half!=0
gl_FragColor.rgb=Sat(texture2D(Col,ViewportClamp(IO_tex,DoClamp!=0)).rgb*BloomSc​ale-BloomCut);
#else
#if DoClamp!=0
HP vec2 tex_min=ViewportClamp(IO_tex0,true),
tex_max=ViewportClamp(IO_tex1,true);
LP vec3 col=texture2D(Col,vec2(tex_min.x,tex_min.y)).rgb
+texture2D(Col,vec2(tex_max.x,tex_min.y)).rgb
+texture2D(Col,vec2(tex_min.x,tex_max.y)).rgb
+texture2D(Col,vec2(tex_max.x,tex_max.y)).rgb;
#else
LP vec3 col=texture2D(Col,IO_tex0).rgb
+texture2D(Col,IO_tex1).rgb
+texture2D(Col,IO_tex2).rgb
+texture2D(Col,IO_tex3).rgb;
#endif
gl_FragColor.rgb=Sat(col*scale-BloomCut);
#endif
gl_FragColor.a=0.0;
}

I'm using Chrome on an ATI Mobility Radeon HD 2400 XT. Other WebGL sites work fine, its just a problem with Esenthel.
08-23-2014 08:07 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: WebGL Error
Hi,

Can you let me know which OS are you using?
Is Chrome the latest version?

I've just tested this on Chrome latest, Windows 8.1, and works OK.
So perhaps the problem is in your graphics driver.
08-24-2014 04:38 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #3
RE: WebGL Error
I get the same error in the latest IE, but it works in the latest version of FireFox. At least, it starts the same - that's one heckuva message box.

Win 8.1 x64, NVidia GTX770 v335.23
08-24-2014 05:17 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #4
RE: WebGL Error
Sorry, forgot to mention that. That laptop is running Windows Vista. Chrome is updated to the latest version. I'll give Firefox a go, but it is probably the graphics driver. The laptop just has the standard manufacturer's driver on it and there is no updates for it.
08-24-2014 07:04 AM
Find all posts by this user Quote this message in a reply
Post Reply