20
« on: April 20, 2018, 04:30:43 pm »
emps-err-8828:
Error compiling:
#version 120
// texture effect samplers
uniform sampler2D diffuse_sampler;
uniform sampler2D mixin_sampler;
uniform sampler2D ripple_sampler;
uniform sampler2D reflection_sampler;
uniform sampler2D depth_sampler;
// wave information
uniform float ATime;
uniform float RTime;
uniform float PiTime;
varying vec2 texCoords;
// fog coordinates
varying vec4 viewSpace;
uniform float FogEnabled;
uniform float Brightness;
uniform float FresnelWeight;
uniform float Reflections;
uniform float ReflectionDither;
// camera to vertex position
varying vec3 toCamera;
// wave UV movement
uniform float WaveCosMult;
uniform float WaveUMovement;
uniform float WaveVMovement;
// effect samplers
//uniform sampler2D refraction_sampler;
const float near = 0.1f;
const float far = 100f;
void main(void) {
vec4 color = gl_Color;
// frensel factor. how much does camera angle affect
// reflectivity of the water?
float reflectivity = (1.0 - dot(vec3(0, 1.0, 0), toCamera)) * FresnelWeight;
//color.a = clamp(color.a + (color.a * reflectivity * 0.25), 0.0, 1.0);
// calculate dither wave animation
// UV's will later be used to sample the water
vec2 coords = texCoords.st;
vec2 dir = coords - vec2(.5);
float dist = distance(coords, vec2(.5));
vec2 offset = dir * (sin(dist * 80. - ATime*6.0 + 0.5)) / 35.;
vec2 waveCoord = coords + offset;
// movement type
float mov;
if (WaveCosMult > 0)
mov = cos(PiTime * WaveCosMult);
else
mov = ATime * 0.5;
// shader variables for UV movement
waveCoord.x += mov * WaveUMovement;
waveCoord.y += mov * WaveVMovement;
// sample wave
vec4 wave = texture2D(mixin_sampler, waveCoord);
color *= wave;
// reflections (HD water) enabled?
if (Reflections > 0) {
vec2 ndc = (viewSpace.xy / viewSpace.w) * 0.5 + 0.5;
vec2 refractCoords = vec2(ndc.x, ndc.y);
// vector from camera to water depth
float floorDepth = 2.0 * near * far / (far + near - (2.0 * texture2D(depth_sampler, refractCoords).z - 1.0) * (far - near));
// vector from camera to water surface
float waterDepth = 2.0 * near * far / (far + near - (2.0 * gl_FragCoord.z - 1.0) * (far - near));
// actual water depth
float depth = floorDepth - waterDepth;
// alpha depends on water depth
color.a = clamp(depth * 30f, 0, color.a);
if (ReflectionDither > -1) {
// ripple effect offset
// range: [-0.5, 0.5]
vec2 distortion = (texture2D(ripple_sampler, waveCoord).gb * 2.0 - 1.0) * ReflectionDither;
// calculate distortion
float distortionMax = ReflectionDither * 0.3333;
vec2 reflectCoords = vec2(ndc.x, -ndc.y);
reflectCoords += distortion;
reflectCoords.x = clamp(reflectCoords.x - distortionMax, 0.001, 0.999);
reflectCoords.y = clamp(reflectCoords.y - distortionMax, -0.999, -0.001);
// sampled reflection
vec4 reflect = texture2D(reflection_sampler, reflectCoords);
//reflectivity *= (wave.g);
// mix the reflection
if (reflect.a > 0.1) {
color = mix(color, reflect, reflectivity * color.a * 0.75f);
}
//color = wave;
}
//color = vec4(depth, depth, depth, 1.0);
}
// calculate fog last
float fogFactor = 1.0;
if (FogEnabled > 0.0) {
float depth = length(viewSpace) - (gl_Fog.end - gl_Fog.start);
// fog start
if (depth >= gl_Fog.start) {
// linear fog
fogFactor = (gl_Fog.end - depth) / (gl_Fog.end - gl_Fog.start);
// clamp between 0 and 1
fogFactor = clamp(fogFactor, 0.0, 1.0);
float fogAlpha = color.a * fogFactor;
color = vec4((color.rgb * fogFactor) + (gl_Fog.color.rgb * (1.0 - fogFactor)), fogAlpha);
}
}
float br = Brightness;
vec4 LightColor = vec4(br, br, br, 1.0);
gl_FragColor = color * LightColor;
}
Fragment shader failed to compile with the following errors:
ERROR: 0:37: error(#132) Syntax error: "f" parse error
ERROR: error(#273) 1 compilation errors. No code generated
[VBORenderer]: error loading shadow shaders: 3, 0
You might find this interesting too. Dont know if its the same or something else. I found it under C:/Users/YOUR_USER/.emps_world/errors/shaders with the document name (compilation_2018-04-20_06-33-57)
Emps-World shader compilation failure: 2018-04-20_06:33:57
Execution Environment Details:
OS name: Windows 10
OS version: 10.0
Java version: 1.8.0_171
CPU Cores: 12
Vendor: ATI Technologies Inc.
OpenGL version: 4.5.13507 Compatibility Profile Context 23.20.15033.5003
detailed: 3.0: true, 2.0: true, ARB_FBO: true
Renderer: Radeon(TM) RX 460 Graphics
Max Texture: 16384
Max RenderBuffer: 16384
Buffers: glBufs: 1076 [2.91]
Atlasses: 5
TexBuffers: [5, 0, 0, 200, 21]
glTextures: [5, 0, 0, 200, 21]
glBuffers: 1076 [2.91]
empsVBOs: 370 [m: 306, f: 64]
modelc: 150
glAtlasses: 5
cache: 100%
ver: 0.286
Shader Error:Fragment shader failed to compile with the following errors:
ERROR: 0:87: error(#132) Syntax error: "f" parse error
ERROR: error(#273) 1 compilation errors. No code generated
END