This file contains hidden or 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
| const [sound, setSound] = useState() | |
| const [listener, setListener] = useState() | |
| const [analyser, setAnalyser] = useState() | |
| const [data, setData] = useState(1) | |
| // load a sound and set it as the Audio object's buffer | |
| useEffect(() => { | |
| const listener = new THREE.AudioListener() | |
| setListener(listener) | |
| const sound = new THREE.PositionalAudio(listener) | |
| setSound(sound) |
This file contains hidden or 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
| // | |
| // Description : Array and textureless GLSL 2D/3D/4D simplex | |
| // noise functions. | |
| // Author : Ian McEwan, Ashima Arts. | |
| // Maintainer : stegu | |
| // Lastmod : 20110822 (ijm) | |
| // License : Copyright (C) 2011 Ashima Arts. All rights reserved. | |
| // Distributed under the MIT License. See LICENSE file. | |
| // https://github.com/ashima/webgl-noise | |
| // https://github.com/stegu/webgl-noise |
This file contains hidden or 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
| import * as React from 'react'; | |
| import { Uniform } from 'three'; | |
| import { Effect } from 'postprocessing'; | |
| const fragmentShader = ` | |
| void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) { | |
| if (uv.y < .5) discard; | |
| outputColor = vec4(vec3(average(inputColor.rgb)), inputColor.a); | |
| }`; |
This file contains hidden or 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
| let Web3 = require("web3"); | |
| // Replace value of rpc with https://rpc-mumbai.matic.today for Mumbai | |
| let rpc = "https://rpc-mainnet.matic.network"; | |
| const provider = new Web3.providers.HttpProvider(rpc); | |
| const web3 = new Web3(provider); | |
| // Add your private key | |
| web3.eth.accounts.wallet.add("pvt-key"); |
This file contains hidden or 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
| #define SHADER_NAME PolyhedronMaterial | |
| precision highp float; | |
| uniform sampler2D map; | |
| uniform vec2 uvDisp; | |
| uniform float time; | |
| varying float smoothShading; | |
| // varying vec3 viewPos; | |
| varying vec2 vUV; |
This file contains hidden or 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
| import React, { useEffect, useMemo } from 'react' | |
| import { useFrame, useThree, extend, useLoader } from 'react-three-fiber' | |
| import * as THREE from 'three' | |
| import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer' | |
| import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass' | |
| import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass' | |
| // import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass' | |
| import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader' |
This file contains hidden or 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
| let excludedActivityTypes = [ | |
| UIActivity.ActivityType.print, | |
| UIActivity.ActivityType.openInIBooks, | |
| UIActivity.ActivityType.copyToPasteboard, | |
| UIActivity.ActivityType.addToReadingList, | |
| UIActivity.ActivityType.assignToContact, | |
| UIActivity.ActivityType.copyToPasteboard, | |
| UIActivity.ActivityType.mail, | |
| UIActivity.ActivityType.markupAsPDF, | |
| UIActivity.ActivityType.postToFacebook, |
This file contains hidden or 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
| _this.pass = new NukePass("ExperienceOverlay", { | |
| unique: "exp_overlay", | |
| uOverlay: { | |
| value: 0 | |
| }, | |
| tNormal: { | |
| value: null, | |
| getTexture: Utils3D.getRepeatTexture | |
| }, | |
| uLightStr: { |
This file contains hidden or 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
| Class((function SoundIcon() { | |
| Inherit(this, Element); | |
| const _this = this, | |
| $this = _this.element, | |
| _bars = []; | |
| var _audioCtrl, _analyser, _analyserArray; | |
| const RANGE = [255, 100, 140]; | |
| function hover({ | |
| action: action |
This file contains hidden or 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
| Class((function GazeCamera(_input, _group) { | |
| Inherit(this, BaseCamera); | |
| const _this = this; | |
| var _strength = { | |
| v: 1 | |
| }, | |
| _move = new Vector3, | |
| _position = new Vector3, | |
| _wobble = new Vector3, | |
| _rotation = 0, |