Created
May 12, 2023 02:04
-
-
Save e9x/eea9ecb2c0ce6fe0517ff522e78d282a to your computer and use it in GitHub Desktop.
Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var v_exports = exports; | |
var require_5Js = require('./5.js'); | |
var mAssert = require('./9.js'); | |
var require_99Js = require('./99.js'); | |
v_exports.assert = mAssert; | |
v_exports.toArray = require_99Js.toArray; | |
v_exports.zero2 = require_99Js.zero2; | |
v_exports.toHex = require_99Js.toHex; | |
v_exports.encode = require_99Js.encode; | |
function mGetNaf(argBetweenPoliceman, argBottleSend, argAreaTwelve) { | |
var varGainSometime = Array(Math.max(argBetweenPoliceman.bitLength(), argAreaTwelve) + 1); | |
varGainSometime.fill(0); | |
var varCompletePosition = 1 << argBottleSend + 1; | |
var varGoodPig = argBetweenPoliceman.clone(); | |
for (var varAvailableSign = 0; varAvailableSign < varGainSometime.length; varAvailableSign++) { | |
var varChangeTrouble; | |
var varBelievedVoice = varGoodPig.andln(varCompletePosition - 1); | |
if (varGoodPig.isOdd()) { | |
varChangeTrouble = varBelievedVoice > (varCompletePosition >> 1) - 1 ? (varCompletePosition >> 1) - varBelievedVoice : varBelievedVoice; | |
varGoodPig.isubn(varChangeTrouble); | |
} else { | |
varChangeTrouble = 0; | |
} | |
varGainSometime[varAvailableSign] = varChangeTrouble; | |
varGoodPig.iushrn(1); | |
} | |
return varGainSometime; | |
} | |
v_exports.getNAF = mGetNaf; | |
function mGetJsf(argFullyWatch, argFamousPleasure) { | |
var varBiggestWhere = [ | |
[], | |
[] | |
]; | |
argFullyWatch = argFullyWatch.clone(); | |
argFamousPleasure = argFamousPleasure.clone(); | |
var varFasterScientific; | |
var varInsideRocky = 0; | |
for (var varDifficultySwung = 0; argFullyWatch.cmpn(-varInsideRocky) > 0 || argFamousPleasure.cmpn(-varDifficultySwung) > 0;) { | |
var varExperienceSatellites = 3 & argFullyWatch.andln(3) + varInsideRocky; | |
var varDeskOcean = 3 & argFamousPleasure.andln(3) + varDifficultySwung; | |
if (varExperienceSatellites == 3) { | |
varExperienceSatellites = -1; | |
} | |
if (varDeskOcean === 3) { | |
varDeskOcean = -1; | |
} | |
var varBusinessSmallest; | |
if ((1 & varExperienceSatellites) == 0) { | |
varBusinessSmallest = 0; | |
} else { | |
varFasterScientific = 7 & argFullyWatch.andln(7) + varInsideRocky; | |
varBusinessSmallest = (varFasterScientific === 3 || varFasterScientific === 5) && varDeskOcean === 2 ? -varExperienceSatellites : varExperienceSatellites; | |
} | |
varBiggestWhere[0].push(varBusinessSmallest); | |
var varFarmerTight; | |
if ((1 & varDeskOcean) == 0) { | |
varFarmerTight = 0; | |
} else { | |
varFasterScientific = 7 & argFamousPleasure.andln(7) + varDifficultySwung; | |
varFarmerTight = (varFasterScientific === 3 || varFasterScientific === 5) && varExperienceSatellites === 2 ? -varDeskOcean : varDeskOcean; | |
} | |
varBiggestWhere[1].push(varFarmerTight); | |
if (2 * varInsideRocky === varBusinessSmallest + 1) { | |
varInsideRocky = 1 - varInsideRocky; | |
} | |
if (2 * varDifficultySwung === varFarmerTight + 1) { | |
varDifficultySwung = 1 - varDifficultySwung; | |
} | |
argFullyWatch.iushrn(1); | |
argFamousPleasure.iushrn(1); | |
} | |
return varBiggestWhere; | |
} | |
v_exports.getJSF = mGetJsf; | |
function MCachedProperty(argCampPaint, argAteTrain, argBeltVarious) { | |
var varActuallyWritten = '_' + argAteTrain; | |
argCampPaint.prototype[argAteTrain] = function () { | |
return this[varActuallyWritten] === undefined ? this[varActuallyWritten] = argBeltVarious.call(this) : this[varActuallyWritten]; | |
}; | |
} | |
v_exports.cachedProperty = MCachedProperty; | |
function mParseBytes(argDependResult) { | |
return typeof argDependResult == 'string' ? v_exports.toArray(argDependResult, 'hex') : argDependResult; | |
} | |
v_exports.parseBytes = mParseBytes; | |
function mIntFromLe(argEngineRich) { | |
return new require_5Js(argEngineRich, 'hex', 'le'); | |
} | |
v_exports.intFromLE = mIntFromLe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var iîiíiîï = exports; | |
var iííîiiï = __webpack_require__(5); | |
var iîîíììí = __webpack_require__(9); | |
var iiííìiï = __webpack_require__(99); | |
iîiíiîï.assert = iîîíììí; | |
iîiíiîï.toArray = iiííìiï.toArray; | |
iîiíiîï.zero2 = iiííìiï.zero2; | |
iîiíiîï.toHex = iiííìiï.toHex; | |
iîiíiîï.encode = iiííìiï.encode; | |
function iìíïîíï(iïîiïîï, iìíìïîî, iìiiïiî) { | |
var iïíïíiî = Array(Math.max(iïîiïîï.bitLength(), iìiiïiî) + 1); | |
iïíïíiî.fill(0); | |
for (var iiïiïîï = 1 << iìíìïîî + 1, iìîíiîí = iïîiïîï.clone(), iiìïiîì = 0; iiìïiîì < iïíïíiî.length; iiìïiîì++) { | |
var iíîiìíí; | |
var iiìíïíï = iìîíiîí.andln(iiïiïîï - 1); | |
if (iìîíiîí.isOdd()) { | |
iíîiìíí = iiìíïíï > (iiïiïîï >> 1) - 1 ? (iiïiïîï >> 1) - iiìíïíï : iiìíïíï; | |
iìîíiîí.isubn(iíîiìíí); | |
} else { | |
iíîiìíí = 0; | |
} | |
iïíïíiî[iiìïiîì] = iíîiìíí; | |
iìîíiîí.iushrn(1); | |
} | |
return iïíïíiî; | |
} | |
iîiíiîï.getNAF = iìíïîíï; | |
function iíîîíìi(iiïíîîí, iíiíiii) { | |
var iììììíì = [ | |
[], | |
[] | |
]; | |
iiïíîîí = iiïíîîí.clone(); | |
iíiíiii = iíiíiii.clone(); | |
for (var iîïïîîï, iiìíìiï = 0, iíîiïîí = 0; iiïíîîí.cmpn(-iiìíìiï) > 0 || iíiíiii.cmpn(-iíîiïîí) > 0;) { | |
var iìiíiïì = 3 & iiïíîîí.andln(3) + iiìíìiï; | |
var iîïiííï = 3 & iíiíiii.andln(3) + iíîiïîí; | |
if (iìiíiïì == 3) { | |
iìiíiïì = -1; | |
} | |
if (iîïiííï === 3) { | |
iîïiííï = -1; | |
} | |
var iîiìïíi; | |
if ((1 & iìiíiïì) == 0) { | |
iîiìïíi = 0; | |
} else { | |
iîïïîîï = 7 & iiïíîîí.andln(7) + iiìíìiï; | |
iîiìïíi = (iîïïîîï === 3 || iîïïîîï === 5) && iîïiííï === 2 ? -iìiíiïì : iìiíiïì; | |
} | |
iììììíì[0].push(iîiìïíi); | |
var iíìiiîí; | |
if ((1 & iîïiííï) == 0) { | |
iíìiiîí = 0; | |
} else { | |
iîïïîîï = 7 & iíiíiii.andln(7) + iíîiïîí; | |
iíìiiîí = (iîïïîîï === 3 || iîïïîîï === 5) && iìiíiïì === 2 ? -iîïiííï : iîïiííï; | |
} | |
iììììíì[1].push(iíìiiîí); | |
if (2 * iiìíìiï === iîiìïíi + 1) { | |
iiìíìiï = 1 - iiìíìiï; | |
} | |
if (2 * iíîiïîí === iíìiiîí + 1) { | |
iíîiïîí = 1 - iíîiïîí; | |
} | |
iiïíîîí.iushrn(1); | |
iíiíiii.iushrn(1); | |
} | |
return iììììíì; | |
} | |
iîiíiîï.getJSF = iíîîíìi; | |
function iïíìîìi(iïïiìíí, iïïîïïî, iìîíiîì) { | |
var iïíííîí = '_' + iïïîïïî; | |
iïïiìíí.prototype[iïïîïïî] = function () { | |
return this[iïíííîí] === undefined ? this[iïíííîí] = iìîíiîì.call(this) : this[iïíííîí]; | |
}; | |
} | |
iîiíiîï.cachedProperty = iïíìîìi; | |
function iïîìíiï(iïiíìîì) { | |
return typeof iïiíìîì == 'string' ? iîiíiîï.toArray(iïiíìîì, 'hex') : iïiíìîì; | |
} | |
iîiíiîï.parseBytes = iïîìíiï; | |
function iîïïíîí(iiiíîîi) { | |
return new iííîiiï(iiiíîîi, 'hex', 'le'); | |
} | |
iîiíiîï.intFromLE = iîïïíîí; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
} | |
Object.defineProperty(exports, '__esModule', { value: true }); | |
if (!Object.prototype.hasOwnProperty.call(exports, 'Water')) | |
Object.defineProperty(exports, 'Water', { | |
get: function () { | |
return eWater; | |
} | |
}); | |
var require_0Js = require('./0.js'); | |
class eWater extends require_0Js.Mesh { | |
constructor(argBroadSearch, argLaterSweet = {}) { | |
super(argBroadSearch); | |
this.isWater = true; | |
const _this = this; | |
const varChemicalOwn = argLaterSweet.textureWidth !== undefined ? argLaterSweet.textureWidth : 512; | |
const varDreamRapidly = argLaterSweet.textureHeight !== undefined ? argLaterSweet.textureHeight : 512; | |
const varCottonStrange = argLaterSweet.clipBias !== undefined ? argLaterSweet.clipBias : 0; | |
const mValue = argLaterSweet.alpha !== undefined ? argLaterSweet.alpha : 1; | |
const mValue2 = argLaterSweet.time !== undefined ? argLaterSweet.time : 0; | |
const mValue4 = argLaterSweet.waterNormals !== undefined ? argLaterSweet.waterNormals : null; | |
const mValue6 = argLaterSweet.sunDirection !== undefined ? argLaterSweet.sunDirection : new require_0Js.Vector3(0.70707, 0.70707, 0); | |
const mValue8 = new require_0Js.Color(argLaterSweet.sunColor !== undefined ? argLaterSweet.sunColor : 16777215); | |
const mValue10 = new require_0Js.Color(argLaterSweet.waterColor !== undefined ? argLaterSweet.waterColor : 8355711); | |
const mValue12 = argLaterSweet.eye !== undefined ? argLaterSweet.eye : new require_0Js.Vector3(0, 0, 0); | |
const mValue14 = argLaterSweet.distortionScale !== undefined ? argLaterSweet.distortionScale : 20; | |
const varDriedProgram = argLaterSweet.side !== undefined ? argLaterSweet.side : require_0Js.FrontSide; | |
const varBottleTherefore = argLaterSweet.fog !== undefined ? argLaterSweet.fog : false; | |
const iIPlane = new require_0Js.Plane(); | |
const iIVector3 = new require_0Js.Vector3(); | |
const iIVector32 = new require_0Js.Vector3(); | |
const iIVector34 = new require_0Js.Vector3(); | |
const iIMatrix4 = new require_0Js.Matrix4(); | |
const iIVector36 = new require_0Js.Vector3(0, 0, -1); | |
const iIVector4 = new require_0Js.Vector4(); | |
const iIVector38 = new require_0Js.Vector3(); | |
const iIVector310 = new require_0Js.Vector3(); | |
const iIVector42 = new require_0Js.Vector4(); | |
const mValue16 = new require_0Js.Matrix4(); | |
const iIPerspectiveCamera = new require_0Js.PerspectiveCamera(); | |
const iIWebGlRenderTarget = new require_0Js.WebGLRenderTarget(varChemicalOwn, varDreamRapidly); | |
const varAveragePiano = { | |
uniforms: require_0Js.UniformsUtils.merge([ | |
require_0Js.UniformsLib.fog, | |
require_0Js.UniformsLib.lights, | |
{ | |
normalSampler: { value: null }, | |
mirrorSampler: { value: null }, | |
alpha: { value: 1 }, | |
time: { value: 0 }, | |
size: { value: 1 }, | |
distortionScale: { value: 20 }, | |
textureMatrix: { value: new require_0Js.Matrix4() }, | |
sunColor: { value: new require_0Js.Color(8355711) }, | |
sunDirection: { value: new require_0Js.Vector3(0.70707, 0.70707, 0) }, | |
eye: { value: new require_0Js.Vector3() }, | |
waterColor: { value: new require_0Js.Color(5592405) } | |
} | |
]), | |
vertexShader: '\n\t\t\t\tuniform mat4 textureMatrix;\n\t\t\t\tuniform float time;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <shadowmap_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tmirrorCoord = modelMatrix * vec4( position, 1.0 );\n\t\t\t\t\tworldPosition = mirrorCoord.xyzw;\n\t\t\t\t\tmirrorCoord = textureMatrix * mirrorCoord;\n\t\t\t\t\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t\t#include <beginnormal_vertex>\n\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t#include <fog_vertex>\n\t\t\t\t#include <shadowmap_vertex>\n\t\t\t}', | |
fragmentShader: '\n\t\t\t\tuniform sampler2D mirrorSampler;\n\t\t\t\tuniform float alpha;\n\t\t\t\tuniform float time;\n\t\t\t\tuniform float size;\n\t\t\t\tuniform float distortionScale;\n\t\t\t\tuniform sampler2D normalSampler;\n\t\t\t\tuniform vec3 sunColor;\n\t\t\t\tuniform vec3 sunDirection;\n\t\t\t\tuniform vec3 eye;\n\t\t\t\tuniform vec3 waterColor;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\tvec4 getNoise( vec2 uv ) {\n\t\t\t\t\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);\n\t\t\t\t\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );\n\t\t\t\t\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );\n\t\t\t\t\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );\n\t\t\t\t\tvec4 noise = texture2D( normalSampler, uv0 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv1 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv2 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv3 );\n\t\t\t\t\treturn noise * 0.5 - 1.0;\n\t\t\t\t}\n\n\t\t\t\tvoid sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) {\n\t\t\t\t\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );\n\t\t\t\t\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );\n\t\t\t\t\tspecularColor += pow( direction, shiny ) * sunColor * spec;\n\t\t\t\t\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <packing>\n\t\t\t\t#include <bsdfs>\n\t\t\t\t#include <fog_pars_fragment>\n\t\t\t\t#include <logdepthbuf_pars_fragment>\n\t\t\t\t#include <lights_pars_begin>\n\t\t\t\t#include <shadowmap_pars_fragment>\n\t\t\t\t#include <shadowmask_pars_fragment>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <logdepthbuf_fragment>\n\t\t\t\t\tvec4 noise = getNoise( worldPosition.xz * size );\n\t\t\t\t\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );\n\n\t\t\t\t\tvec3 diffuseLight = vec3(0.0);\n\t\t\t\t\tvec3 specularLight = vec3(0.0);\n\n\t\t\t\t\tvec3 worldToEye = eye-worldPosition.xyz;\n\t\t\t\t\tvec3 eyeDirection = normalize( worldToEye );\n\t\t\t\t\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );\n\n\t\t\t\t\tfloat distance = length(worldToEye);\n\n\t\t\t\t\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;\n\t\t\t\t\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );\n\n\t\t\t\t\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );\n\t\t\t\t\tfloat rf0 = 0.3;\n\t\t\t\t\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );\n\t\t\t\t\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;\n\t\t\t\t\tvec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance);\n\t\t\t\t\tvec3 outgoingLight = albedo;\n\t\t\t\t\tgl_FragColor = vec4( outgoingLight, alpha );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <fog_fragment>\n\t\t\t\t}' | |
}; | |
const mMaterial = new require_0Js.ShaderMaterial({ | |
fragmentShader: varAveragePiano.fragmentShader, | |
vertexShader: varAveragePiano.vertexShader, | |
uniforms: require_0Js.UniformsUtils.clone(varAveragePiano.uniforms), | |
lights: true, | |
side: varDriedProgram, | |
fog: varBottleTherefore | |
}); | |
mMaterial.uniforms.mirrorSampler.value = iIWebGlRenderTarget.texture; | |
mMaterial.uniforms.textureMatrix.value = mValue16; | |
mMaterial.uniforms.alpha.value = mValue; | |
mMaterial.uniforms.time.value = mValue2; | |
mMaterial.uniforms.normalSampler.value = mValue4; | |
mMaterial.uniforms.sunColor.value = mValue8; | |
mMaterial.uniforms.waterColor.value = mValue10; | |
mMaterial.uniforms.sunDirection.value = mValue6; | |
mMaterial.uniforms.distortionScale.value = mValue14; | |
mMaterial.uniforms.eye.value = mValue12; | |
_this.material = mMaterial; | |
_this.onBeforeRender = function (argFellTobacco, argLiquidPattern, argDirectlyNearest) { | |
iIVector32.setFromMatrixPosition(_this.matrixWorld); | |
iIVector34.setFromMatrixPosition(argDirectlyNearest.matrixWorld); | |
iIMatrix4.extractRotation(_this.matrixWorld); | |
iIVector3.set(0, 0, 1); | |
iIVector3.applyMatrix4(iIMatrix4); | |
iIVector38.subVectors(iIVector32, iIVector34); | |
if (iIVector38.dot(iIVector3) > 0) { | |
return; | |
} | |
iIVector38.reflect(iIVector3).negate(); | |
iIVector38.add(iIVector32); | |
iIMatrix4.extractRotation(argDirectlyNearest.matrixWorld); | |
iIVector36.set(0, 0, -1); | |
iIVector36.applyMatrix4(iIMatrix4); | |
iIVector36.add(iIVector34); | |
iIVector310.subVectors(iIVector32, iIVector36); | |
iIVector310.reflect(iIVector3).negate(); | |
iIVector310.add(iIVector32); | |
iIPerspectiveCamera.position.copy(iIVector38); | |
iIPerspectiveCamera.up.set(0, 1, 0); | |
iIPerspectiveCamera.up.applyMatrix4(iIMatrix4); | |
iIPerspectiveCamera.up.reflect(iIVector3); | |
iIPerspectiveCamera.lookAt(iIVector310); | |
iIPerspectiveCamera.far = argDirectlyNearest.far; | |
iIPerspectiveCamera.updateMatrixWorld(); | |
iIPerspectiveCamera.projectionMatrix.copy(argDirectlyNearest.projectionMatrix); | |
mValue16.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1); | |
mValue16.multiply(iIPerspectiveCamera.projectionMatrix); | |
mValue16.multiply(iIPerspectiveCamera.matrixWorldInverse); | |
iIPlane.setFromNormalAndCoplanarPoint(iIVector3, iIVector32); | |
iIPlane.applyMatrix4(iIPerspectiveCamera.matrixWorldInverse); | |
iIVector4.set(iIPlane.normal.x, iIPlane.normal.y, iIPlane.normal.z, iIPlane.constant); | |
const p_projectionMatrix = iIPerspectiveCamera.projectionMatrix; | |
iIVector42.x = (Math.sign(iIVector4.x) + p_projectionMatrix.elements[8]) / p_projectionMatrix.elements[0]; | |
iIVector42.y = (Math.sign(iIVector4.y) + p_projectionMatrix.elements[9]) / p_projectionMatrix.elements[5]; | |
iIVector42.z = -1; | |
iIVector42.w = (1 + p_projectionMatrix.elements[10]) / p_projectionMatrix.elements[14]; | |
iIVector4.multiplyScalar(2 / iIVector4.dot(iIVector42)); | |
p_projectionMatrix.elements[2] = iIVector4.x; | |
p_projectionMatrix.elements[6] = iIVector4.y; | |
p_projectionMatrix.elements[10] = iIVector4.z + 1 - varCottonStrange; | |
p_projectionMatrix.elements[14] = iIVector4.w; | |
mValue12.setFromMatrixPosition(argDirectlyNearest.matrixWorld); | |
const varEnemyNeedle = argFellTobacco.getRenderTarget(); | |
const mEnabled = argFellTobacco.xr.enabled; | |
const mAutoUpdate = argFellTobacco.shadowMap.autoUpdate; | |
_this.visible = false; | |
argFellTobacco.xr.enabled = false; | |
argFellTobacco.shadowMap.autoUpdate = false; | |
argFellTobacco.setRenderTarget(iIWebGlRenderTarget); | |
argFellTobacco.state.buffers.depth.setMask(true); | |
if (argFellTobacco.autoClear === false) { | |
argFellTobacco.clear(); | |
} | |
argFellTobacco.render(argLiquidPattern, iIPerspectiveCamera); | |
_this.visible = true; | |
argFellTobacco.xr.enabled = mEnabled; | |
argFellTobacco.shadowMap.autoUpdate = mAutoUpdate; | |
argFellTobacco.setRenderTarget(varEnemyNeedle); | |
const p_viewport = argDirectlyNearest.viewport; | |
if (p_viewport !== undefined) { | |
argFellTobacco.state.viewport(p_viewport); | |
} | |
}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
__webpack_require__.r(exports); | |
__webpack_require__.d(exports, 'Water', function () { | |
return Iììíîìí; | |
}); | |
var Iïììiïí = __webpack_require__(0); | |
class Iììíîìí extends Iïììiïí.Mesh { | |
constructor(Iìiïïïï, Iìiiííi = {}) { | |
super(Iìiïïïï); | |
this.isWater = true; | |
const Iìïíìiî = this; | |
const Iììíîïí = Iìiiííi.textureWidth !== undefined ? Iìiiííi.textureWidth : 512; | |
const Iîììïìì = Iìiiííi.textureHeight !== undefined ? Iìiiííi.textureHeight : 512; | |
const Iïiíìïi = Iìiiííi.clipBias !== undefined ? Iìiiííi.clipBias : 0; | |
const Iîìiíïi = Iìiiííi.alpha !== undefined ? Iìiiííi.alpha : 1; | |
const Iïiìiîì = Iìiiííi.time !== undefined ? Iìiiííi.time : 0; | |
const Iîîìiïì = Iìiiííi.waterNormals !== undefined ? Iìiiííi.waterNormals : null; | |
const Iïiïiîï = Iìiiííi.sunDirection !== undefined ? Iìiiííi.sunDirection : new Iïììiïí.Vector3(0.70707, 0.70707, 0); | |
const Iìïîíîi = new Iïììiïí.Color(Iìiiííi.sunColor !== undefined ? Iìiiííi.sunColor : 16777215); | |
const Iíiîiîi = new Iïììiïí.Color(Iìiiííi.waterColor !== undefined ? Iìiiííi.waterColor : 8355711); | |
const Iíìïííi = Iìiiííi.eye !== undefined ? Iìiiííi.eye : new Iïììiïí.Vector3(0, 0, 0); | |
const Iìiïîïî = Iìiiííi.distortionScale !== undefined ? Iìiiííi.distortionScale : 20; | |
const Iïîîìîì = Iìiiííi.side !== undefined ? Iìiiííi.side : Iïììiïí.FrontSide; | |
const Iiìîîìì = Iìiiííi.fog !== undefined ? Iìiiííi.fog : false; | |
const Iîíîiïì = new Iïììiïí.Plane(); | |
const Iííiìíí = new Iïììiïí.Vector3(); | |
const Iìiìiiï = new Iïììiïí.Vector3(); | |
const Iîìîííi = new Iïììiïí.Vector3(); | |
const Iiíïíïï = new Iïììiïí.Matrix4(); | |
const Iiîïîiì = new Iïììiïí.Vector3(0, 0, -1); | |
const Iïìïïíi = new Iïììiïí.Vector4(); | |
const Iìîíïîí = new Iïììiïí.Vector3(); | |
const Iìïíîïí = new Iïììiïí.Vector3(); | |
const Iííïïìî = new Iïììiïí.Vector4(); | |
const Iiîìíïí = new Iïììiïí.Matrix4(); | |
const Iíïìììì = new Iïììiïí.PerspectiveCamera(); | |
const Iïîíïìî = new Iïììiïí.WebGLRenderTarget(Iììíîïí, Iîììïìì); | |
const Iíîîiii = { | |
uniforms: Iïììiïí.UniformsUtils.merge([ | |
Iïììiïí.UniformsLib.fog, | |
Iïììiïí.UniformsLib.lights, | |
{ | |
normalSampler: { value: null }, | |
mirrorSampler: { value: null }, | |
alpha: { value: 1 }, | |
time: { value: 0 }, | |
size: { value: 1 }, | |
distortionScale: { value: 20 }, | |
textureMatrix: { value: new Iïììiïí.Matrix4() }, | |
sunColor: { value: new Iïììiïí.Color(8355711) }, | |
sunDirection: { value: new Iïììiïí.Vector3(0.70707, 0.70707, 0) }, | |
eye: { value: new Iïììiïí.Vector3() }, | |
waterColor: { value: new Iïììiïí.Color(5592405) } | |
} | |
]), | |
vertexShader: '\n\t\t\t\tuniform mat4 textureMatrix;\n\t\t\t\tuniform float time;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <shadowmap_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tmirrorCoord = modelMatrix * vec4( position, 1.0 );\n\t\t\t\t\tworldPosition = mirrorCoord.xyzw;\n\t\t\t\t\tmirrorCoord = textureMatrix * mirrorCoord;\n\t\t\t\t\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t\t#include <beginnormal_vertex>\n\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t#include <fog_vertex>\n\t\t\t\t#include <shadowmap_vertex>\n\t\t\t}', | |
fragmentShader: '\n\t\t\t\tuniform sampler2D mirrorSampler;\n\t\t\t\tuniform float alpha;\n\t\t\t\tuniform float time;\n\t\t\t\tuniform float size;\n\t\t\t\tuniform float distortionScale;\n\t\t\t\tuniform sampler2D normalSampler;\n\t\t\t\tuniform vec3 sunColor;\n\t\t\t\tuniform vec3 sunDirection;\n\t\t\t\tuniform vec3 eye;\n\t\t\t\tuniform vec3 waterColor;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\tvec4 getNoise( vec2 uv ) {\n\t\t\t\t\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);\n\t\t\t\t\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );\n\t\t\t\t\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );\n\t\t\t\t\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );\n\t\t\t\t\tvec4 noise = texture2D( normalSampler, uv0 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv1 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv2 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv3 );\n\t\t\t\t\treturn noise * 0.5 - 1.0;\n\t\t\t\t}\n\n\t\t\t\tvoid sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) {\n\t\t\t\t\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );\n\t\t\t\t\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );\n\t\t\t\t\tspecularColor += pow( direction, shiny ) * sunColor * spec;\n\t\t\t\t\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <packing>\n\t\t\t\t#include <bsdfs>\n\t\t\t\t#include <fog_pars_fragment>\n\t\t\t\t#include <logdepthbuf_pars_fragment>\n\t\t\t\t#include <lights_pars_begin>\n\t\t\t\t#include <shadowmap_pars_fragment>\n\t\t\t\t#include <shadowmask_pars_fragment>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <logdepthbuf_fragment>\n\t\t\t\t\tvec4 noise = getNoise( worldPosition.xz * size );\n\t\t\t\t\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );\n\n\t\t\t\t\tvec3 diffuseLight = vec3(0.0);\n\t\t\t\t\tvec3 specularLight = vec3(0.0);\n\n\t\t\t\t\tvec3 worldToEye = eye-worldPosition.xyz;\n\t\t\t\t\tvec3 eyeDirection = normalize( worldToEye );\n\t\t\t\t\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );\n\n\t\t\t\t\tfloat distance = length(worldToEye);\n\n\t\t\t\t\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;\n\t\t\t\t\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );\n\n\t\t\t\t\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );\n\t\t\t\t\tfloat rf0 = 0.3;\n\t\t\t\t\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );\n\t\t\t\t\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;\n\t\t\t\t\tvec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance);\n\t\t\t\t\tvec3 outgoingLight = albedo;\n\t\t\t\t\tgl_FragColor = vec4( outgoingLight, alpha );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <fog_fragment>\n\t\t\t\t}' | |
}; | |
const Iîîììiì = new Iïììiïí.ShaderMaterial({ | |
fragmentShader: Iíîîiii.fragmentShader, | |
vertexShader: Iíîîiii.vertexShader, | |
uniforms: Iïììiïí.UniformsUtils.clone(Iíîîiii.uniforms), | |
lights: true, | |
side: Iïîîìîì, | |
fog: Iiìîîìì | |
}); | |
Iîîììiì.uniforms.mirrorSampler.value = Iïîíïìî.texture; | |
Iîîììiì.uniforms.textureMatrix.value = Iiîìíïí; | |
Iîîììiì.uniforms.alpha.value = Iîìiíïi; | |
Iîîììiì.uniforms.time.value = Iïiìiîì; | |
Iîîììiì.uniforms.normalSampler.value = Iîîìiïì; | |
Iîîììiì.uniforms.sunColor.value = Iìïîíîi; | |
Iîîììiì.uniforms.waterColor.value = Iíiîiîi; | |
Iîîììiì.uniforms.sunDirection.value = Iïiïiîï; | |
Iîîììiì.uniforms.distortionScale.value = Iìiïîïî; | |
Iîîììiì.uniforms.eye.value = Iíìïííi; | |
Iìïíìiî.material = Iîîììiì; | |
Iìïíìiî.onBeforeRender = function (Iïìïîíï, Iíîiiîí, Iïiïìîí) { | |
Iìiìiiï.setFromMatrixPosition(Iìïíìiî.matrixWorld); | |
Iîìîííi.setFromMatrixPosition(Iïiïìîí.matrixWorld); | |
Iiíïíïï.extractRotation(Iìïíìiî.matrixWorld); | |
Iííiìíí.set(0, 0, 1); | |
Iííiìíí.applyMatrix4(Iiíïíïï); | |
Iìîíïîí.subVectors(Iìiìiiï, Iîìîííi); | |
if (Iìîíïîí.dot(Iííiìíí) > 0) { | |
return; | |
} | |
Iìîíïîí.reflect(Iííiìíí).negate(); | |
Iìîíïîí.add(Iìiìiiï); | |
Iiíïíïï.extractRotation(Iïiïìîí.matrixWorld); | |
Iiîïîiì.set(0, 0, -1); | |
Iiîïîiì.applyMatrix4(Iiíïíïï); | |
Iiîïîiì.add(Iîìîííi); | |
Iìïíîïí.subVectors(Iìiìiiï, Iiîïîiì); | |
Iìïíîïí.reflect(Iííiìíí).negate(); | |
Iìïíîïí.add(Iìiìiiï); | |
Iíïìììì.position.copy(Iìîíïîí); | |
Iíïìììì.up.set(0, 1, 0); | |
Iíïìììì.up.applyMatrix4(Iiíïíïï); | |
Iíïìììì.up.reflect(Iííiìíí); | |
Iíïìììì.lookAt(Iìïíîïí); | |
Iíïìììì.far = Iïiïìîí.far; | |
Iíïìììì.updateMatrixWorld(); | |
Iíïìììì.projectionMatrix.copy(Iïiïìîí.projectionMatrix); | |
Iiîìíïí.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1); | |
Iiîìíïí.multiply(Iíïìììì.projectionMatrix); | |
Iiîìíïí.multiply(Iíïìììì.matrixWorldInverse); | |
Iîíîiïì.setFromNormalAndCoplanarPoint(Iííiìíí, Iìiìiiï); | |
Iîíîiïì.applyMatrix4(Iíïìììì.matrixWorldInverse); | |
Iïìïïíi.set(Iîíîiïì.normal.x, Iîíîiïì.normal.y, Iîíîiïì.normal.z, Iîíîiïì.constant); | |
const Iíïìîïi = Iíïìììì.projectionMatrix; | |
Iííïïìî.x = (Math.sign(Iïìïïíi.x) + Iíïìîïi.elements[8]) / Iíïìîïi.elements[0]; | |
Iííïïìî.y = (Math.sign(Iïìïïíi.y) + Iíïìîïi.elements[9]) / Iíïìîïi.elements[5]; | |
Iííïïìî.z = -1; | |
Iííïïìî.w = (1 + Iíïìîïi.elements[10]) / Iíïìîïi.elements[14]; | |
Iïìïïíi.multiplyScalar(2 / Iïìïïíi.dot(Iííïïìî)); | |
Iíïìîïi.elements[2] = Iïìïïíi.x; | |
Iíïìîïi.elements[6] = Iïìïïíi.y; | |
Iíïìîïi.elements[10] = Iïìïïíi.z + 1 - Iïiíìïi; | |
Iíïìîïi.elements[14] = Iïìïïíi.w; | |
Iíìïííi.setFromMatrixPosition(Iïiïìîí.matrixWorld); | |
const Iïïìïîí = Iïìïîíï.getRenderTarget(); | |
const Iîïiïiî = Iïìïîíï.xr.enabled; | |
const Iiiîiiî = Iïìïîíï.shadowMap.autoUpdate; | |
Iìïíìiî.visible = false; | |
Iïìïîíï.xr.enabled = false; | |
Iïìïîíï.shadowMap.autoUpdate = false; | |
Iïìïîíï.setRenderTarget(Iïîíïìî); | |
Iïìïîíï.state.buffers.depth.setMask(true); | |
if (Iïìïîíï.autoClear === false) { | |
Iïìïîíï.clear(); | |
} | |
Iïìïîíï.render(Iíîiiîí, Iíïìììì); | |
Iìïíìiî.visible = true; | |
Iïìïîíï.xr.enabled = Iîïiïiî; | |
Iïìïîíï.shadowMap.autoUpdate = Iiiîiiî; | |
Iïìïîíï.setRenderTarget(Iïïìïîí); | |
const Iïîíïïi = Iïiïìîí.viewport; | |
if (Iïîíïïi !== undefined) { | |
Iïìïîíï.state.viewport(Iïîíïïi); | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment