@hology/core 0.0.59 → 0.0.60

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{Vector2 as e}from"three";import{dot as t,FloatExpressionNode as o,FloatNode as r,texture2d as n,uniformVec2 as s,Vec2ExpressionNode as a,Vec4Node as c,uniformSampler2d as p,uniformFloat as i}from"three-shader-graph";export function supportsDepthTextureExtension(e){return!!e.extensions.get("WEBGL_depth_texture")}export const depthUniformName="hology_depth_map";export const resolutionUniformName="hology_resolution";export const nearUniformName="hology_camera_near";export const farUniformName="hology_camera_far";export const depthSampler=p(depthUniformName);const h=i(nearUniformName,.5),m=i(farUniformName,500);class l extends r{compile(e){const t=e.variable();var o=e.get(h),r=e.get(m);return{chunk:`\n float depth_${t} = 2.0 * ${o} * ${r} / (${r} + ${o} - (2.0 * ${e.get(this.depth)} - 1.0) * (${r} - ${o}));\n `,out:`depth_${t}`}}constructor(e){super(),this.depth=e}}function u(e){return new l(e)}const _=new class extends c{constructor(){super(...arguments),this.k="31u50"}compile(e){return{pars:`\n const float UnpackDownscale_${this.k} = 255. / 256.; // 0..1 -> fraction (excluding 1)\n const vec3 PackFactors_${this.k} = vec3( 256. * 256. * 256., 256. * 256., 256. );\n const vec4 UnpackFactors_${this.k} = UnpackDownscale_${this.k} / vec4( PackFactors_${this.k}, 1. );\n `,out:`UnpackFactors_${this.k}`}}};const d=new o("gl_FragCoord.z");export const fragmentLinearEyeDepth=u(d);const f=s("hology_resolution",new e(250,1e3)),g=new a("gl_FragCoord.xy").divide(f);export const linearEyeDepth=u((x=g,$=n(depthSampler,x),t($,_)));var x,$;
1
+ import{Vector2 as e}from"three";import{dot as t,FloatExpressionNode as o,FloatNode as r,texture2d as n,uniformVec2 as a,Vec2ExpressionNode as s,Vec4Node as c,uniformSampler2d as p,uniformFloat as i}from"three-shader-graph";import*as h from"three";export function supportsDepthTextureExtension(e){return!!e.extensions.get("WEBGL_depth_texture")}export const depthUniformName="hology_depth_map";export const resolutionUniformName="hology_resolution";export const nearUniformName="hology_camera_near";export const farUniformName="hology_camera_far";export const depthSampler=p(depthUniformName,new h.DepthTexture(1,1));const m=i(nearUniformName,.5),l=i(farUniformName,500);class u extends r{compile(e){const t=e.variable();var o=e.get(m),r=e.get(l);return{chunk:`\n float depth_${t} = 2.0 * ${o} * ${r} / (${r} + ${o} - (2.0 * ${e.get(this.depth)} - 1.0) * (${r} - ${o}));\n `,out:`depth_${t}`}}constructor(e){super(),this.depth=e}}function _(e){return new u(e)}const f=new class extends c{constructor(){super(...arguments),this.k="31u50"}compile(e){return{pars:`\n const float UnpackDownscale_${this.k} = 255. / 256.; // 0..1 -> fraction (excluding 1)\n const vec4 PackFactors_${this.k} = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\n const vec4 UnpackFactors_${this.k} = vec4( UnpackDownscale_${this.k} / PackFactors_${this.k}.rgb, 1.0 / PackFactors_${this.k}.a );\n `,out:`UnpackFactors_${this.k}`}}};const d=new o("gl_FragCoord.z");export const fragmentLinearEyeDepth=_(d);const g=a("hology_resolution",new e(250,1e3)),x=new s("gl_FragCoord.xy").divide(g);export const linearEyeDepth=_((k=x,$=n(depthSampler,k),t($,f)));var k,$;
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.59",
3
+ "version": "0.0.60",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -82,6 +82,9 @@
82
82
  },
83
83
  "author": "",
84
84
  "license": "SEE LICENSE IN LICENSE.md",
85
+ "peerDependencies": {
86
+ "three": ">=0.169.0"
87
+ },
85
88
  "dependencies": {
86
89
  "@babel/runtime": "^7.24.8",
87
90
  "@dimforge/rapier3d-compat": "^0.13.1",
@@ -89,11 +92,10 @@
89
92
  "@types/three-nebula": "^10.0.3",
90
93
  "recast-navigation": "^0.30.0",
91
94
  "rxjs": "7.8.1",
92
- "three": "^0.169.0",
93
95
  "three-csm": "^4.2.1",
94
96
  "three-mesh-bvh": "^0.7.5",
95
97
  "three-nebula": "^10.0.3",
96
- "three-shader-graph": "0.2.1",
98
+ "three-shader-graph": "0.2.6",
97
99
  "three-stdlib": "2.34.0",
98
100
  "ts-key-enum": "^2.0.12",
99
101
  "typedi": "^0.10.0"