@hology/core 0.0.85 → 0.0.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{__decorate as e,__metadata as t}from"tslib";import{Color as a,MeshStandardMaterial as p,Texture as i,Vector2 as d}from"three";import{Shader as r}from"../shader.js";import{Parameter as s}from"../parameter.js";import{removeObjectUndefined as o}from"../../utils/collections.js";export class StandardShader extends r{constructor(){super(...arguments),this.color=new a("#FFFFFF"),this.opacity=1}build(){return new p(o({color:this.color,opacity:this.opacity,roughness:this.roughness,metalness:this.metalness,map:this.map,lightMap:this.lightMap,lightMapIntensity:this.lightMapIntensity,aoMap:this.aoMap,aoMapIntensity:this.aoMapIntensity,emissive:this.emissive,emissiveIntensity:this.emissiveIntensity,emissiveMap:this.emissiveMap,bumpMap:this.bumpMap,bumpScale:this.bumpScale,normalMap:this.normalMap,normalScale:this.normalScale,displacementMap:this.displacementMap,displacementScale:this.displacementScale,displacementBias:this.displacementBias,roughnessMap:this.roughnessMap,metalnessMap:this.metalnessMap,alphaMap:this.alphaMap,envMap:this.envMap,envMapIntensity:this.envMapIntensity,refractionRatio:this.refractionRatio}))}}e([s(),t("design:type",a)],StandardShader.prototype,"color",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"opacity",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"roughness",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"metalness",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"map",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"lightMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"lightMapIntensity",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"aoMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"aoMapIntensity",void 0),e([s(),t("design:type",a)],StandardShader.prototype,"emissive",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"emissiveIntensity",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"emissiveMap",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"bumpMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"bumpScale",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"normalMap",void 0),e([s(),t("design:type",d)],StandardShader.prototype,"normalScale",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"displacementMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"displacementScale",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"displacementBias",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"roughnessMap",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"metalnessMap",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"alphaMap",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"envMap",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"envMapIntensity",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"refractionRatio",void 0);
1
+ import{__decorate as e,__metadata as t}from"tslib";import{Color as a,MeshStandardMaterial as p,Texture as i,Vector2 as d}from"three";import{Shader as r}from"../shader.js";import{Parameter as s}from"../parameter.js";import{removeObjectUndefined as o}from"../../utils/collections.js";export class StandardShader extends r{constructor(){super(...arguments),this.color=new a("#FFFFFF"),this.opacity=1,this.roughness=1,this.metalness=0}build(){return new p(o({color:this.color,opacity:this.opacity,roughness:this.roughness,metalness:this.metalness,map:this.map,lightMap:this.lightMap,lightMapIntensity:this.lightMapIntensity,aoMap:this.aoMap,aoMapIntensity:this.aoMapIntensity,emissive:this.emissive,emissiveIntensity:this.emissiveIntensity,emissiveMap:this.emissiveMap,bumpMap:this.bumpMap,bumpScale:this.bumpScale,normalMap:this.normalMap,normalScale:this.normalScale,displacementMap:this.displacementMap,displacementScale:this.displacementScale,displacementBias:this.displacementBias,roughnessMap:this.roughnessMap,metalnessMap:this.metalnessMap,alphaMap:this.alphaMap,envMap:this.envMap,envMapIntensity:this.envMapIntensity,refractionRatio:this.refractionRatio}))}}e([s(),t("design:type",a)],StandardShader.prototype,"color",void 0),e([s({label:"Color Map"}),t("design:type",i)],StandardShader.prototype,"map",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"opacity",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"alphaMap",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"roughness",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"roughnessMap",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"metalness",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"metalnessMap",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"lightMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"lightMapIntensity",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"aoMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"aoMapIntensity",void 0),e([s(),t("design:type",a)],StandardShader.prototype,"emissive",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"emissiveIntensity",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"emissiveMap",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"bumpMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"bumpScale",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"normalMap",void 0),e([s(),t("design:type",d)],StandardShader.prototype,"normalScale",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"displacementMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"displacementScale",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"displacementBias",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"envMap",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"envMapIntensity",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"refractionRatio",void 0);
2
2
  /*
3
3
  * Copyright (©) 2023. All rights reserved.
4
4
  * See the LICENSE.md file for details.
@@ -15,6 +15,7 @@ export interface ParameterOptions {
15
15
  type?: ParameterType;
16
16
  options?: ParameterOption<unknown>[];
17
17
  array?: boolean;
18
+ label?: string;
18
19
  }
19
20
  export interface PropertyParameter {
20
21
  name: string;
@@ -1,5 +1,5 @@
1
- import { FloatNode, Vec3Node } from "three-shader-graph";
2
- export declare function fresnelEffect(power?: number | FloatNode, normal?: Vec3Node): FloatNode;
1
+ import { FloatNode } from "three-shader-graph";
2
+ export declare function fresnelEffect(power?: number | FloatNode): FloatNode;
3
3
  /**
4
4
  * Gives a factor for how shallow the depth is where 1 is the most shallow.
5
5
  * This can be useful to for example create a highlight where an object intersects
@@ -1,4 +1,4 @@
1
- import{Vec3ExpressionNode as t,attributes as e,dot as r,float as o,normalize as c,pow as i,saturate as n,uniforms as s,varyingAttributes as a,varyingVec3 as m,vec4 as p}from"three-shader-graph";import{fragmentLinearEyeDepth as u,linearEyeDepth as f}from"./depth.js";const l=s.modelMatrix.multiplyVec(p(e.position,1)),d=s.modelMatrix.multiplyVec(p(e.normal,0)).xyz;export function fresnelEffect(e=1,s=d){const a=new t("cameraPosition"),m=c(a.subtract(l.xyz)),p=o(1);return i(n(p.subtract(r(s,m))),o(e))}const x=o(1).subtract(f.subtract(u).divide(f));export function edgeDepthEffect(t=1){return i(x,o(t))}
1
+ import{Vec3ExpressionNode as t,attributes as r,dot as e,float as o,normalize as i,pow as f,saturate as m,transformed as n,uniforms as p,varyingAttributes as c,varyingVec3 as s,vec4 as a}from"three-shader-graph";import{fragmentLinearEyeDepth as u,linearEyeDepth as d}from"./depth.js";import{oneMinus as h}from"./math.js";p.modelMatrix.multiplyVec(a(r.position,1));export function fresnelEffect(t=1){return f(h(m(e(n.viewDir,n.normal))),o(t))}const l=o(1).subtract(d.subtract(u).divide(d));export function edgeDepthEffect(t=1){return f(l,o(t))}
2
2
  /*
3
3
  * Copyright (©) 2023. All rights reserved.
4
4
  * See the LICENSE.md file for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hology/core",
3
- "version": "0.0.85",
3
+ "version": "0.0.87",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",