Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

troika-three-utils

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

troika-three-utils - npm Package Compare versions

Comparing version 0.44.0 to 0.45.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [0.45.0](https://github.com/protectwise/troika/compare/v0.44.0...v0.45.0) (2022-01-02)
### Bug Fixes
* **createDerivedMaterial:** propagate the base material's customProgramCacheKey ([9c8c6b1](https://github.com/protectwise/troika/commit/9c8c6b1e472f4068a8c6b0f1a6f3e32c935f8077))
# [0.44.0](https://github.com/protectwise/troika/compare/v0.43.1-alpha.0...v0.44.0) (2021-11-14)

@@ -8,0 +19,0 @@

2

dist/troika-three-utils.esm.js

@@ -225,3 +225,3 @@ import { ShaderChunk, UniformsUtils, MeshDepthMaterial, RGBADepthPacking, MeshDistanceMaterial, ShaderLib, Matrix4, Vector3, Mesh, CylinderBufferGeometry, Vector2, MeshStandardMaterial, DoubleSide } from 'three';

value: function () {
return optionsKey
return baseMaterial.customProgramCacheKey() + '|' + optionsKey
}

@@ -228,0 +228,0 @@ },

@@ -229,3 +229,3 @@ (function (global, factory) {

value: function () {
return optionsKey
return baseMaterial.customProgramCacheKey() + '|' + optionsKey
}

@@ -232,0 +232,0 @@ },

'use strict';(function(f,d){"object"===typeof exports&&"undefined"!==typeof module?d(exports,require("three")):"function"===typeof define&&define.amd?define(["exports","three"],d):(f="undefined"!==typeof globalThis?globalThis:f||self,d(f.troika_three_utils={},f.THREE))})(this,function(f,d){function q(a){return a.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,function(a,g){return(g=d.ShaderChunk[g])?q(g):a})}function l(a,b){let g=C(b),c=n.get(a);c||n.set(a,c=Object.create(null));if(c[g])return new c[g];
let t=`_onBeforeCompile${g}`,f=function(h){a.onBeforeCompile.call(this,h);const c=this.customProgramCacheKey()+"|"+h.vertexShader+"|"+h.fragmentShader;var d=v[c];d||(d=D(h,b,g),d=v[c]=d);h.vertexShader=d.vertexShader;h.fragmentShader=d.fragmentShader;k(h.uniforms,this.uniforms);b.timeUniform&&(h.uniforms[b.timeUniform]={get value(){return Date.now()-E}});if(this[t])this[t](h)},u=function(){return m(b.chained?a:a.clone())},m=function(h){const c=Object.create(h,F);Object.defineProperty(c,"baseMaterial",
{value:a});Object.defineProperty(c,"id",{value:G++});{var d=4294967295*Math.random()|0;let a=4294967295*Math.random()|0,b=4294967295*Math.random()|0,c=4294967295*Math.random()|0;d=(e[d&255]+e[d>>8&255]+e[d>>16&255]+e[d>>24&255]+"-"+e[a&255]+e[a>>8&255]+"-"+e[a>>16&15|64]+e[a>>24&255]+"-"+e[b&63|128]+e[b>>8&255]+"-"+e[b>>16&255]+e[b>>24&255]+e[c&255]+e[c>>8&255]+e[c>>16&255]+e[c>>24&255]).toUpperCase()}c.uuid=d;c.uniforms=k({},h.uniforms,b.uniforms);c.defines=k({},h.defines,b.defines);c.defines[`TROIKA_DERIVED_MATERIAL_${g}`]=
"";c.extensions=k({},h.extensions,b.extensions);c._listeners=void 0;return c},F={constructor:{value:u},isDerivedMaterial:{value:!0},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return g}},onBeforeCompile:{get(){return f},set(a){this[t]=a}},copy:{writable:!0,configurable:!0,value:function(b){a.copy.call(this,b);a.isShaderMaterial||a.isDerivedMaterial||(k(this.extensions,b.extensions),k(this.defines,b.defines),k(this.uniforms,d.UniformsUtils.clone(b.uniforms)));return this}},
clone:{writable:!0,configurable:!0,value:function(){const b=new a.constructor;return m(b).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let c=this._depthMaterial;c||(c=this._depthMaterial=l(a.isDerivedMaterial?a.getDepthMaterial():new d.MeshDepthMaterial({depthPacking:d.RGBADepthPacking}),b),c.defines.IS_DEPTH_MATERIAL="",c.uniforms=this.uniforms);return c}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let c=this._distanceMaterial;c||(c=this._distanceMaterial=
l(a.isDerivedMaterial?a.getDistanceMaterial():new d.MeshDistanceMaterial,b),c.defines.IS_DISTANCE_MATERIAL="",c.uniforms=this.uniforms);return c}},dispose:{writable:!0,configurable:!0,value(){const {_depthMaterial:b,_distanceMaterial:c}=this;b&&b.dispose();c&&c.dispose();a.dispose.call(this)}}};c[g]=u;return new u}function D({vertexShader:a,fragmentShader:b},d,c){let {vertexDefs:g,vertexMainIntro:e,vertexMainOutro:f,vertexTransform:m,fragmentDefs:k,fragmentMainIntro:h,fragmentMainOutro:p,fragmentColorTransform:l,
customRewriter:r,timeUniform:n}=d;g=g||"";e=e||"";f=f||"";k=k||"";h=h||"";p=p||"";if(m||r)a=q(a);if(l||r)b=b.replace(/^[ \t]*#include <((?:tonemapping|encodings|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n"),b=q(b);r&&(b=r({vertexShader:a,fragmentShader:b}),a=b.vertexShader,b=b.fragmentShader);if(l){let a=[];b=b.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,b=>{a.push(b);return""});p=`${l}\n${a.join("\n")}\n${p}`}n&&(d=`\nuniform float ${n};\n`,
g=d+g,k=d+k);m&&(g=`${g}
"";c.extensions=k({},h.extensions,b.extensions);c._listeners=void 0;return c},F={constructor:{value:u},isDerivedMaterial:{value:!0},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return a.customProgramCacheKey()+"|"+g}},onBeforeCompile:{get(){return f},set(a){this[t]=a}},copy:{writable:!0,configurable:!0,value:function(b){a.copy.call(this,b);a.isShaderMaterial||a.isDerivedMaterial||(k(this.extensions,b.extensions),k(this.defines,b.defines),k(this.uniforms,d.UniformsUtils.clone(b.uniforms)));
return this}},clone:{writable:!0,configurable:!0,value:function(){const b=new a.constructor;return m(b).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let c=this._depthMaterial;c||(c=this._depthMaterial=l(a.isDerivedMaterial?a.getDepthMaterial():new d.MeshDepthMaterial({depthPacking:d.RGBADepthPacking}),b),c.defines.IS_DEPTH_MATERIAL="",c.uniforms=this.uniforms);return c}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let c=this._distanceMaterial;c||
(c=this._distanceMaterial=l(a.isDerivedMaterial?a.getDistanceMaterial():new d.MeshDistanceMaterial,b),c.defines.IS_DISTANCE_MATERIAL="",c.uniforms=this.uniforms);return c}},dispose:{writable:!0,configurable:!0,value(){const {_depthMaterial:b,_distanceMaterial:c}=this;b&&b.dispose();c&&c.dispose();a.dispose.call(this)}}};c[g]=u;return new u}function D({vertexShader:a,fragmentShader:b},d,c){let {vertexDefs:g,vertexMainIntro:e,vertexMainOutro:f,vertexTransform:m,fragmentDefs:k,fragmentMainIntro:h,fragmentMainOutro:p,
fragmentColorTransform:l,customRewriter:r,timeUniform:n}=d;g=g||"";e=e||"";f=f||"";k=k||"";h=h||"";p=p||"";if(m||r)a=q(a);if(l||r)b=b.replace(/^[ \t]*#include <((?:tonemapping|encodings|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n"),b=q(b);r&&(b=r({vertexShader:a,fragmentShader:b}),a=b.vertexShader,b=b.fragmentShader);if(l){let a=[];b=b.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,b=>{a.push(b);return""});p=`${l}\n${a.join("\n")}\n${p}`}n&&
(d=`\nuniform float ${n};\n`,g=d+g,k=d+k);m&&(g=`${g}
void troikaVertexTransform${c}(inout vec3 position, inout vec3 normal, inout vec2 uv) {

@@ -10,0 +10,0 @@ ${m}

{
"name": "troika-three-utils",
"version": "0.44.0",
"version": "0.45.0",
"description": "Various utilities related to Three.js",

@@ -19,3 +19,3 @@ "author": "Jason Johnston <jason.johnston@protectwise.com>",

},
"gitHead": "a6b913e475a3a8459b2f758c709b8feb16966ed1"
"gitHead": "a1ab2b36832518827f444a8654053a4b0d5d95d7"
}

@@ -176,3 +176,3 @@ import { voidMainRegExp } from './voidMainRegExp.js'

value: function () {
return optionsKey
return baseMaterial.customProgramCacheKey() + '|' + optionsKey
}

@@ -179,0 +179,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc