playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
98 lines (97 loc) • 2.08 kB
JavaScript
var litMain_default = `
attribute vec4 vertex_color;
varying vec2 vMask;
varying vec2 vTiledUv;
uniform mediump vec4 innerOffset;
uniform mediump vec2 outerScale;
uniform mediump vec4 atlasRect;
vec3 dPositionW;
mat4 dModelMatrix;
attribute vec2 vertex_texCoord0;
attribute vec2 vertex_texCoord1;
uniform mat4 matrix_view;
attribute vec4 vertex_tangent;
vec3 decodeGamma(vec3 raw) {
return pow(raw, vec3(2.2));
}
vec4 gammaCorrectInput(vec4 color) {
return vec4(decodeGamma(color.xyz), color.w);
}
void main(void) {
gl_PointSize = 1.0;
gl_Position = getPosition();
vPositionW = getWorldPosition();
vNormalW = getNormal();
vTangentW = normalize(dNormalMatrix * vertex_tangent.xyz);
vBinormalW = cross(vNormalW, vTangentW) * vertex_tangent.w;
vObjectSpaceUpW = normalize(dNormalMatrix * vec3(0, 1, 0));
vec2 uv0 = getUv0();
vUv0 = uv0;
vec2 uv1 = getUv1();
vUv1 = uv1;
vVertexColor = gammaCorrectInput(vertex_color);
vVertexColor = vertex_color;
vLinearDepth = -(matrix_view * vec4(vPositionW, 1.0)).z;
unpackMsdfParams();
}
`;
export {
litMain_default as default
};