@hology/core 0.0.59 → 0.0.60
Sign up to get free protection for your applications and to get access to all the features.
@@ -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
|
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.
|
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.
|
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"
|