And there it is:
Of course I’ll tweak the colors and their mixing, playing with the shaders and all but most of the missing undocumented parts are there.
So the final version for documentation is:
vertex:
precision highp float;
uniform vec3 diffuse;
uniform vec3 specular;
uniform mat4 viewProjection;
varying vec3 vDiffuse;
varying vec3 vSpecular;
varying vec3 vPosition;
varying vec3 vPositionW;
varying vec3 vNormal;
attribute vec3 position;
attribute vec3 normal;
#include<instancesDeclaration>
#include<__decl__lightFragment>[0]
void main(void) {
#include<instancesVertex>
vDiffuse = diffuse;
vSpecular = specular;
vPosition = position;
vec4 worldPos = finalWorld * vec4(position, 1.0);
gl_Position = viewProjection * finalWorld * vec4(position, 1.0);
vNormal = normalize(vec3(finalWorld * vec4(normal, 0.0)));
#include<shadowsVertex>[0]
}
fragment:
precision highp float;
#extension GL_EXT_draw_buffers : require
layout(location = 0) out highp vec4 glFragData[2];
varying vec3 vDiffuse;
varying vec3 vSpecular;
varying vec3 vPositionW;
varying vec3 vNormal;
#include<helperFunctions>
#include<__decl__lightFragment>[0]
#include<shadowsFragmentFunctions>
void main(void) {
// float shadow = computeShadow(vPositionFromLight0, vDepthMetric0, shadowSampler0, light0.shadowsInfo.x, light0.shadowsInfo.w);
float shadow = computeShadowWithPoissonSampling(vPositionFromLight0, vDepthMetric0, shadowSampler0, light0.shadowsInfo.y, light0.shadowsInfo.x, light0.shadowsInfo.w);
// float shadow = computeShadowWithPCF3(vPositionFromLight0, vDepthMetric0, shadowSampler0, light0.shadowsInfo.yz, light0.shadowsInfo.x, light0.shadowsInfo.w);
float level = clamp(sin(dot(-vNormal, normalize(light0.vLightData.xyz))), 0.0,1.0);
glFragData[0] = vec4(mix(vDiffuse, vSpecular, level * shadow) ,1.0);
}
SahilTara
I have an error count of more than 200 so it might not just be that one.
No, those are internal implementation details that are not meant to be used by end users.
Could worth supporting that kind of usage maybe in a certain future.