UNPKG

rl-loadout-lib

Version:

Load Rocket League assets into three.js

26 lines (23 loc) 888 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const rim_material_1 = require("./rim-material"); const DIFFUSE_SHADER = ` // Look up a color from the texture. vec4 texelColor = texture2D(map, vUv); vec4 rgbaMapColor = texture2D(rgbaMap, vUv); // paint vec3 paint = paintColor * (rgbaMapColor.r / 0.5); if (painted == 1) { texelColor.rgb = blendNormal(texelColor.rgb, paint.rgb, rgbaMapColor.a); } texelColor = mapTexelToLinear(texelColor); diffuseColor *= texelColor; `; class ShadedPaintableMaterial extends rim_material_1.RimMaterial { constructor() { super(undefined, false); this.fragmentShader = rim_material_1.RimMaterial.createFragmentShader(rim_material_1.UNIFORMS, DIFFUSE_SHADER); } } exports.ShadedPaintableMaterial = ShadedPaintableMaterial; //# sourceMappingURL=shaded-paintable-material.js.map