react-native-shine 0.7.0 → 0.8.0

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.
Files changed (130) hide show
  1. package/lib/module/components/Content.js +126 -135
  2. package/lib/module/components/Content.js.map +1 -1
  3. package/lib/module/components/Shine.js +22 -3
  4. package/lib/module/components/Shine.js.map +1 -1
  5. package/lib/module/components/ShineGroup.js +0 -4
  6. package/lib/module/components/ShineGroup.js.map +1 -1
  7. package/lib/module/enums/colorPresets.js +192 -0
  8. package/lib/module/enums/colorPresets.js.map +1 -1
  9. package/lib/module/enums/effectDefaults.js +59 -0
  10. package/lib/module/enums/effectDefaults.js.map +1 -0
  11. package/lib/module/enums/effectPresets.js +67 -10
  12. package/lib/module/enums/effectPresets.js.map +1 -1
  13. package/lib/module/shaders/bindGroupLayouts.js +50 -27
  14. package/lib/module/shaders/bindGroupLayouts.js.map +1 -1
  15. package/lib/module/shaders/bindGroupUtils.js +30 -44
  16. package/lib/module/shaders/bindGroupUtils.js.map +1 -1
  17. package/lib/module/shaders/colorConversions.js +78 -0
  18. package/lib/module/shaders/colorConversions.js.map +1 -0
  19. package/lib/module/shaders/computeShaders/precomputeColorMask.js +34 -0
  20. package/lib/module/shaders/computeShaders/precomputeColorMask.js.map +1 -0
  21. package/lib/module/shaders/fragmentShaders/baseTextureFragment.js +4 -9
  22. package/lib/module/shaders/fragmentShaders/baseTextureFragment.js.map +1 -1
  23. package/lib/module/shaders/fragmentShaders/colorMaskFragment.js +28 -41
  24. package/lib/module/shaders/fragmentShaders/colorMaskFragment.js.map +1 -1
  25. package/lib/module/shaders/fragmentShaders/glareFlareFragment.js +84 -0
  26. package/lib/module/shaders/fragmentShaders/glareFlareFragment.js.map +1 -0
  27. package/lib/module/shaders/fragmentShaders/glareFragment.js +8 -88
  28. package/lib/module/shaders/fragmentShaders/glareFragment.js.map +1 -1
  29. package/lib/module/shaders/fragmentShaders/holoFragment.js +120 -11
  30. package/lib/module/shaders/fragmentShaders/holoFragment.js.map +1 -1
  31. package/lib/module/shaders/fragmentShaders/maskFragment.js +5 -4
  32. package/lib/module/shaders/fragmentShaders/maskFragment.js.map +1 -1
  33. package/lib/module/shaders/fragmentShaders/reverseHoloFragment.js +7 -7
  34. package/lib/module/shaders/fragmentShaders/reverseHoloFragment.js.map +1 -1
  35. package/lib/module/shaders/pipelineSetups.js +5 -62
  36. package/lib/module/shaders/pipelineSetups.js.map +1 -1
  37. package/lib/module/shaders/resourceManagement/bufferManager.js.map +1 -1
  38. package/lib/module/shaders/resourceManagement/buffersMap.js +41 -0
  39. package/lib/module/shaders/resourceManagement/buffersMap.js.map +1 -0
  40. package/lib/module/shaders/resourceManagement/pipelineMap.js +115 -0
  41. package/lib/module/shaders/resourceManagement/pipelineMap.js.map +1 -0
  42. package/lib/module/shaders/resourceManagement/textures.js +2 -2
  43. package/lib/module/shaders/resourceManagement/textures.js.map +1 -1
  44. package/lib/module/shaders/tgpuUtils.js +41 -0
  45. package/lib/module/shaders/tgpuUtils.js.map +1 -1
  46. package/lib/module/shaders/utils.js +21 -2
  47. package/lib/module/shaders/utils.js.map +1 -1
  48. package/lib/module/shaders/vertexShaders/mainRotationEffectVertex.js +4 -4
  49. package/lib/module/shaders/vertexShaders/mainRotationEffectVertex.js.map +1 -1
  50. package/lib/module/types/typeUtils.js +29 -159
  51. package/lib/module/types/typeUtils.js.map +1 -1
  52. package/lib/module/types/types.js +8 -1
  53. package/lib/module/types/types.js.map +1 -1
  54. package/lib/module/utils/size.js +4 -4
  55. package/lib/module/utils/vector.js +38 -38
  56. package/lib/typescript/src/components/Content.d.ts +6 -6
  57. package/lib/typescript/src/components/Content.d.ts.map +1 -1
  58. package/lib/typescript/src/components/Shine.d.ts.map +1 -1
  59. package/lib/typescript/src/components/ShineGroup.d.ts +1 -1
  60. package/lib/typescript/src/components/ShineGroup.d.ts.map +1 -1
  61. package/lib/typescript/src/enums/colorPresets.d.ts +152 -0
  62. package/lib/typescript/src/enums/colorPresets.d.ts.map +1 -1
  63. package/lib/typescript/src/enums/effectDefaults.d.ts +39 -0
  64. package/lib/typescript/src/enums/effectDefaults.d.ts.map +1 -0
  65. package/lib/typescript/src/enums/effectPresets.d.ts +284 -5
  66. package/lib/typescript/src/enums/effectPresets.d.ts.map +1 -1
  67. package/lib/typescript/src/shaders/bindGroupLayouts.d.ts +82 -41
  68. package/lib/typescript/src/shaders/bindGroupLayouts.d.ts.map +1 -1
  69. package/lib/typescript/src/shaders/bindGroupUtils.d.ts +86 -70
  70. package/lib/typescript/src/shaders/bindGroupUtils.d.ts.map +1 -1
  71. package/lib/typescript/src/shaders/colorConversions.d.ts +4 -0
  72. package/lib/typescript/src/shaders/colorConversions.d.ts.map +1 -0
  73. package/lib/typescript/src/shaders/computeShaders/precomputeColorMask.d.ts +5 -0
  74. package/lib/typescript/src/shaders/computeShaders/precomputeColorMask.d.ts.map +1 -0
  75. package/lib/typescript/src/shaders/fragmentShaders/baseTextureFragment.d.ts.map +1 -1
  76. package/lib/typescript/src/shaders/fragmentShaders/colorMaskFragment.d.ts.map +1 -1
  77. package/lib/typescript/src/shaders/fragmentShaders/glareFlareFragment.d.ts +5 -0
  78. package/lib/typescript/src/shaders/fragmentShaders/glareFlareFragment.d.ts.map +1 -0
  79. package/lib/typescript/src/shaders/fragmentShaders/glareFragment.d.ts +0 -3
  80. package/lib/typescript/src/shaders/fragmentShaders/glareFragment.d.ts.map +1 -1
  81. package/lib/typescript/src/shaders/fragmentShaders/holoFragment.d.ts +7 -0
  82. package/lib/typescript/src/shaders/fragmentShaders/holoFragment.d.ts.map +1 -1
  83. package/lib/typescript/src/shaders/fragmentShaders/maskFragment.d.ts.map +1 -1
  84. package/lib/typescript/src/shaders/fragmentShaders/reverseHoloFragment.d.ts.map +1 -1
  85. package/lib/typescript/src/shaders/pipelineSetups.d.ts +3 -10
  86. package/lib/typescript/src/shaders/pipelineSetups.d.ts.map +1 -1
  87. package/lib/typescript/src/shaders/resourceManagement/bufferManager.d.ts +5 -3
  88. package/lib/typescript/src/shaders/resourceManagement/bufferManager.d.ts.map +1 -1
  89. package/lib/typescript/src/shaders/resourceManagement/buffersMap.d.ts +10 -0
  90. package/lib/typescript/src/shaders/resourceManagement/buffersMap.d.ts.map +1 -0
  91. package/lib/typescript/src/shaders/resourceManagement/pipelineMap.d.ts +24 -0
  92. package/lib/typescript/src/shaders/resourceManagement/pipelineMap.d.ts.map +1 -0
  93. package/lib/typescript/src/shaders/resourceManagement/textures.d.ts +0 -1
  94. package/lib/typescript/src/shaders/resourceManagement/textures.d.ts.map +1 -1
  95. package/lib/typescript/src/shaders/tgpuUtils.d.ts +3 -0
  96. package/lib/typescript/src/shaders/tgpuUtils.d.ts.map +1 -1
  97. package/lib/typescript/src/shaders/utils.d.ts +1 -0
  98. package/lib/typescript/src/shaders/utils.d.ts.map +1 -1
  99. package/lib/typescript/src/types/typeUtils.d.ts +16 -51
  100. package/lib/typescript/src/types/typeUtils.d.ts.map +1 -1
  101. package/lib/typescript/src/types/types.d.ts +59 -54
  102. package/lib/typescript/src/types/types.d.ts.map +1 -1
  103. package/package.json +1 -1
  104. package/src/components/Content.tsx +130 -269
  105. package/src/components/Shine.tsx +28 -3
  106. package/src/components/ShineGroup.tsx +0 -4
  107. package/src/enums/colorPresets.ts +59 -1
  108. package/src/enums/effectDefaults.ts +57 -0
  109. package/src/enums/effectPresets.ts +142 -9
  110. package/src/shaders/bindGroupLayouts.ts +64 -28
  111. package/src/shaders/bindGroupUtils.ts +66 -69
  112. package/src/shaders/colorConversions.ts +88 -0
  113. package/src/shaders/computeShaders/precomputeColorMask.ts +29 -0
  114. package/src/shaders/fragmentShaders/baseTextureFragment.ts +2 -10
  115. package/src/shaders/fragmentShaders/colorMaskFragment.ts +34 -55
  116. package/src/shaders/fragmentShaders/glareFlareFragment.ts +79 -0
  117. package/src/shaders/fragmentShaders/glareFragment.ts +9 -84
  118. package/src/shaders/fragmentShaders/holoFragment.ts +139 -11
  119. package/src/shaders/fragmentShaders/maskFragment.ts +3 -9
  120. package/src/shaders/fragmentShaders/reverseHoloFragment.ts +4 -9
  121. package/src/shaders/pipelineSetups.ts +16 -125
  122. package/src/shaders/resourceManagement/bufferManager.ts +8 -3
  123. package/src/shaders/resourceManagement/buffersMap.ts +80 -0
  124. package/src/shaders/resourceManagement/pipelineMap.ts +169 -0
  125. package/src/shaders/resourceManagement/textures.ts +2 -2
  126. package/src/shaders/tgpuUtils.ts +29 -0
  127. package/src/shaders/utils.ts +29 -0
  128. package/src/shaders/vertexShaders/mainRotationEffectVertex.ts +2 -2
  129. package/src/types/typeUtils.ts +53 -164
  130. package/src/types/types.ts +111 -60
@@ -3,97 +3,17 @@
3
3
  import tgpu from 'typegpu';
4
4
  import * as d from 'typegpu/data';
5
5
  import * as std from 'typegpu/std';
6
- import { rotationBindGroupLayout, textureBindGroupLayout, glareBindGroupLayout
7
- // colorMaskBindGroupLayout,
8
- } from "../bindGroupLayouts.js";
9
- import { glareColorShift, hueShift, overlayChannels } from "../tgpuUtils.js";
6
+ import { sharedBindGroupLayout, glareBindGroupLayout } from "../bindGroupLayouts.js";
7
+ import { getPixelColorFromVector, glareColorShift, hueShift, overlayChannels } from "../tgpuUtils.js";
10
8
  export const glareFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['~unstable'].fragmentFn({
11
9
  in: {
12
10
  uv: d.vec2f
13
11
  },
14
12
  out: d.vec4f
15
13
  })(($ => (globalThis.__TYPEGPU_META__ ??= new WeakMap()).set($.f = input => {
16
- const texcoord = d.vec2f(input.uv.x, 1.0 - input.uv.y);
17
- const uv = d.vec2f(input.uv.x, 1.0 - input.uv.y);
18
- const centeredCoords = std.sub(std.mul(uv, 2.0), 1); //-1 to 1
19
-
20
- const rot = rotationBindGroupLayout.$.vec;
21
- const center = std.add(d.vec2f(0.0), d.vec2f(rot.x, rot.y));
22
- const glareOptions = glareBindGroupLayout.$.glareOptions;
23
- const glareIntensity = glareOptions.glareIntensity;
24
- const glowPower = glareOptions.glowPower;
25
- const lightIntensity = glareOptions.lightIntensity;
26
- const glareColor = glareOptions.glareColor;
27
- const hueBlendPower = glareColor.hueBlendPower;
28
- const hueShiftAngleMax = glareColor.hueShiftAngleMax;
29
- const hueShiftAngleMin = glareColor.hueShiftAngleMin;
30
-
31
- // const mask = colorMaskBindGroupLayout.$.mask;
32
- // const maskedColor = mask.baseColor;
33
- // const rgbToleranceRange = mask.rgbToleranceRange;
34
-
35
- let color = std.textureSample(textureBindGroupLayout.$.texture, textureBindGroupLayout.$.sampler, texcoord);
36
-
37
- // const maskedColorLower = std.sub(maskedColor, rgbToleranceRange.lower);
38
- // const maskedColorUpper = std.add(maskedColor, rgbToleranceRange.upper);
39
- // const upperCheck = std.all(std.le(color.xyz, maskedColorUpper));
40
- // const lowerCheck = std.all(std.ge(color.xyz, maskedColorLower));
41
- // if (upperCheck && lowerCheck) {
42
- // return color;
43
- // }
44
-
45
- //glareIntensity
46
- const dst = std.exp(-std.distance(center, centeredCoords));
47
- const distToCenter = std.smoothstep(0.0, 1 / glareIntensity, dst);
48
-
49
- //glowPower
50
- let glow = d.vec3f(distToCenter);
51
- glow = std.mul(glow, glowPower * color.w);
52
-
53
- //hueBlend
54
- const hueBlend = d.f32(hueBlendPower) * dst / 10.0;
55
-
56
- //lightIntensity
57
- glow = std.add(glow, lightIntensity / 10.0);
58
- let shiftedRGB = glareColorShift(color.xyz, dst / (lightIntensity * 2));
59
-
60
- //hueShiftAngleMin/Max
61
- const hueShiftAngle = std.smoothstep(hueShiftAngleMin, hueShiftAngleMax, distToCenter);
62
- const shiftedHue = hueShift(shiftedRGB, hueShiftAngle);
63
- shiftedRGB = overlayChannels(shiftedRGB, shiftedHue);
64
- color = d.vec4f(std.mix(color.xyz, shiftedRGB, hueBlend), color.w);
65
- const baseColor = color;
66
- const blendColor = glow;
67
- const combined = overlayChannels(baseColor.xyz, blendColor);
68
- color = d.vec4f(std.mix(color.xyz, combined, glow), color.w);
69
- return color;
70
- }, {
71
- v: 1,
72
- name: void 0,
73
- ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"texcoord",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"uv",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"centeredCoords",[6,[7,"std","sub"],[[6,[7,"std","mul"],["uv",[5,"2"]]],[5,"1"]]]],[13,"rot",[7,[7,"rotationBindGroupLayout","$"],"vec"]],[13,"center",[6,[7,"std","add"],[[6,[7,"d","vec2f"],[[5,"0"]]],[6,[7,"d","vec2f"],[[7,"rot","x"],[7,"rot","y"]]]]]],[13,"glareOptions",[7,[7,"glareBindGroupLayout","$"],"glareOptions"]],[13,"glareIntensity",[7,"glareOptions","glareIntensity"]],[13,"glowPower",[7,"glareOptions","glowPower"]],[13,"lightIntensity",[7,"glareOptions","lightIntensity"]],[13,"glareColor",[7,"glareOptions","glareColor"]],[13,"hueBlendPower",[7,"glareColor","hueBlendPower"]],[13,"hueShiftAngleMax",[7,"glareColor","hueShiftAngleMax"]],[13,"hueShiftAngleMin",[7,"glareColor","hueShiftAngleMin"]],[12,"color",[6,[7,"std","textureSample"],[[7,[7,"textureBindGroupLayout","$"],"texture"],[7,[7,"textureBindGroupLayout","$"],"sampler"],"texcoord"]]],[13,"dst",[6,[7,"std","exp"],[[4,"-",[6,[7,"std","distance"],["center","centeredCoords"]]]]]],[13,"distToCenter",[6,[7,"std","smoothstep"],[[5,"0"],[1,[5,"1"],"/","glareIntensity"],"dst"]]],[12,"glow",[6,[7,"d","vec3f"],["distToCenter"]]],[2,"glow","=",[6,[7,"std","mul"],["glow",[1,"glowPower","*",[7,"color","w"]]]]],[13,"hueBlend",[1,[1,[6,[7,"d","f32"],["hueBlendPower"]],"*","dst"],"/",[5,"10"]]],[2,"glow","=",[6,[7,"std","add"],["glow",[1,"lightIntensity","/",[5,"10"]]]]],[12,"shiftedRGB",[6,"glareColorShift",[[7,"color","xyz"],[1,"dst","/",[1,"lightIntensity","*",[5,"2"]]]]]],[13,"hueShiftAngle",[6,[7,"std","smoothstep"],["hueShiftAngleMin","hueShiftAngleMax","distToCenter"]]],[13,"shiftedHue",[6,"hueShift",["shiftedRGB","hueShiftAngle"]]],[2,"shiftedRGB","=",[6,"overlayChannels",["shiftedRGB","shiftedHue"]]],[2,"color","=",[6,[7,"d","vec4f"],[[6,[7,"std","mix"],[[7,"color","xyz"],"shiftedRGB","hueBlend"]],[7,"color","w"]]]],[13,"baseColor","color"],[13,"blendColor","glow"],[13,"combined",[6,"overlayChannels",[[7,"baseColor","xyz"],"blendColor"]]],[2,"color","=",[6,[7,"d","vec4f"],[[6,[7,"std","mix"],[[7,"color","xyz"],"combined","glow"]],[7,"color","w"]]]],[10,"color"]]],"externalNames":["d","std","rotationBindGroupLayout","glareBindGroupLayout","textureBindGroupLayout","glareColorShift","hueShift","overlayChannels"]},
74
- get externals() {
75
- return {
76
- d,
77
- std,
78
- rotationBindGroupLayout,
79
- glareBindGroupLayout,
80
- textureBindGroupLayout,
81
- glareColorShift,
82
- hueShift,
83
- overlayChannels
84
- };
85
- }
86
- }) && $.f)({})), "glareFragment");
87
- export const newGlareFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['~unstable'].fragmentFn({
88
- in: {
89
- uv: d.vec2f
90
- },
91
- out: d.vec4f
92
- })(($ => (globalThis.__TYPEGPU_META__ ??= new WeakMap()).set($.f = input => {
93
- const texcoord = d.vec2f(input.uv.x, 1.0 - input.uv.y);
94
14
  const uv = d.vec2f(input.uv.x, 1.0 - input.uv.y);
95
15
  const centeredCoords = std.sub(std.mul(uv, 2.0), 1.0);
96
- const rot = rotationBindGroupLayout.$.vec;
16
+ const rot = sharedBindGroupLayout.$.rot;
97
17
  const center = std.add(d.vec2f(0.0), d.vec2f(rot.x, rot.y)); // do not change
98
18
 
99
19
  const opts = glareBindGroupLayout.$.glareOptions;
@@ -106,7 +26,7 @@ export const newGlareFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tg
106
26
  const hueShiftAngleMin = glareColor.hueShiftAngleMin; // degrees
107
27
  const hueShiftAngleMax = glareColor.hueShiftAngleMax; // degrees
108
28
 
109
- let color = std.textureSample(textureBindGroupLayout.$.texture, textureBindGroupLayout.$.sampler, texcoord);
29
+ let color = getPixelColorFromVector(uv);
110
30
  const dist = std.distance(center, centeredCoords);
111
31
  const radial = std.exp(-dist); // (0,1], steeper near center
112
32
  const radialScaled = std.mul(radial, std.add(1.0, std.max(0.0, glareIntensity)));
@@ -130,18 +50,18 @@ export const newGlareFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tg
130
50
  }, {
131
51
  v: 1,
132
52
  name: void 0,
133
- ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"texcoord",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"uv",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"centeredCoords",[6,[7,"std","sub"],[[6,[7,"std","mul"],["uv",[5,"2"]]],[5,"1"]]]],[13,"rot",[7,[7,"rotationBindGroupLayout","$"],"vec"]],[13,"center",[6,[7,"std","add"],[[6,[7,"d","vec2f"],[[5,"0"]]],[6,[7,"d","vec2f"],[[7,"rot","x"],[7,"rot","y"]]]]]],[13,"opts",[7,[7,"glareBindGroupLayout","$"],"glareOptions"]],[13,"glareIntensity",[7,"opts","glareIntensity"]],[13,"glowPower",[7,"opts","glowPower"]],[13,"lightIntensity",[1,[7,"opts","lightIntensity"],"/",[5,"1.3"]]],[13,"glareColor",[7,"opts","glareColor"]],[13,"hueBlendPower",[7,"glareColor","hueBlendPower"]],[13,"hueShiftAngleMin",[7,"glareColor","hueShiftAngleMin"]],[13,"hueShiftAngleMax",[7,"glareColor","hueShiftAngleMax"]],[12,"color",[6,[7,"std","textureSample"],[[7,[7,"textureBindGroupLayout","$"],"texture"],[7,[7,"textureBindGroupLayout","$"],"sampler"],"texcoord"]]],[13,"dist",[6,[7,"std","distance"],["center","centeredCoords"]]],[13,"radial",[6,[7,"std","exp"],[[4,"-","dist"]]]],[13,"radialScaled",[6,[7,"std","mul"],["radial",[6,[7,"std","add"],[[5,"1"],[6,[7,"std","max"],[[5,"0"],"glareIntensity"]]]]]]],[13,"influenceRaw",[6,[7,"std","smoothstep"],[[5,"0"],[5,"1"],"radialScaled"]]],[13,"curveExp",[6,[7,"std","clamp"],["glowPower",[5,"0.05"],[5,"64"]]]],[13,"glowMask",[6,[7,"std","pow"],["influenceRaw",[6,[7,"std","div"],[[5,"1"],"curveExp"]]]]],[13,"maskedGlow",[6,[7,"std","mul"],["glowMask",[7,"color","w"]]]],[13,"boostedRGB",[6,"glareColorShift",[[7,"color","xyz"],"maskedGlow"]]],[13,"hueT",[6,[7,"std","clamp"],["maskedGlow",[5,"0"],[5,"1"]]]],[13,"hueAngle",[6,[7,"std","mix"],["hueShiftAngleMin","hueShiftAngleMax","hueT"]]],[13,"hueShifted",[6,"hueShift",["boostedRGB","hueAngle"]]],[13,"hueMixWeight",[6,[7,"std","clamp"],[[6,[7,"std","mul"],[[1,"hueBlendPower","/",[5,"5"]],"maskedGlow"]],[5,"0"],[5,"1"]]]],[13,"chromaMixed",[6,[7,"std","mix"],[[7,"color","xyz"],"hueShifted","hueMixWeight"]]],[13,"glareStrength",[6,[7,"std","clamp"],["lightIntensity",[5,"0"],[5,"100"]]]],[13,"glareLayer",[6,[7,"std","mul"],[[6,[7,"d","vec3f"],["maskedGlow"]],"glareStrength"]]],[13,"overlaidRGB",[6,"overlayChannels",["chromaMixed","glareLayer"]]],[13,"finalRGB",[6,[7,"std","mix"],["chromaMixed","overlaidRGB",[6,[7,"d","vec3f"],["maskedGlow"]]]]],[13,"outRGB",[6,[7,"std","clamp"],["finalRGB",[6,[7,"d","vec3f"],[[5,"0"]]],[6,[7,"d","vec3f"],[[5,"1"]]]]]],[10,[6,[7,"d","vec4f"],["outRGB",[7,"color","w"]]]]]],"externalNames":["d","std","rotationBindGroupLayout","glareBindGroupLayout","textureBindGroupLayout","glareColorShift","hueShift","overlayChannels"]},
53
+ ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"uv",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"centeredCoords",[6,[7,"std","sub"],[[6,[7,"std","mul"],["uv",[5,"2"]]],[5,"1"]]]],[13,"rot",[7,[7,"sharedBindGroupLayout","$"],"rot"]],[13,"center",[6,[7,"std","add"],[[6,[7,"d","vec2f"],[[5,"0"]]],[6,[7,"d","vec2f"],[[7,"rot","x"],[7,"rot","y"]]]]]],[13,"opts",[7,[7,"glareBindGroupLayout","$"],"glareOptions"]],[13,"glareIntensity",[7,"opts","glareIntensity"]],[13,"glowPower",[7,"opts","glowPower"]],[13,"lightIntensity",[1,[7,"opts","lightIntensity"],"/",[5,"1.3"]]],[13,"glareColor",[7,"opts","glareColor"]],[13,"hueBlendPower",[7,"glareColor","hueBlendPower"]],[13,"hueShiftAngleMin",[7,"glareColor","hueShiftAngleMin"]],[13,"hueShiftAngleMax",[7,"glareColor","hueShiftAngleMax"]],[12,"color",[6,"getPixelColorFromVector",["uv"]]],[13,"dist",[6,[7,"std","distance"],["center","centeredCoords"]]],[13,"radial",[6,[7,"std","exp"],[[4,"-","dist"]]]],[13,"radialScaled",[6,[7,"std","mul"],["radial",[6,[7,"std","add"],[[5,"1"],[6,[7,"std","max"],[[5,"0"],"glareIntensity"]]]]]]],[13,"influenceRaw",[6,[7,"std","smoothstep"],[[5,"0"],[5,"1"],"radialScaled"]]],[13,"curveExp",[6,[7,"std","clamp"],["glowPower",[5,"0.05"],[5,"64"]]]],[13,"glowMask",[6,[7,"std","pow"],["influenceRaw",[6,[7,"std","div"],[[5,"1"],"curveExp"]]]]],[13,"maskedGlow",[6,[7,"std","mul"],["glowMask",[7,"color","w"]]]],[13,"boostedRGB",[6,"glareColorShift",[[7,"color","xyz"],"maskedGlow"]]],[13,"hueT",[6,[7,"std","clamp"],["maskedGlow",[5,"0"],[5,"1"]]]],[13,"hueAngle",[6,[7,"std","mix"],["hueShiftAngleMin","hueShiftAngleMax","hueT"]]],[13,"hueShifted",[6,"hueShift",["boostedRGB","hueAngle"]]],[13,"hueMixWeight",[6,[7,"std","clamp"],[[6,[7,"std","mul"],[[1,"hueBlendPower","/",[5,"5"]],"maskedGlow"]],[5,"0"],[5,"1"]]]],[13,"chromaMixed",[6,[7,"std","mix"],[[7,"color","xyz"],"hueShifted","hueMixWeight"]]],[13,"glareStrength",[6,[7,"std","clamp"],["lightIntensity",[5,"0"],[5,"100"]]]],[13,"glareLayer",[6,[7,"std","mul"],[[6,[7,"d","vec3f"],["maskedGlow"]],"glareStrength"]]],[13,"overlaidRGB",[6,"overlayChannels",["chromaMixed","glareLayer"]]],[13,"finalRGB",[6,[7,"std","mix"],["chromaMixed","overlaidRGB",[6,[7,"d","vec3f"],["maskedGlow"]]]]],[13,"outRGB",[6,[7,"std","clamp"],["finalRGB",[6,[7,"d","vec3f"],[[5,"0"]]],[6,[7,"d","vec3f"],[[5,"1"]]]]]],[10,[6,[7,"d","vec4f"],["outRGB",[7,"color","w"]]]]]],"externalNames":["d","std","sharedBindGroupLayout","glareBindGroupLayout","getPixelColorFromVector","glareColorShift","hueShift","overlayChannels"]},
134
54
  get externals() {
135
55
  return {
136
56
  d,
137
57
  std,
138
- rotationBindGroupLayout,
58
+ sharedBindGroupLayout,
139
59
  glareBindGroupLayout,
140
- textureBindGroupLayout,
60
+ getPixelColorFromVector,
141
61
  glareColorShift,
142
62
  hueShift,
143
63
  overlayChannels
144
64
  };
145
65
  }
146
- }) && $.f)({})), "newGlareFragment");
66
+ }) && $.f)({})), "glareFragment");
147
67
  //# sourceMappingURL=glareFragment.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tgpu","d","std","rotationBindGroupLayout","textureBindGroupLayout","glareBindGroupLayout","glareColorShift","hueShift","overlayChannels","glareFragment","globalThis","__TYPEGPU_AUTONAME__","a","fragmentFn","in","uv","vec2f","out","vec4f","$","__TYPEGPU_META__","WeakMap","set","f","input","texcoord","x","y","centeredCoords","sub","mul","rot","vec","center","add","glareOptions","glareIntensity","glowPower","lightIntensity","glareColor","hueBlendPower","hueShiftAngleMax","hueShiftAngleMin","color","textureSample","texture","sampler","dst","exp","distance","distToCenter","smoothstep","glow","vec3f","w","hueBlend","f32","shiftedRGB","xyz","hueShiftAngle","shiftedHue","mix","baseColor","blendColor","combined","v","name","ast","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"texcoord\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"uv\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"centeredCoords\",[6,[7,\"std\",\"sub\"],[[6,[7,\"std\",\"mul\"],[\"uv\",[5,\"2\"]]],[5,\"1\"]]]],[13,\"rot\",[7,[7,\"rotationBindGroupLayout\",\"$\"],\"vec\"]],[13,\"center\",[6,[7,\"std\",\"add\"],[[6,[7,\"d\",\"vec2f\"],[[5,\"0\"]]],[6,[7,\"d\",\"vec2f\"],[[7,\"rot\",\"x\"],[7,\"rot\",\"y\"]]]]]],[13,\"glareOptions\",[7,[7,\"glareBindGroupLayout\",\"$\"],\"glareOptions\"]],[13,\"glareIntensity\",[7,\"glareOptions\",\"glareIntensity\"]],[13,\"glowPower\",[7,\"glareOptions\",\"glowPower\"]],[13,\"lightIntensity\",[7,\"glareOptions\",\"lightIntensity\"]],[13,\"glareColor\",[7,\"glareOptions\",\"glareColor\"]],[13,\"hueBlendPower\",[7,\"glareColor\",\"hueBlendPower\"]],[13,\"hueShiftAngleMax\",[7,\"glareColor\",\"hueShiftAngleMax\"]],[13,\"hueShiftAngleMin\",[7,\"glareColor\",\"hueShiftAngleMin\"]],[12,\"color\",[6,[7,\"std\",\"textureSample\"],[[7,[7,\"textureBindGroupLayout\",\"$\"],\"texture\"],[7,[7,\"textureBindGroupLayout\",\"$\"],\"sampler\"],\"texcoord\"]]],[13,\"dst\",[6,[7,\"std\",\"exp\"],[[4,\"-\",[6,[7,\"std\",\"distance\"],[\"center\",\"centeredCoords\"]]]]]],[13,\"distToCenter\",[6,[7,\"std\",\"smoothstep\"],[[5,\"0\"],[1,[5,\"1\"],\"/\",\"glareIntensity\"],\"dst\"]]],[12,\"glow\",[6,[7,\"d\",\"vec3f\"],[\"distToCenter\"]]],[2,\"glow\",\"=\",[6,[7,\"std\",\"mul\"],[\"glow\",[1,\"glowPower\",\"*\",[7,\"color\",\"w\"]]]]],[13,\"hueBlend\",[1,[1,[6,[7,\"d\",\"f32\"],[\"hueBlendPower\"]],\"*\",\"dst\"],\"/\",[5,\"10\"]]],[2,\"glow\",\"=\",[6,[7,\"std\",\"add\"],[\"glow\",[1,\"lightIntensity\",\"/\",[5,\"10\"]]]]],[12,\"shiftedRGB\",[6,\"glareColorShift\",[[7,\"color\",\"xyz\"],[1,\"dst\",\"/\",[1,\"lightIntensity\",\"*\",[5,\"2\"]]]]]],[13,\"hueShiftAngle\",[6,[7,\"std\",\"smoothstep\"],[\"hueShiftAngleMin\",\"hueShiftAngleMax\",\"distToCenter\"]]],[13,\"shiftedHue\",[6,\"hueShift\",[\"shiftedRGB\",\"hueShiftAngle\"]]],[2,\"shiftedRGB\",\"=\",[6,\"overlayChannels\",[\"shiftedRGB\",\"shiftedHue\"]]],[2,\"color\",\"=\",[6,[7,\"d\",\"vec4f\"],[[6,[7,\"std\",\"mix\"],[[7,\"color\",\"xyz\"],\"shiftedRGB\",\"hueBlend\"]],[7,\"color\",\"w\"]]]],[13,\"baseColor\",\"color\"],[13,\"blendColor\",\"glow\"],[13,\"combined\",[6,\"overlayChannels\",[[7,\"baseColor\",\"xyz\"],\"blendColor\"]]],[2,\"color\",\"=\",[6,[7,\"d\",\"vec4f\"],[[6,[7,\"std\",\"mix\"],[[7,\"color\",\"xyz\"],\"combined\",\"glow\"]],[7,\"color\",\"w\"]]]],[10,\"color\"]]],\"externalNames\":[\"d\",\"std\",\"rotationBindGroupLayout\",\"glareBindGroupLayout\",\"textureBindGroupLayout\",\"glareColorShift\",\"hueShift\",\"overlayChannels\"]}","externals","newGlareFragment","opts","dist","radial","radialScaled","max","influenceRaw","curveExp","clamp","glowMask","pow","div","maskedGlow","boostedRGB","hueT","hueAngle","hueShifted","hueMixWeight","chromaMixed","glareStrength","glareLayer","overlaidRGB","finalRGB","outRGB","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"texcoord\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"uv\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"centeredCoords\",[6,[7,\"std\",\"sub\"],[[6,[7,\"std\",\"mul\"],[\"uv\",[5,\"2\"]]],[5,\"1\"]]]],[13,\"rot\",[7,[7,\"rotationBindGroupLayout\",\"$\"],\"vec\"]],[13,\"center\",[6,[7,\"std\",\"add\"],[[6,[7,\"d\",\"vec2f\"],[[5,\"0\"]]],[6,[7,\"d\",\"vec2f\"],[[7,\"rot\",\"x\"],[7,\"rot\",\"y\"]]]]]],[13,\"opts\",[7,[7,\"glareBindGroupLayout\",\"$\"],\"glareOptions\"]],[13,\"glareIntensity\",[7,\"opts\",\"glareIntensity\"]],[13,\"glowPower\",[7,\"opts\",\"glowPower\"]],[13,\"lightIntensity\",[1,[7,\"opts\",\"lightIntensity\"],\"/\",[5,\"1.3\"]]],[13,\"glareColor\",[7,\"opts\",\"glareColor\"]],[13,\"hueBlendPower\",[7,\"glareColor\",\"hueBlendPower\"]],[13,\"hueShiftAngleMin\",[7,\"glareColor\",\"hueShiftAngleMin\"]],[13,\"hueShiftAngleMax\",[7,\"glareColor\",\"hueShiftAngleMax\"]],[12,\"color\",[6,[7,\"std\",\"textureSample\"],[[7,[7,\"textureBindGroupLayout\",\"$\"],\"texture\"],[7,[7,\"textureBindGroupLayout\",\"$\"],\"sampler\"],\"texcoord\"]]],[13,\"dist\",[6,[7,\"std\",\"distance\"],[\"center\",\"centeredCoords\"]]],[13,\"radial\",[6,[7,\"std\",\"exp\"],[[4,\"-\",\"dist\"]]]],[13,\"radialScaled\",[6,[7,\"std\",\"mul\"],[\"radial\",[6,[7,\"std\",\"add\"],[[5,\"1\"],[6,[7,\"std\",\"max\"],[[5,\"0\"],\"glareIntensity\"]]]]]]],[13,\"influenceRaw\",[6,[7,\"std\",\"smoothstep\"],[[5,\"0\"],[5,\"1\"],\"radialScaled\"]]],[13,\"curveExp\",[6,[7,\"std\",\"clamp\"],[\"glowPower\",[5,\"0.05\"],[5,\"64\"]]]],[13,\"glowMask\",[6,[7,\"std\",\"pow\"],[\"influenceRaw\",[6,[7,\"std\",\"div\"],[[5,\"1\"],\"curveExp\"]]]]],[13,\"maskedGlow\",[6,[7,\"std\",\"mul\"],[\"glowMask\",[7,\"color\",\"w\"]]]],[13,\"boostedRGB\",[6,\"glareColorShift\",[[7,\"color\",\"xyz\"],\"maskedGlow\"]]],[13,\"hueT\",[6,[7,\"std\",\"clamp\"],[\"maskedGlow\",[5,\"0\"],[5,\"1\"]]]],[13,\"hueAngle\",[6,[7,\"std\",\"mix\"],[\"hueShiftAngleMin\",\"hueShiftAngleMax\",\"hueT\"]]],[13,\"hueShifted\",[6,\"hueShift\",[\"boostedRGB\",\"hueAngle\"]]],[13,\"hueMixWeight\",[6,[7,\"std\",\"clamp\"],[[6,[7,\"std\",\"mul\"],[[1,\"hueBlendPower\",\"/\",[5,\"5\"]],\"maskedGlow\"]],[5,\"0\"],[5,\"1\"]]]],[13,\"chromaMixed\",[6,[7,\"std\",\"mix\"],[[7,\"color\",\"xyz\"],\"hueShifted\",\"hueMixWeight\"]]],[13,\"glareStrength\",[6,[7,\"std\",\"clamp\"],[\"lightIntensity\",[5,\"0\"],[5,\"100\"]]]],[13,\"glareLayer\",[6,[7,\"std\",\"mul\"],[[6,[7,\"d\",\"vec3f\"],[\"maskedGlow\"]],\"glareStrength\"]]],[13,\"overlaidRGB\",[6,\"overlayChannels\",[\"chromaMixed\",\"glareLayer\"]]],[13,\"finalRGB\",[6,[7,\"std\",\"mix\"],[\"chromaMixed\",\"overlaidRGB\",[6,[7,\"d\",\"vec3f\"],[\"maskedGlow\"]]]]],[13,\"outRGB\",[6,[7,\"std\",\"clamp\"],[\"finalRGB\",[6,[7,\"d\",\"vec3f\"],[[5,\"0\"]]],[6,[7,\"d\",\"vec3f\"],[[5,\"1\"]]]]]],[10,[6,[7,\"d\",\"vec4f\"],[\"outRGB\",[7,\"color\",\"w\"]]]]]],\"externalNames\":[\"d\",\"std\",\"rotationBindGroupLayout\",\"glareBindGroupLayout\",\"textureBindGroupLayout\",\"glareColorShift\",\"hueShift\",\"overlayChannels\"]}"],"sourceRoot":"../../../../src","sources":["shaders/fragmentShaders/glareFragment.ts"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,SAAS;AAC1B,OAAO,KAAKC,CAAC,MAAM,cAAc;AACjC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAClC,SACEC,uBAAuB,EACvBC,sBAAsB,EACtBC;AACA;AAAA,OACK,wBAAqB;AAC5B,SAASC,eAAe,EAAEC,QAAQ,EAAEC,eAAe,QAAQ,iBAAc;AAEzE,OAAO,MAAMC,aAAa,IAAAC,UAAA,CAAAC,oBAAA,KAAAC,CAAA,IAAAA,CAAA,GAAGZ,IAAI,CAA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W,GAAGtF,GAAG,CAAC2D,GAAG,CAAClB,KAAK,CAACe,GAAG,EAAE4B,UAAU,EAAEC,YAAY,CAAC;EAEhE,MAAME,aAAa,GAAGvF,GAAG,CAAC4E,KAAK,CAACxC,cAAc,EAAE,GAAG,EAAE,KAAK,CAAC;EAC3D,MAAMoD,UAAU,GAAGxF,GAAG,CAAC4B,GAAG,CAAC7B,CAAC,CAACoD,KAAK,CAAC6B,UAAU,CAAC,EAAEO,aAAa,CAAC;EAE9D,MAAME,WAAW,GAAGnF,eAAe,CAACgF,WAAW,EAAEE,UAAU,CAAC;EAC5D,MAAME,QAAQ,GAAG1F,GAAG,CAAC2D,GAAG,CAAC2B,WAAW,EAAEG,WAAW,EAAE1F,CAAC,CAACoD,KAAK,CAAC6B,UAAU,CAAC,CAAC;EAEvE,MAAMW,MAAM,GAAG3F,GAAG,CAAC4E,KAAK,CAACc,QAAQ,EAAE3F,CAAC,CAACoD,KAAK,CAAC,GAAG,CAAC,EAAEpD,CAAC,CAACoD,KAAK,CAAC,GAAG,CAAC,CAAC;EAE9D,OAAOpD,CAAC,CAACiB,KAAK,CAAC2E,MAAM,EAAElD,KAAK,CAACW,CAAC,CAAC;AACjC,CAAC;EAAAW,CAAA;EAAAC,IAAA;EAAAC,GAAA,EAAA2B,kvFAAA;EAAA,IAAAzB,UAAA;IAAA;MAAApE,CAAA;MAAAC,GAAA;MAAAC,uBAAA;MAAAE,oBAAA;MAAAD,sBAAA;MAAAE,eAAA;MAAAC,QAAA;MAAAC;IAAA;EAAA;AAAA,MAAAW,CAAA,CAAAI,CAAA,2BAAC","ignoreList":[]}
1
+ {"version":3,"names":["tgpu","d","std","sharedBindGroupLayout","glareBindGroupLayout","getPixelColorFromVector","glareColorShift","hueShift","overlayChannels","glareFragment","globalThis","__TYPEGPU_AUTONAME__","a","fragmentFn","in","uv","vec2f","out","vec4f","$","__TYPEGPU_META__","WeakMap","set","f","input","x","y","centeredCoords","sub","mul","rot","center","add","opts","glareOptions","glareIntensity","glowPower","lightIntensity","glareColor","hueBlendPower","hueShiftAngleMin","hueShiftAngleMax","color","dist","distance","radial","exp","radialScaled","max","influenceRaw","smoothstep","curveExp","clamp","glowMask","pow","div","maskedGlow","w","boostedRGB","xyz","hueT","hueAngle","mix","hueShifted","hueMixWeight","chromaMixed","glareStrength","glareLayer","vec3f","overlaidRGB","finalRGB","outRGB","v","name","ast","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"uv\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"centeredCoords\",[6,[7,\"std\",\"sub\"],[[6,[7,\"std\",\"mul\"],[\"uv\",[5,\"2\"]]],[5,\"1\"]]]],[13,\"rot\",[7,[7,\"sharedBindGroupLayout\",\"$\"],\"rot\"]],[13,\"center\",[6,[7,\"std\",\"add\"],[[6,[7,\"d\",\"vec2f\"],[[5,\"0\"]]],[6,[7,\"d\",\"vec2f\"],[[7,\"rot\",\"x\"],[7,\"rot\",\"y\"]]]]]],[13,\"opts\",[7,[7,\"glareBindGroupLayout\",\"$\"],\"glareOptions\"]],[13,\"glareIntensity\",[7,\"opts\",\"glareIntensity\"]],[13,\"glowPower\",[7,\"opts\",\"glowPower\"]],[13,\"lightIntensity\",[1,[7,\"opts\",\"lightIntensity\"],\"/\",[5,\"1.3\"]]],[13,\"glareColor\",[7,\"opts\",\"glareColor\"]],[13,\"hueBlendPower\",[7,\"glareColor\",\"hueBlendPower\"]],[13,\"hueShiftAngleMin\",[7,\"glareColor\",\"hueShiftAngleMin\"]],[13,\"hueShiftAngleMax\",[7,\"glareColor\",\"hueShiftAngleMax\"]],[12,\"color\",[6,\"getPixelColorFromVector\",[\"uv\"]]],[13,\"dist\",[6,[7,\"std\",\"distance\"],[\"center\",\"centeredCoords\"]]],[13,\"radial\",[6,[7,\"std\",\"exp\"],[[4,\"-\",\"dist\"]]]],[13,\"radialScaled\",[6,[7,\"std\",\"mul\"],[\"radial\",[6,[7,\"std\",\"add\"],[[5,\"1\"],[6,[7,\"std\",\"max\"],[[5,\"0\"],\"glareIntensity\"]]]]]]],[13,\"influenceRaw\",[6,[7,\"std\",\"smoothstep\"],[[5,\"0\"],[5,\"1\"],\"radialScaled\"]]],[13,\"curveExp\",[6,[7,\"std\",\"clamp\"],[\"glowPower\",[5,\"0.05\"],[5,\"64\"]]]],[13,\"glowMask\",[6,[7,\"std\",\"pow\"],[\"influenceRaw\",[6,[7,\"std\",\"div\"],[[5,\"1\"],\"curveExp\"]]]]],[13,\"maskedGlow\",[6,[7,\"std\",\"mul\"],[\"glowMask\",[7,\"color\",\"w\"]]]],[13,\"boostedRGB\",[6,\"glareColorShift\",[[7,\"color\",\"xyz\"],\"maskedGlow\"]]],[13,\"hueT\",[6,[7,\"std\",\"clamp\"],[\"maskedGlow\",[5,\"0\"],[5,\"1\"]]]],[13,\"hueAngle\",[6,[7,\"std\",\"mix\"],[\"hueShiftAngleMin\",\"hueShiftAngleMax\",\"hueT\"]]],[13,\"hueShifted\",[6,\"hueShift\",[\"boostedRGB\",\"hueAngle\"]]],[13,\"hueMixWeight\",[6,[7,\"std\",\"clamp\"],[[6,[7,\"std\",\"mul\"],[[1,\"hueBlendPower\",\"/\",[5,\"5\"]],\"maskedGlow\"]],[5,\"0\"],[5,\"1\"]]]],[13,\"chromaMixed\",[6,[7,\"std\",\"mix\"],[[7,\"color\",\"xyz\"],\"hueShifted\",\"hueMixWeight\"]]],[13,\"glareStrength\",[6,[7,\"std\",\"clamp\"],[\"lightIntensity\",[5,\"0\"],[5,\"100\"]]]],[13,\"glareLayer\",[6,[7,\"std\",\"mul\"],[[6,[7,\"d\",\"vec3f\"],[\"maskedGlow\"]],\"glareStrength\"]]],[13,\"overlaidRGB\",[6,\"overlayChannels\",[\"chromaMixed\",\"glareLayer\"]]],[13,\"finalRGB\",[6,[7,\"std\",\"mix\"],[\"chromaMixed\",\"overlaidRGB\",[6,[7,\"d\",\"vec3f\"],[\"maskedGlow\"]]]]],[13,\"outRGB\",[6,[7,\"std\",\"clamp\"],[\"finalRGB\",[6,[7,\"d\",\"vec3f\"],[[5,\"0\"]]],[6,[7,\"d\",\"vec3f\"],[[5,\"1\"]]]]]],[10,[6,[7,\"d\",\"vec4f\"],[\"outRGB\",[7,\"color\",\"w\"]]]]]],\"externalNames\":[\"d\",\"std\",\"sharedBindGroupLayout\",\"glareBindGroupLayout\",\"getPixelColorFromVector\",\"glareColorShift\",\"hueShift\",\"overlayChannels\"]}","externals"],"sourceRoot":"../../../../src","sources":["shaders/fragmentShaders/glareFragment.ts"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,SAAS;AAC1B,OAAO,KAAKC,CAAC,MAAM,cAAc;AACjC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAClC,SACEC,qBAAqB,EACrBC,oBAAoB,QACf,wBAAqB;AAC5B,SACEC,uBAAuB,EACvBC,eAAe,EACfC,QAAQ,EACRC,eAAe,QACV,iBAAc;AAErB,OAAO,MAAMC,aAAa,IAAAC,UAAA,CAAAC,oBAAA,KAAAC,CAAA,IAAAA,CAAA,GAAGZ,IAAI,CAAC,WAAW,CAAC,CAACa,UAAU,CAAC;EACxDC,EAAE,EAAE;IAAEC,EAAE,EAAEd,CAAC,CAACe;EAAM,CAAC;EACnBC,GAAG,EAAEhB,CAAC,CAACiB;AACT,CAAC,CAAC,EAAAC,CAAA,KAAAT,UAAA,CAAAU,gBAAA,SAAAC,OAAA,IAAAC,GAAA,CAAAH,CAAA,CAAAI,CAAA,GAAEC,KAAK,IAAK;EACZ,MAAMT,EAAE,GAAGd,CAAC,CAACe,KAAK,CAACQ,KAAK,CAACT,EAAE,CAACU,CAAC,EAAE,GAAG,GAAGD,KAAK,CAACT,EAAE,CAACW,CAAC,CAAC;EAChD,MAAMC,cAAc,GAAGzB,GAAG,CAAC0B,GAAG,CAAC1B,GAAG,CAAC2B,GAAG,CAACd,EAAE,EA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,UAAU,CAAC;EAC5D,MAAMG,QAAQ,GAAGpE,GAAG,CAAC4D,GAAG,CAACG,WAAW,EAAEI,WAAW,EAAEpE,CAAC,CAACmE,KAAK,CAACZ,UAAU,CAAC,CAAC;EAEvE,MAAMe,MAAM,GAAGrE,GAAG,CAACkD,KAAK,CAACkB,QAAQ,EAAErE,CAAC,CAACmE,KAAK,CAAC,GAAG,CAAC,EAAEnE,CAAC,CAACmE,KAAK,CAAC,GAAG,CAAC,CAAC;EAE9D,OAAOnE,CAAC,CAACiB,KAAK,CAACqD,MAAM,EAAE7B,KAAK,CAACe,CAAC,CAAC;AACjC,CAAC;EAAAe,CAAA;EAAAC,IAAA;EAAAC,GAAA,EAAAC,miFAAA;EAAA,IAAAC,UAAA;IAAA;MAAA3E,CAAA;MAAAC,GAAA;MAAAC,qBAAA;MAAAC,oBAAA;MAAAC,uBAAA;MAAAC,eAAA;MAAAC,QAAA;MAAAC;IAAA;EAAA;AAAA,MAAAW,CAAA,CAAAI,CAAA,wBAAC","ignoreList":[]}
@@ -3,19 +3,128 @@
3
3
  import tgpu from 'typegpu';
4
4
  import * as d from 'typegpu/data';
5
5
  import * as std from 'typegpu/std';
6
- import { rotationBindGroupLayout, textureBindGroupLayout } from "../bindGroupLayouts.js";
7
- import { hueShift } from "../tgpuUtils.js";
6
+ import { holoBindGroupLayout, sharedBindGroupLayout } from "../bindGroupLayouts.js";
7
+ import { getPixelColorFromVector, hsvToRGB, hueShift, overlayChannels, random } from "../tgpuUtils.js";
8
8
  import { waveCallbackSlot } from "../../enums/waveCallback.js";
9
+ export const holo = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu.fn([d.vec2f, d.f32, d.f32, d.f32], d.vec4f)(($ => (globalThis.__TYPEGPU_META__ ??= new WeakMap()).set($.f = (uv, directionDegreeModifier, shiftModifier, rotationShiftPowerModifier) => {
10
+ const rot = sharedBindGroupLayout.$.rot;
11
+ const textureColor = getPixelColorFromVector(uv);
12
+ const directionDegree = std.add(holoBindGroupLayout.$.holoOptions.directionDegree, directionDegreeModifier);
13
+ const shift = std.add(holoBindGroupLayout.$.holoOptions.shift, shiftModifier);
14
+ const rotationShiftPower = std.mul(holoBindGroupLayout.$.holoOptions.rotationShiftPower, rotationShiftPowerModifier);
15
+ const holoSize = holoBindGroupLayout.$.holoOptions.holoSize;
16
+ const holoMultiplier = holoBindGroupLayout.$.holoOptions.holoMultiplier;
17
+
18
+ //todo: need to redo logic of this, it should base on the calcualted diff size not add additional width
19
+ const holoEaseSize = holoBindGroupLayout.$.holoOptions.holoEaseSize;
20
+ const holoVisibility = holoBindGroupLayout.$.holoOptions.holoVisibility;
21
+ const holoSaturation = holoBindGroupLayout.$.holoOptions.holoSaturation;
22
+ const angelDegrees = std.radians(std.add(holoBindGroupLayout.$.holoOptions.directionDegree, directionDegreeModifier));
23
+ const yMultiplier = std.abs(std.cos(angelDegrees));
24
+ const xMultiplier = std.abs(std.sin(angelDegrees));
25
+ const range = std.add(xMultiplier, yMultiplier);
26
+ const intervalSize = std.div(range, holoMultiplier);
27
+ const x = std.add(std.mul(uv.x, xMultiplier), std.mul(uv.y, yMultiplier)) + shift + 1; //scale to [0,2)
28
+
29
+ const rotationShift = std.add(std.mul(rot.x, xMultiplier), std.mul(rot.y, yMultiplier));
30
+ const shiftMultiplied = std.mul(rotationShift, rotationShiftPower);
31
+ const offset = shiftMultiplied + shift; //why is shitft here?
32
+
33
+ const xOffseted = (x + offset) % intervalSize;
34
+ const diffractionSizeCalculated = std.mul(holoSize, intervalSize);
35
+ const diffractionNoiseSizeCalcualted = std.mul(diffractionSizeCalculated, holoEaseSize);
36
+ const diffractionStart = diffractionNoiseSizeCalcualted;
37
+ const diffractionEnd = std.add(diffractionSizeCalculated, diffractionStart);
38
+ const t = (xOffseted - diffractionStart) / (diffractionEnd - diffractionStart);
39
+ const holoRotated = std.select(0, Math.PI, directionDegree > 179);
40
+ const ft = (1 - std.cos(Math.PI * t - holoRotated)) / 2;
41
+ const hue = -0.06 + ft * 0.85;
42
+ const hueWithNoise = std.add(std.div(random(uv.xy) - 0.5, 180) * 40, hue); //check with normal distribution
43
+ const missingRedHue = hueWithNoise + 1.0; // maps negative values to red from the end of hue
44
+ const rainbowAccurateHue = std.select(missingRedHue, hueWithNoise, hueWithNoise > 0);
45
+ const boundaryCheck = std.any(d.vec2b(xOffseted < diffractionStart, xOffseted > diffractionEnd));
46
+ const xBoundary = std.select(diffractionStart - xOffseted, xOffseted - diffractionEnd, xOffseted > diffractionStart);
47
+ const xBoundaryScalled = std.div(xBoundary, diffractionNoiseSizeCalcualted);
48
+ const boundaryVisibilityScalled = std.pow(xBoundaryScalled, 2);
49
+ const calculatedVisibility = std.clamp(std.mix(holoVisibility, 1, boundaryVisibilityScalled * d.f32(boundaryCheck)), 0, 1);
50
+ const shiftedRGB = hsvToRGB(d.vec3f(rainbowAccurateHue, holoSaturation, 1));
51
+ const vsibilityAdjustsed = std.mul(calculatedVisibility, textureColor.w);
52
+ return d.vec4f(shiftedRGB, vsibilityAdjustsed);
53
+ }, {
54
+ v: 1,
55
+ name: void 0,
56
+ ast: {"params":[{"type":"i","name":"uv"},{"type":"i","name":"directionDegreeModifier"},{"type":"i","name":"shiftModifier"},{"type":"i","name":"rotationShiftPowerModifier"}],"body":[0,[[13,"rot",[7,[7,"sharedBindGroupLayout","$"],"rot"]],[13,"textureColor",[6,"getPixelColorFromVector",["uv"]]],[13,"directionDegree",[6,[7,"std","add"],[[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"directionDegree"],"directionDegreeModifier"]]],[13,"shift",[6,[7,"std","add"],[[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"shift"],"shiftModifier"]]],[13,"rotationShiftPower",[6,[7,"std","mul"],[[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"rotationShiftPower"],"rotationShiftPowerModifier"]]],[13,"holoSize",[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"holoSize"]],[13,"holoMultiplier",[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"holoMultiplier"]],[13,"holoEaseSize",[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"holoEaseSize"]],[13,"holoVisibility",[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"holoVisibility"]],[13,"holoSaturation",[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"holoSaturation"]],[13,"angelDegrees",[6,[7,"std","radians"],[[6,[7,"std","add"],[[7,[7,[7,"holoBindGroupLayout","$"],"holoOptions"],"directionDegree"],"directionDegreeModifier"]]]]],[13,"yMultiplier",[6,[7,"std","abs"],[[6,[7,"std","cos"],["angelDegrees"]]]]],[13,"xMultiplier",[6,[7,"std","abs"],[[6,[7,"std","sin"],["angelDegrees"]]]]],[13,"range",[6,[7,"std","add"],["xMultiplier","yMultiplier"]]],[13,"intervalSize",[6,[7,"std","div"],["range","holoMultiplier"]]],[13,"x",[1,[1,[6,[7,"std","add"],[[6,[7,"std","mul"],[[7,"uv","x"],"xMultiplier"]],[6,[7,"std","mul"],[[7,"uv","y"],"yMultiplier"]]]],"+","shift"],"+",[5,"1"]]],[13,"rotationShift",[6,[7,"std","add"],[[6,[7,"std","mul"],[[7,"rot","x"],"xMultiplier"]],[6,[7,"std","mul"],[[7,"rot","y"],"yMultiplier"]]]]],[13,"shiftMultiplied",[6,[7,"std","mul"],["rotationShift","rotationShiftPower"]]],[13,"offset",[1,"shiftMultiplied","+","shift"]],[13,"xOffseted",[1,[1,"x","+","offset"],"%","intervalSize"]],[13,"diffractionSizeCalculated",[6,[7,"std","mul"],["holoSize","intervalSize"]]],[13,"diffractionNoiseSizeCalcualted",[6,[7,"std","mul"],["diffractionSizeCalculated","holoEaseSize"]]],[13,"diffractionStart","diffractionNoiseSizeCalcualted"],[13,"diffractionEnd",[6,[7,"std","add"],["diffractionSizeCalculated","diffractionStart"]]],[13,"t",[1,[1,"xOffseted","-","diffractionStart"],"/",[1,"diffractionEnd","-","diffractionStart"]]],[13,"holoRotated",[6,[7,"std","select"],[[5,"0"],[7,"Math","PI"],[1,"directionDegree",">",[5,"179"]]]]],[13,"ft",[1,[1,[5,"1"],"-",[6,[7,"std","cos"],[[1,[1,[7,"Math","PI"],"*","t"],"-","holoRotated"]]]],"/",[5,"2"]]],[13,"hue",[1,[4,"-",[5,"0.06"]],"+",[1,"ft","*",[5,"0.85"]]]],[13,"hueWithNoise",[6,[7,"std","add"],[[1,[6,[7,"std","div"],[[1,[6,"random",[[7,"uv","xy"]]],"-",[5,"0.5"]],[5,"180"]]],"*",[5,"40"]],"hue"]]],[13,"missingRedHue",[1,"hueWithNoise","+",[5,"1"]]],[13,"rainbowAccurateHue",[6,[7,"std","select"],["missingRedHue","hueWithNoise",[1,"hueWithNoise",">",[5,"0"]]]]],[13,"boundaryCheck",[6,[7,"std","any"],[[6,[7,"d","vec2b"],[[1,"xOffseted","<","diffractionStart"],[1,"xOffseted",">","diffractionEnd"]]]]]],[13,"xBoundary",[6,[7,"std","select"],[[1,"diffractionStart","-","xOffseted"],[1,"xOffseted","-","diffractionEnd"],[1,"xOffseted",">","diffractionStart"]]]],[13,"xBoundaryScalled",[6,[7,"std","div"],["xBoundary","diffractionNoiseSizeCalcualted"]]],[13,"boundaryVisibilityScalled",[6,[7,"std","pow"],["xBoundaryScalled",[5,"2"]]]],[13,"calculatedVisibility",[6,[7,"std","clamp"],[[6,[7,"std","mix"],["holoVisibility",[5,"1"],[1,"boundaryVisibilityScalled","*",[6,[7,"d","f32"],["boundaryCheck"]]]]],[5,"0"],[5,"1"]]]],[13,"shiftedRGB",[6,"hsvToRGB",[[6,[7,"d","vec3f"],["rainbowAccurateHue","holoSaturation",[5,"1"]]]]]],[13,"vsibilityAdjustsed",[6,[7,"std","mul"],["calculatedVisibility",[7,"textureColor","w"]]]],[10,[6,[7,"d","vec4f"],["shiftedRGB","vsibilityAdjustsed"]]]]],"externalNames":["sharedBindGroupLayout","getPixelColorFromVector","std","holoBindGroupLayout","Math","random","d","hsvToRGB"]},
57
+ get externals() {
58
+ return {
59
+ sharedBindGroupLayout,
60
+ getPixelColorFromVector,
61
+ std,
62
+ holoBindGroupLayout,
63
+ Math,
64
+ random,
65
+ d,
66
+ hsvToRGB
67
+ };
68
+ }
69
+ }) && $.f)({})), "holo");
70
+ export const doubleHoloFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['~unstable'].fragmentFn({
71
+ in: {
72
+ uv: d.vec2f
73
+ },
74
+ out: d.vec4f
75
+ })(($ => (globalThis.__TYPEGPU_META__ ??= new WeakMap()).set($.f = input => {
76
+ const uv = d.vec2f(input.uv.x, 1.0 - input.uv.y);
77
+ const firstHolo = holo(uv, 0, 0, 1);
78
+ const secondHolo = holo(uv, 178, 0.59, -1);
79
+ const aa = std.add(firstHolo.w, secondHolo.w);
80
+ const vis = std.sub(2.0, aa);
81
+ const test = std.sub(1, vis);
82
+ const visibility = std.clamp(test, 0.9, 1);
83
+ const singleColor = std.select(firstHolo, secondHolo, secondHolo.w !== 1);
84
+ const addedColor = d.vec4f(overlayChannels(firstHolo.xyz, secondHolo.xyz), visibility);
85
+ const finalColor = std.select(singleColor, addedColor, std.all(d.vec2b(secondHolo.w !== 1, firstHolo.w !== 1)));
86
+ return finalColor;
87
+ }, {
88
+ v: 1,
89
+ name: void 0,
90
+ ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"uv",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"firstHolo",[6,"holo",["uv",[5,"0"],[5,"0"],[5,"1"]]]],[13,"secondHolo",[6,"holo",["uv",[5,"178"],[5,"0.59"],[4,"-",[5,"1"]]]]],[13,"aa",[6,[7,"std","add"],[[7,"firstHolo","w"],[7,"secondHolo","w"]]]],[13,"vis",[6,[7,"std","sub"],[[5,"2"],"aa"]]],[13,"test",[6,[7,"std","sub"],[[5,"1"],"vis"]]],[13,"visibility",[6,[7,"std","clamp"],["test",[5,"0.9"],[5,"1"]]]],[13,"singleColor",[6,[7,"std","select"],["firstHolo","secondHolo",[1,[7,"secondHolo","w"],"!=",[5,"1"]]]]],[13,"addedColor",[6,[7,"d","vec4f"],[[6,"overlayChannels",[[7,"firstHolo","xyz"],[7,"secondHolo","xyz"]]],"visibility"]]],[13,"finalColor",[6,[7,"std","select"],["singleColor","addedColor",[6,[7,"std","all"],[[6,[7,"d","vec2b"],[[1,[7,"secondHolo","w"],"!=",[5,"1"]],[1,[7,"firstHolo","w"],"!=",[5,"1"]]]]]]]]],[10,"finalColor"]]],"externalNames":["d","holo","std","overlayChannels"]},
91
+ get externals() {
92
+ return {
93
+ d,
94
+ holo,
95
+ std,
96
+ overlayChannels
97
+ };
98
+ }
99
+ }) && $.f)({})), "doubleHoloFragment");
9
100
  export const holoFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['~unstable'].fragmentFn({
10
101
  in: {
11
102
  uv: d.vec2f
12
103
  },
13
104
  out: d.vec4f
14
105
  })(($ => (globalThis.__TYPEGPU_META__ ??= new WeakMap()).set($.f = input => {
15
- const texcoord = d.vec2f(input.uv.x, 1.0 - input.uv.y);
16
- const uv = texcoord;
17
- const textureColor = std.textureSample(textureBindGroupLayout.$.texture, textureBindGroupLayout.$.sampler, texcoord);
18
- const rot = rotationBindGroupLayout.$.vec;
106
+ const uv = d.vec2f(input.uv.x, 1.0 - input.uv.y);
107
+ return holo(uv, 0, 0, 1);
108
+ }, {
109
+ v: 1,
110
+ name: void 0,
111
+ ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"uv",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[10,[6,"holo",["uv",[5,"0"],[5,"0"],[5,"1"]]]]]],"externalNames":["d","holo"]},
112
+ get externals() {
113
+ return {
114
+ d,
115
+ holo
116
+ };
117
+ }
118
+ }) && $.f)({})), "holoFragment");
119
+ export const oldHoloFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['~unstable'].fragmentFn({
120
+ in: {
121
+ uv: d.vec2f
122
+ },
123
+ out: d.vec4f
124
+ })(($ => (globalThis.__TYPEGPU_META__ ??= new WeakMap()).set($.f = input => {
125
+ const uv = d.vec2f(input.uv.x, 1.0 - input.uv.y);
126
+ const textureColor = getPixelColorFromVector(uv);
127
+ const rot = sharedBindGroupLayout.$.rot;
19
128
  const wave = waveCallbackSlot.$(rot.xy);
20
129
  const waveX = wave.x;
21
130
  const waveY = wave.y;
@@ -35,17 +144,17 @@ export const holoFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['
35
144
  }, {
36
145
  v: 1,
37
146
  name: void 0,
38
- ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"texcoord",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"uv","texcoord"],[13,"textureColor",[6,[7,"std","textureSample"],[[7,[7,"textureBindGroupLayout","$"],"texture"],[7,[7,"textureBindGroupLayout","$"],"sampler"],"texcoord"]]],[13,"rot",[7,[7,"rotationBindGroupLayout","$"],"vec"]],[13,"wave",[6,[7,"waveCallbackSlot","$"],[[7,"rot","xy"]]]],[13,"waveX",[7,"wave","x"]],[13,"waveY",[7,"wave","y"]],[13,"band",[6,[7,"std","add"],[[1,"waveX","*",[7,"uv","x"]],[1,[1,"waveY","*",[7,"uv","y"]],"*",[5,"2"]]]]],[13,"frequency",[6,[7,"d","f32"],[[5,"1"]]]],[13,"hueAngle",[1,[6,[7,"d","f32"],[[5,"180"]]],"*",[6,[7,"std","mul"],["band",[1,[1,"frequency","*",[7,"Math","PI"]],"*",[7,"rot","x"]]]]]],[13,"rainbowColor",[6,"hueShift",[[6,[7,"d","vec3f"],[[7,"uv","x"],[5,"0"],[5,"0"]]],"hueAngle"]]],[13,"finalColor",[6,[7,"std","mul"],["rainbowColor",[5,"1"]]]],[10,[6,[7,"d","vec4f"],["finalColor",[1,[5,"0.9"],"*",[7,"textureColor","w"]]]]]]],"externalNames":["d","std","textureBindGroupLayout","rotationBindGroupLayout","waveCallbackSlot","Math","hueShift"]},
147
+ ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"uv",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"textureColor",[6,"getPixelColorFromVector",["uv"]]],[13,"rot",[7,[7,"sharedBindGroupLayout","$"],"rot"]],[13,"wave",[6,[7,"waveCallbackSlot","$"],[[7,"rot","xy"]]]],[13,"waveX",[7,"wave","x"]],[13,"waveY",[7,"wave","y"]],[13,"band",[6,[7,"std","add"],[[1,"waveX","*",[7,"uv","x"]],[1,[1,"waveY","*",[7,"uv","y"]],"*",[5,"2"]]]]],[13,"frequency",[6,[7,"d","f32"],[[5,"1"]]]],[13,"hueAngle",[1,[6,[7,"d","f32"],[[5,"180"]]],"*",[6,[7,"std","mul"],["band",[1,[1,"frequency","*",[7,"Math","PI"]],"*",[7,"rot","x"]]]]]],[13,"rainbowColor",[6,"hueShift",[[6,[7,"d","vec3f"],[[7,"uv","x"],[5,"0"],[5,"0"]]],"hueAngle"]]],[13,"finalColor",[6,[7,"std","mul"],["rainbowColor",[5,"1"]]]],[10,[6,[7,"d","vec4f"],["finalColor",[1,[5,"0.9"],"*",[7,"textureColor","w"]]]]]]],"externalNames":["d","getPixelColorFromVector","sharedBindGroupLayout","waveCallbackSlot","std","Math","hueShift"]},
39
148
  get externals() {
40
149
  return {
41
150
  d,
42
- std,
43
- textureBindGroupLayout,
44
- rotationBindGroupLayout,
151
+ getPixelColorFromVector,
152
+ sharedBindGroupLayout,
45
153
  waveCallbackSlot,
154
+ std,
46
155
  Math,
47
156
  hueShift
48
157
  };
49
158
  }
50
- }) && $.f)({})), "holoFragment");
159
+ }) && $.f)({})), "oldHoloFragment");
51
160
  //# sourceMappingURL=holoFragment.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tgpu","d","std","rotationBindGroupLayout","textureBindGroupLayout","hueShift","waveCallbackSlot","holoFragment","globalThis","__TYPEGPU_AUTONAME__","a","fragmentFn","in","uv","vec2f","out","vec4f","$","__TYPEGPU_META__","WeakMap","set","f","input","texcoord","x","y","textureColor","textureSample","texture","sampler","rot","vec","wave","xy","waveX","waveY","band","add","frequency","f32","hueAngle","mul","Math","PI","rainbowColor","vec3f","finalColor","w","v","name","ast","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"texcoord\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"uv\",\"texcoord\"],[13,\"textureColor\",[6,[7,\"std\",\"textureSample\"],[[7,[7,\"textureBindGroupLayout\",\"$\"],\"texture\"],[7,[7,\"textureBindGroupLayout\",\"$\"],\"sampler\"],\"texcoord\"]]],[13,\"rot\",[7,[7,\"rotationBindGroupLayout\",\"$\"],\"vec\"]],[13,\"wave\",[6,[7,\"waveCallbackSlot\",\"$\"],[[7,\"rot\",\"xy\"]]]],[13,\"waveX\",[7,\"wave\",\"x\"]],[13,\"waveY\",[7,\"wave\",\"y\"]],[13,\"band\",[6,[7,\"std\",\"add\"],[[1,\"waveX\",\"*\",[7,\"uv\",\"x\"]],[1,[1,\"waveY\",\"*\",[7,\"uv\",\"y\"]],\"*\",[5,\"2\"]]]]],[13,\"frequency\",[6,[7,\"d\",\"f32\"],[[5,\"1\"]]]],[13,\"hueAngle\",[1,[6,[7,\"d\",\"f32\"],[[5,\"180\"]]],\"*\",[6,[7,\"std\",\"mul\"],[\"band\",[1,[1,\"frequency\",\"*\",[7,\"Math\",\"PI\"]],\"*\",[7,\"rot\",\"x\"]]]]]],[13,\"rainbowColor\",[6,\"hueShift\",[[6,[7,\"d\",\"vec3f\"],[[7,\"uv\",\"x\"],[5,\"0\"],[5,\"0\"]]],\"hueAngle\"]]],[13,\"finalColor\",[6,[7,\"std\",\"mul\"],[\"rainbowColor\",[5,\"1\"]]]],[10,[6,[7,\"d\",\"vec4f\"],[\"finalColor\",[1,[5,\"0.9\"],\"*\",[7,\"textureColor\",\"w\"]]]]]]],\"externalNames\":[\"d\",\"std\",\"textureBindGroupLayout\",\"rotationBindGroupLayout\",\"waveCallbackSlot\",\"Math\",\"hueShift\"]}","externals"],"sourceRoot":"../../../../src","sources":["shaders/fragmentShaders/holoFragment.ts"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,SAAS;AAC1B,OAAO,KAAKC,CAAC,MAAM,cAAc;AACjC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAClC,SACEC,uBAAuB,EACvBC,sBAAsB,QACjB,wBAAqB;AAC5B,SAASC,QAAQ,QAAQ,iBAAc;AACvC,SAASC,gBAAgB,QAAQ,6BAA0B;AAE3D,OAAO,MAAMC,YAAY,IAAAC,UAAA,CAAAC,oBAAA,KAAAC,CAAA,IAAAA,CAAA,GAAGV,IAAI,CAAC,WAAW,CAAC,CAACW,UAAU,CAAC;EACvDC,EAAE,EAAE;IAAEC,EAAE,EAAEZ,CAAC,CAACa;EAAM,CAAC;EACnBC,GAAG,EAAEd,CAAC,CAACe;AACT,CAAC,CAAC,EAAAC,CAAA,KAAAT,UAAA,CAAAU,gBAAA,SAAAC,OAAA,IAAAC,GAAA,CAAAH,CAAA,CAAAI,CAAA,GAAEC,KAAK,IAAK;EACZ,MAAMC,QAAQ,GAAGtB,CAAC,CAACa,KAAK,CAACQ,KAAK,CAACT,EAAE,CAACW,CAAC,EAAE,GAAG,GAAGF,KAAK,CAACT,EAAE,CAACY,CAAC,CAAC;EACtD,MAAMZ,EAAE,GAAGU,QAAQ;EACnB,MAAMG,YAAY,GAAGxB,GAAG,CAACyB,aAAa,CACpCvB,sBAAsB,CAACa,CAAC,CAACW,OAAO,EAChCxB,sBAAsB,CAACa,CAAC,CAACY,OAAO,EAChCN,QACF,CAAC;EACD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roupLayout","sharedBindGroupLayout","getPixelColorFromVector","hsvToRGB","hueShift","overlayChannels","random","waveCallbackSlot","holo","globalThis","__TYPEGPU_AUTONAME__","a","fn","vec2f","f32","vec4f","$","__TYPEGPU_META__","WeakMap","set","f","uv","directionDegreeModifier","shiftModifier","rotationShiftPowerModifier","rot","textureColor","directionDegree","add","holoOptions","shift","rotationShiftPower","mul","holoSize","holoMultiplier","holoEaseSize","holoVisibility","holoSaturation","angelDegrees","radians","yMultiplier","abs","cos","xMultiplier","sin","range","intervalSize","div","x","y","rotationShift","shiftMultiplied","offset","xOffseted","diffractionSizeCalculated","diffractionNoiseSizeCalcualted","diffractionStart","diffractionEnd","t","holoRotated","select","Math","PI","ft","hue","hueWithNoise","xy","missingRedHue","rainbowAccurateHue","boundaryCheck","any","vec2b","xBoundary","xBoundaryScalled","boundaryVisibilityScalled","pow","calculatedVisibility","clamp","mix","shiftedRGB","vec3f","vsibilityAdjustsed","w","v","name","ast","{\"params\":[{\"type\":\"i\",\"name\":\"uv\"},{\"type\":\"i\",\"name\":\"directionDegreeModifier\"},{\"type\":\"i\",\"name\":\"shiftModifier\"},{\"type\":\"i\",\"name\":\"rotationShiftPowerModifier\"}],\"body\":[0,[[13,\"rot\",[7,[7,\"sharedBindGroupLayout\",\"$\"],\"rot\"]],[13,\"textureColor\",[6,\"getPixelColorFromVector\",[\"uv\"]]],[13,\"directionDegree\",[6,[7,\"std\",\"add\"],[[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"directionDegree\"],\"directionDegreeModifier\"]]],[13,\"shift\",[6,[7,\"std\",\"add\"],[[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"shift\"],\"shiftModifier\"]]],[13,\"rotationShiftPower\",[6,[7,\"std\",\"mul\"],[[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"rotationShiftPower\"],\"rotationShiftPowerModifier\"]]],[13,\"holoSize\",[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"holoSize\"]],[13,\"holoMultiplier\",[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"holoMultiplier\"]],[13,\"holoEaseSize\",[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"holoEaseSize\"]],[13,\"holoVisibility\",[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"holoVisibility\"]],[13,\"holoSaturation\",[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"holoSaturation\"]],[13,\"angelDegrees\",[6,[7,\"std\",\"radians\"],[[6,[7,\"std\",\"add\"],[[7,[7,[7,\"holoBindGroupLayout\",\"$\"],\"holoOptions\"],\"directionDegree\"],\"directionDegreeModifier\"]]]]],[13,\"yMultiplier\",[6,[7,\"std\",\"abs\"],[[6,[7,\"std\",\"cos\"],[\"angelDegrees\"]]]]],[13,\"xMultiplier\",[6,[7,\"std\",\"abs\"],[[6,[7,\"std\",\"sin\"],[\"angelDegrees\"]]]]],[13,\"range\",[6,[7,\"std\",\"add\"],[\"xMultiplier\",\"yMultiplier\"]]],[13,\"intervalSize\",[6,[7,\"std\",\"div\"],[\"range\",\"holoMultiplier\"]]],[13,\"x\",[1,[1,[6,[7,\"std\",\"add\"],[[6,[7,\"std\",\"mul\"],[[7,\"uv\",\"x\"],\"xMultiplier\"]],[6,[7,\"std\",\"mul\"],[[7,\"uv\",\"y\"],\"yMultiplier\"]]]],\"+\",\"shift\"],\"+\",[5,\"1\"]]],[13,\"rotationShift\",[6,[7,\"std\",\"add\"],[[6,[7,\"std\",\"mul\"],[[7,\"rot\",\"x\"],\"xMultiplier\"]],[6,[7,\"std\",\"mul\"],[[7,\"rot\",\"y\"],\"yMultiplier\"]]]]],[13,\"shiftMultiplied\",[6,[7,\"std\",\"mul\"],[\"rotationShift\",\"rotationShiftPower\"]]],[13,\"offset\",[1,\"shiftMultiplied\",\"+\",\"shift\"]],[13,\"xOffseted\",[1,[1,\"x\",\"+\",\"offset\"],\"%\",\"intervalSize\"]],[13,\"diffractionSizeCalculated\",[6,[7,\"std\",\"mul\"],[\"holoSize\",\"intervalSize\"]]],[13,\"diffractionNoiseSizeCalcualted\",[6,[7,\"std\",\"mul\"],[\"diffractionSizeCalculated\",\"holoEaseSize\"]]],[13,\"diffractionStart\",\"diffractionNoiseSizeCalcualted\"],[13,\"diffractionEnd\",[6,[7,\"std\",\"add\"],[\"diffractionSizeCalculated\",\"diffractionStart\"]]],[13,\"t\",[1,[1,\"xOffseted\",\"-\",\"diffractionStart\"],\"/\",[1,\"diffractionEnd\",\"-\",\"diffractionStart\"]]],[13,\"holoRotated\",[6,[7,\"std\",\"select\"],[[5,\"0\"],[7,\"Math\",\"PI\"],[1,\"directionDegree\",\">\",[5,\"179\"]]]]],[13,\"ft\",[1,[1,[5,\"1\"],\"-\",[6,[7,\"std\",\"cos\"],[[1,[1,[7,\"Math\",\"PI\"],\"*\",\"t\"],\"-\",\"holoRotated\"]]]],\"/\",[5,\"2\"]]],[13,\"hue\",[1,[4,\"-\",[5,\"0.06\"]],\"+\",[1,\"ft\",\"*\",[5,\"0.85\"]]]],[13,\"hueWithNoise\",[6,[7,\"std\",\"add\"],[[1,[6,[7,\"std\",\"div\"],[[1,[6,\"random\",[[7,\"uv\",\"xy\"]]],\"-\",[5,\"0.5\"]],[5,\"180\"]]],\"*\",[5,\"40\"]],\"hue\"]]],[13,\"missingRedHue\",[1,\"hueWithNoise\",\"+\",[5,\"1\"]]],[13,\"rainbowAccurateHue\",[6,[7,\"std\",\"select\"],[\"missingRedHue\",\"hueWithNoise\",[1,\"hueWithNoise\",\">\",[5,\"0\"]]]]],[13,\"boundaryCheck\",[6,[7,\"std\",\"any\"],[[6,[7,\"d\",\"vec2b\"],[[1,\"xOffseted\",\"<\",\"diffractionStart\"],[1,\"xOffseted\",\">\",\"diffractionEnd\"]]]]]],[13,\"xBoundary\",[6,[7,\"std\",\"select\"],[[1,\"diffractionStart\",\"-\",\"xOffseted\"],[1,\"xOffseted\",\"-\",\"diffractionEnd\"],[1,\"xOffseted\",\">\",\"diffractionStart\"]]]],[13,\"xBoundaryScalled\",[6,[7,\"std\",\"div\"],[\"xBoundary\",\"diffractionNoiseSizeCalcualted\"]]],[13,\"boundaryVisibilityScalled\",[6,[7,\"std\",\"pow\"],[\"xBoundaryScalled\",[5,\"2\"]]]],[13,\"calculatedVisibility\",[6,[7,\"std\",\"clamp\"],[[6,[7,\"std\",\"mix\"],[\"holoVisibility\",[5,\"1\"],[1,\"boundaryVisibilityScalled\",\"*\",[6,[7,\"d\",\"f32\"],[\"boundaryCheck\"]]]]],[5,\"0\"],[5,\"1\"]]]],[13,\"shiftedRGB\",[6,\"hsvToRGB\",[[6,[7,\"d\",\"vec3f\"],[\"rainbowAccurateHue\",\"holoSaturation\",[5,\"1\"]]]]]],[13,\"vsibilityAdjustsed\",[6,[7,\"std\",\"mul\"],[\"calculatedVisibility\",[7,\"textureColor\",\"w\"]]]],[10,[6,[7,\"d\",\"vec4f\"],[\"shiftedRGB\",\"vsibilityAdjustsed\"]]]]],\"externalNames\":[\"sharedBindGroupLayout\",\"getPixelColorFromVector\",\"std\",\"holoBindGroupLayout\",\"Math\",\"random\",\"d\",\"hsvToRGB\"]}","externals","doubleHoloFragment","fragmentFn","in","out","input","firstHolo","secondHolo","aa","vis","sub","test","visibility","singleColor","addedColor","xyz","finalColor","all","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"uv\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"firstHolo\",[6,\"holo\",[\"uv\",[5,\"0\"],[5,\"0\"],[5,\"1\"]]]],[13,\"secondHolo\",[6,\"holo\",[\"uv\",[5,\"178\"],[5,\"0.59\"],[4,\"-\",[5,\"1\"]]]]],[13,\"aa\",[6,[7,\"std\",\"add\"],[[7,\"firstHolo\",\"w\"],[7,\"secondHolo\",\"w\"]]]],[13,\"vis\",[6,[7,\"std\",\"sub\"],[[5,\"2\"],\"aa\"]]],[13,\"test\",[6,[7,\"std\",\"sub\"],[[5,\"1\"],\"vis\"]]],[13,\"visibility\",[6,[7,\"std\",\"clamp\"],[\"test\",[5,\"0.9\"],[5,\"1\"]]]],[13,\"singleColor\",[6,[7,\"std\",\"select\"],[\"firstHolo\",\"secondHolo\",[1,[7,\"secondHolo\",\"w\"],\"!=\",[5,\"1\"]]]]],[13,\"addedColor\",[6,[7,\"d\",\"vec4f\"],[[6,\"overlayChannels\",[[7,\"firstHolo\",\"xyz\"],[7,\"secondHolo\",\"xyz\"]]],\"visibility\"]]],[13,\"finalColor\",[6,[7,\"std\",\"select\"],[\"singleColor\",\"addedColor\",[6,[7,\"std\",\"all\"],[[6,[7,\"d\",\"vec2b\"],[[1,[7,\"secondHolo\",\"w\"],\"!=\",[5,\"1\"]],[1,[7,\"firstHolo\",\"w\"],\"!=\",[5,\"1\"]]]]]]]]],[10,\"finalColor\"]]],\"externalNames\":[\"d\",\"holo\",\"std\",\"overlayChannels\"]}","holoFragment","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"uv\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[10,[6,\"holo\",[\"uv\",[5,\"0\"],[5,\"0\"],[5,\"1\"]]]]]],\"externalNames\":[\"d\",\"holo\"]}","oldHoloFragment","wave","waveX","waveY","band","frequency","hueAngle","rainbowColor","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"uv\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"textureColor\",[6,\"getPixelColorFromVector\",[\"uv\"]]],[13,\"rot\",[7,[7,\"sharedBindGroupLayout\",\"$\"],\"rot\"]],[13,\"wave\",[6,[7,\"waveCallbackSlot\",\"$\"],[[7,\"rot\",\"xy\"]]]],[13,\"waveX\",[7,\"wave\",\"x\"]],[13,\"waveY\",[7,\"wave\",\"y\"]],[13,\"band\",[6,[7,\"std\",\"add\"],[[1,\"waveX\",\"*\",[7,\"uv\",\"x\"]],[1,[1,\"waveY\",\"*\",[7,\"uv\",\"y\"]],\"*\",[5,\"2\"]]]]],[13,\"frequency\",[6,[7,\"d\",\"f32\"],[[5,\"1\"]]]],[13,\"hueAngle\",[1,[6,[7,\"d\",\"f32\"],[[5,\"180\"]]],\"*\",[6,[7,\"std\",\"mul\"],[\"band\",[1,[1,\"frequency\",\"*\",[7,\"Math\",\"PI\"]],\"*\",[7,\"rot\",\"x\"]]]]]],[13,\"rainbowColor\",[6,\"hueShift\",[[6,[7,\"d\",\"vec3f\"],[[7,\"uv\",\"x\"],[5,\"0\"],[5,\"0\"]]],\"hueAngle\"]]],[13,\"finalColor\",[6,[7,\"std\",\"mul\"],[\"rainbowColor\",[5,\"1\"]]]],[10,[6,[7,\"d\",\"vec4f\"],[\"finalColor\",[1,[5,\"0.9\"],\"*\",[7,\"textureColor\",\"w\"]]]]]]],\"externalNames\":[\"d\",\"getPixelColorFromVector\",\"sharedBindGroupLayout\",\"waveCallbackSlot\",\"std\",\"Math\",\"hueShift\"]}"],"sourceRoot":"../../../../src","sources":["shaders/fragmentShaders/holoFragment.ts"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,SAAS;AAC1B,OAAO,KAAKC,CAAC,MAAM,cAAc;AACjC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAClC,SACEC,mBAAmB,EACnBC,qBAAqB,QAChB,wBAAqB;AAC5B,SACEC,uBAAuB,EACvBC,QAAQ,EACRC,QAAQ,EACRC,eAAe,EACfC,MAAM,QACD,iBAAc;AACrB,SAASC,gBAAgB,QAAQ,6BAA0B;AAE3D,OAAO,MAAMC,I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AAE,GAAG,CAAC;;EAE7C;EACA;EACA;EACA,OAAOrH,CAAC,CAACiB,KAAK,CAACwF,UAAU,EAAE,GAAG,GAAG7E,YAAY,CAACwD,CAAC,CAAC;AAClD,CAAC;EAAAC,CAAA;EAAAC,IAAA;EAAAC,GAAA,EAAA+B,qgCAAA;EAAA,IAAA7B,UAAA;IAAA;MAAAzF,CAAA;MAAAI,uBAAA;MAAAD,qBAAA;MAAAM,gBAAA;MAAAR,GAAA;MAAA8D,IAAA;MAAAzD;IAAA;EAAA;AAAA,MAAAY,CAAA,CAAAI,CAAA,0BAAC","ignoreList":[]}
@@ -3,7 +3,8 @@
3
3
  import tgpu from 'typegpu';
4
4
  import * as d from 'typegpu/data';
5
5
  import * as std from 'typegpu/std';
6
- import { textureBindGroupLayout, maskTextureBindGroupLayout } from "../bindGroupLayouts.js";
6
+ import { maskTextureBindGroupLayout } from "../bindGroupLayouts.js";
7
+ import { getPixelColorFromVector } from "../tgpuUtils.js";
7
8
  const maskFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['~unstable'].fragmentFn({
8
9
  in: {
9
10
  uv: d.vec2f
@@ -13,18 +14,18 @@ const maskFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['~unstab
13
14
  const texcoord = d.vec2f(input.uv.x, 1.0 - input.uv.y);
14
15
  const mask = std.textureSample(maskTextureBindGroupLayout.$.texture, maskTextureBindGroupLayout.$.sampler, texcoord);
15
16
  const reversedMask = d.vec4f(std.sub(1.0, mask.xyz), mask.w);
16
- let color = std.textureSample(textureBindGroupLayout.$.texture, textureBindGroupLayout.$.sampler, texcoord);
17
+ let color = getPixelColorFromVector(texcoord);
17
18
  return d.vec4f(color.xyz, reversedMask.x);
18
19
  }, {
19
20
  v: 1,
20
21
  name: void 0,
21
- ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"texcoord",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"mask",[6,[7,"std","textureSample"],[[7,[7,"maskTextureBindGroupLayout","$"],"texture"],[7,[7,"maskTextureBindGroupLayout","$"],"sampler"],"texcoord"]]],[13,"reversedMask",[6,[7,"d","vec4f"],[[6,[7,"std","sub"],[[5,"1"],[7,"mask","xyz"]]],[7,"mask","w"]]]],[12,"color",[6,[7,"std","textureSample"],[[7,[7,"textureBindGroupLayout","$"],"texture"],[7,[7,"textureBindGroupLayout","$"],"sampler"],"texcoord"]]],[10,[6,[7,"d","vec4f"],[[7,"color","xyz"],[7,"reversedMask","x"]]]]]],"externalNames":["d","std","maskTextureBindGroupLayout","textureBindGroupLayout"]},
22
+ ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"texcoord",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"mask",[6,[7,"std","textureSample"],[[7,[7,"maskTextureBindGroupLayout","$"],"texture"],[7,[7,"maskTextureBindGroupLayout","$"],"sampler"],"texcoord"]]],[13,"reversedMask",[6,[7,"d","vec4f"],[[6,[7,"std","sub"],[[5,"1"],[7,"mask","xyz"]]],[7,"mask","w"]]]],[12,"color",[6,"getPixelColorFromVector",["texcoord"]]],[10,[6,[7,"d","vec4f"],[[7,"color","xyz"],[7,"reversedMask","x"]]]]]],"externalNames":["d","std","maskTextureBindGroupLayout","getPixelColorFromVector"]},
22
23
  get externals() {
23
24
  return {
24
25
  d,
25
26
  std,
26
27
  maskTextureBindGroupLayout,
27
- textureBindGroupLayout
28
+ getPixelColorFromVector
28
29
  };
29
30
  }
30
31
  }) && $.f)({})), "maskFragment");
@@ -1 +1 @@
1
- {"version":3,"names":["tgpu","d","std","textureBindGroupLayout","maskTextureBindGroupLayout","maskFragment","globalThis","__TYPEGPU_AUTONAME__","a","fragmentFn","in","uv","vec2f","out","vec4f","$","__TYPEGPU_META__","WeakMap","set","f","input","texcoord","x","y","mask","textureSample","texture","sampler","reversedMask","sub","xyz","w","color","v","name","ast","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"texcoord\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"mask\",[6,[7,\"std\",\"textureSample\"],[[7,[7,\"maskTextureBindGroupLayout\",\"$\"],\"texture\"],[7,[7,\"maskTextureBindGroupLayout\",\"$\"],\"sampler\"],\"texcoord\"]]],[13,\"reversedMask\",[6,[7,\"d\",\"vec4f\"],[[6,[7,\"std\",\"sub\"],[[5,\"1\"],[7,\"mask\",\"xyz\"]]],[7,\"mask\",\"w\"]]]],[12,\"color\",[6,[7,\"std\",\"textureSample\"],[[7,[7,\"textureBindGroupLayout\",\"$\"],\"texture\"],[7,[7,\"textureBindGroupLayout\",\"$\"],\"sampler\"],\"texcoord\"]]],[10,[6,[7,\"d\",\"vec4f\"],[[7,\"color\",\"xyz\"],[7,\"reversedMask\",\"x\"]]]]]],\"externalNames\":[\"d\",\"std\",\"maskTextureBindGroupLayout\",\"textureBindGroupLayout\"]}","externals"],"sourceRoot":"../../../../src","sources":["shaders/fragmentShaders/maskFragment.ts"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,SAAS;AAC1B,OAAO,KAAKC,CAAC,MAAM,cAAc;AACjC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAClC,SACEC,sBAAsB,EACtBC,0BAA0B,QACrB,wBAAqB;AAE5B,MAAMC,YAAY,IAAAC,UAAA,CAAAC,oBAAA,KAAAC,CAAA,IAAAA,CAAA,GAAGR,IAAI,CAAC,WAAW,CAAC,CAACS,UAAU,CAAC;EAChDC,EAAE,EAAE;IAAEC,EAAE,EAAEV,CAAC,CAACW;EAAM,CAAC;EACnBC,GAAG,EAAEZ,CAAC,CAACa;AACT,CAAC,CAAC,EAAAC,CAAA,KAAAT,UAAA,CAAAU,gBAAA,SAAAC,OAAA,IAAAC,GAAA,CAAAH,CAAA,CAAAI,CAAA,GAAEC,KAAK,IAAK;EACZ,MAAMC,QAAQ,GAAGpB,CAAC,CAACW,KAAK,CAACQ,KAAK,CAACT,EAAE,CAACW,CAAC,EAAE,GAAG,GAAGF,KAAK,CAACT,EAAE,CAACY,CAAC,CAAC;EAEtD,MAAMC,IAAI,GAAGtB,GAAG,CAACuB,aAAa,CAC5BrB,0BAA0B,CAACW,CAAC,CAACW,OAAO,EACpCtB,0BAA0B,CAACW,CAAC,CAACY,OAAO,EACpCN,QACF,CAAC;EACD,MAAMO,YAAY,GAAG3B,CAAC,CAACa,KAAK,CAACZ,GAAG,CAAC2B,GAAG,CAAC,GAAG,EAAEL,IAAI,CAACM,GAAG,CAAC,EAAEN,IAAI,CAACO,CAAC,CAAC;EAE5D,IAAIC,KAAK,GAAG9B,GAAG,CAACuB,aAAa,CAC3BtB,sBAAsB,CAACY,CAAC,CAACW,OAAO,EAChCvB,sBAAsB,CAACY,CAAC,CAACY,OAAO,EAChCN,QACF,CAAC;EAED,OAAOpB,CAAC,CAACa,KAAK,CAACkB,KAAK,CAACF,GAAG,EAAEF,YAAY,CAACN,CAAC,CAAC;AAC3C,CAAC;EAAAW,CAAA;EAAAC,IAAA;EAAAC,GAAA,EAAAC,8sBAAA;EAAA,IAAAC,UAAA;IAAA;MAAApC,CAAA;MAAAC,GAAA;MAAAE,0BAAA;MAAAD;IAAA;EAAA;AAAA,MAAAY,CAAA,CAAAI,CAAA,uBAAC;AAEF,eAAed,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["tgpu","d","std","maskTextureBindGroupLayout","getPixelColorFromVector","maskFragment","globalThis","__TYPEGPU_AUTONAME__","a","fragmentFn","in","uv","vec2f","out","vec4f","$","__TYPEGPU_META__","WeakMap","set","f","input","texcoord","x","y","mask","textureSample","texture","sampler","reversedMask","sub","xyz","w","color","v","name","ast","{\"params\":[{\"type\":\"i\",\"name\":\"input\"}],\"body\":[0,[[13,\"texcoord\",[6,[7,\"d\",\"vec2f\"],[[7,[7,\"input\",\"uv\"],\"x\"],[1,[5,\"1\"],\"-\",[7,[7,\"input\",\"uv\"],\"y\"]]]]],[13,\"mask\",[6,[7,\"std\",\"textureSample\"],[[7,[7,\"maskTextureBindGroupLayout\",\"$\"],\"texture\"],[7,[7,\"maskTextureBindGroupLayout\",\"$\"],\"sampler\"],\"texcoord\"]]],[13,\"reversedMask\",[6,[7,\"d\",\"vec4f\"],[[6,[7,\"std\",\"sub\"],[[5,\"1\"],[7,\"mask\",\"xyz\"]]],[7,\"mask\",\"w\"]]]],[12,\"color\",[6,\"getPixelColorFromVector\",[\"texcoord\"]]],[10,[6,[7,\"d\",\"vec4f\"],[[7,\"color\",\"xyz\"],[7,\"reversedMask\",\"x\"]]]]]],\"externalNames\":[\"d\",\"std\",\"maskTextureBindGroupLayout\",\"getPixelColorFromVector\"]}","externals"],"sourceRoot":"../../../../src","sources":["shaders/fragmentShaders/maskFragment.ts"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,SAAS;AAC1B,OAAO,KAAKC,CAAC,MAAM,cAAc;AACjC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAClC,SAASC,0BAA0B,QAAQ,wBAAqB;AAChE,SAASC,uBAAuB,QAAQ,iBAAc;AAEtD,MAAMC,YAAY,IAAAC,UAAA,CAAAC,oBAAA,KAAAC,CAAA,IAAAA,CAAA,GAAGR,IAAI,CAAC,WAAW,CAAC,CAACS,UAAU,CAAC;EAChDC,EAAE,EAAE;IAAEC,EAAE,EAAEV,CAAC,CAACW;EAAM,CAAC;EACnBC,GAAG,EAAEZ,CAAC,CAACa;AACT,CAAC,CAAC,EAAAC,CAAA,KAAAT,UAAA,CAAAU,gBAAA,SAAAC,OAAA,IAAAC,GAAA,CAAAH,CAAA,CAAAI,CAAA,GAAEC,KAAK,IAAK;EACZ,MAAMC,QAAQ,GAAGpB,CAAC,CAACW,KAAK,CAACQ,KAAK,CAACT,EAAE,CAACW,CAAC,EAAE,GAAG,GAAGF,KAAK,CAACT,EAAE,CAACY,CAAC,CAAC;EAEtD,MAAMC,IAAI,GAAGtB,GAAG,CAACuB,aAAa,CAC5BtB,0BAA0B,CAACY,CAAC,CAACW,OAAO,EACpCvB,0BAA0B,CAACY,CAAC,CAACY,OAAO,EACpCN,QACF,CAAC;EACD,MAAMO,YAAY,GAAG3B,CAAC,CAACa,KAAK,CAACZ,GAAG,CAAC2B,GAAG,CAAC,GAAG,EAAEL,IAAI,CAACM,GAAG,CAAC,EAAEN,IAAI,CAACO,CAAC,CAAC;EAE5D,IAAIC,KAAK,GAAG5B,uBAAuB,CAACiB,QAAQ,CAAC;EAE7C,OAAOpB,CAAC,CAACa,KAAK,CAACkB,KAAK,CAACF,GAAG,EAAEF,YAAY,CAACN,CAAC,CAAC;AAC3C,CAAC;EAAAW,CAAA;EAAAC,IAAA;EAAAC,GAAA,EAAAC,inBAAA;EAAA,IAAAC,UAAA;IAAA;MAAApC,CAAA;MAAAC,GAAA;MAAAC,0BAAA;MAAAC;IAAA;EAAA;AAAA,MAAAW,CAAA,CAAAI,CAAA,uBAAC;AAEF,eAAed,YAAY","ignoreList":[]}
@@ -3,8 +3,8 @@
3
3
  import tgpu from 'typegpu';
4
4
  import * as d from 'typegpu/data';
5
5
  import * as std from 'typegpu/std';
6
- import { textureBindGroupLayout, maskTextureBindGroupLayout, rotationBindGroupLayout, reverseHoloDetectionChannelFlagsBindGroupLayout } from "../bindGroupLayouts.js";
7
- import { hueShift, rgbToHSV } from "../tgpuUtils.js";
6
+ import { maskTextureBindGroupLayout, reverseHoloDetectionChannelFlagsBindGroupLayout, sharedBindGroupLayout } from "../bindGroupLayouts.js";
7
+ import { getPixelColorFromVector, hueShift, rgbToHSV } from "../tgpuUtils.js";
8
8
  export const reverseHoloFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))(tgpu['~unstable'].fragmentFn({
9
9
  in: {
10
10
  uv: d.vec2f
@@ -14,7 +14,7 @@ export const reverseHoloFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))
14
14
  const texcoord = d.vec2f(input.uv.x, 1.0 - input.uv.y);
15
15
  const uv = texcoord;
16
16
  const centeredCoords = std.sub(std.mul(uv, 2.0), 1.0);
17
- const rot = rotationBindGroupLayout.$.vec;
17
+ const rot = sharedBindGroupLayout.$.rot;
18
18
  const center = std.add(d.vec2f(0.0), d.vec2f(rot.x, rot.y)); // center from device orientation/touch
19
19
 
20
20
  // glare options---------------------------------
@@ -38,7 +38,7 @@ export const reverseHoloFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))
38
38
  const valueFlag = detectionChannelFlags.value;
39
39
  //------------------------------------------------
40
40
 
41
- const cardColor = std.textureSample(textureBindGroupLayout.$.texture, textureBindGroupLayout.$.sampler, texcoord);
41
+ const cardColor = getPixelColorFromVector(texcoord);
42
42
  const holoMaskColor = std.textureSample(maskTextureBindGroupLayout.$.texture, maskTextureBindGroupLayout.$.sampler, texcoord);
43
43
  const dist = std.distance(centeredCoords, center);
44
44
  const rFalloff = std.exp(-dist);
@@ -70,14 +70,14 @@ export const reverseHoloFragment = (globalThis.__TYPEGPU_AUTONAME__ ?? (a => a))
70
70
  }, {
71
71
  v: 1,
72
72
  name: void 0,
73
- ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"texcoord",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"uv","texcoord"],[13,"centeredCoords",[6,[7,"std","sub"],[[6,[7,"std","mul"],["uv",[5,"2"]]],[5,"1"]]]],[13,"rot",[7,[7,"rotationBindGroupLayout","$"],"vec"]],[13,"center",[6,[7,"std","add"],[[6,[7,"d","vec2f"],[[5,"0"]]],[6,[7,"d","vec2f"],[[7,"rot","x"],[7,"rot","y"]]]]]],[13,"opts",[7,[7,"reverseHoloDetectionChannelFlagsBindGroupLayout","$"],"glareOptions"]],[13,"glareIntensity",[7,"opts","glareIntensity"]],[13,"glowPower",[7,"opts","glowPower"]],[13,"lightIntensity",[7,"opts","lightIntensity"]],[13,"glareColor",[7,"opts","glareColor"]],[13,"hueBlendPower",[7,"glareColor","hueBlendPower"]],[13,"hueShiftAngleMin",[7,"glareColor","hueShiftAngleMin"]],[13,"hueShiftAngleMax",[7,"glareColor","hueShiftAngleMax"]],[13,"detectionChannelFlags",[7,[7,"reverseHoloDetectionChannelFlagsBindGroupLayout","$"],"channelFlags"]],[13,"redChannelFlag",[7,"detectionChannelFlags","redChannel"]],[13,"greenChannelFlag",[7,"detectionChannelFlags","greenChannel"]],[13,"blueChannelFlag",[7,"detectionChannelFlags","blueChannel"]],[13,"hueFlag",[7,"detectionChannelFlags","hue"]],[13,"saturationFlag",[7,"detectionChannelFlags","saturation"]],[13,"valueFlag",[7,"detectionChannelFlags","value"]],[13,"cardColor",[6,[7,"std","textureSample"],[[7,[7,"textureBindGroupLayout","$"],"texture"],[7,[7,"textureBindGroupLayout","$"],"sampler"],"texcoord"]]],[13,"holoMaskColor",[6,[7,"std","textureSample"],[[7,[7,"maskTextureBindGroupLayout","$"],"texture"],[7,[7,"maskTextureBindGroupLayout","$"],"sampler"],"texcoord"]]],[13,"dist",[6,[7,"std","distance"],["centeredCoords","center"]]],[13,"rFalloff",[6,[7,"std","exp"],[[4,"-","dist"]]]],[13,"scaledRadial",[6,[7,"std","mul"],["rFalloff",[6,[7,"std","add"],[[5,"1"],[6,[7,"std","max"],[[5,"0"],"glareIntensity"]]]]]]],[13,"influence",[6,[7,"std","smoothstep"],[[5,"0"],[5,"1"],"scaledRadial"]]],[13,"curvePower",[6,[7,"std","clamp"],["glowPower",[5,"0.05"],[5,"64"]]]],[13,"glowMask",[6,[7,"std","pow"],["influence",[6,[7,"std","div"],[[5,"1"],"curvePower"]]]]],[13,"holoMaskColorHSV",[6,"rgbToHSV",[[7,"holoMaskColor","xyz"]]]],[13,"rgbSelection",[6,[7,"d","vec3f"],["redChannelFlag","greenChannelFlag","blueChannelFlag"]]],[13,"channelFactor",[6,[7,"std","dot"],[[7,"holoMaskColor","xyz"],"rgbSelection"]]],[13,"hsvSelection",[6,[7,"d","vec3f"],["hueFlag","saturationFlag","valueFlag"]]],[13,"channelFactorHSV",[6,[7,"std","dot"],[[7,"holoMaskColorHSV","xyz"],"hsvSelection"]]],[13,"channelFactorCombined",[6,[7,"std","mix"],["channelFactor","channelFactorHSV",[5,"0"]]]],[13,"holoFactor",[1,[1,[1,[5,"1"],"-","channelFactorCombined"],"*",[7,"holoMaskColor","w"]],"*",[6,[7,"std","pow"],["scaledRadial",[5,"1.5"]]]]],[13,"maskedGlow",[6,[7,"std","pow"],[[6,[7,"std","mul"],["glowMask","holoFactor"]],[5,"2"]]]],[13,"hueAmount",[6,[7,"std","mix"],["hueShiftAngleMin","hueShiftAngleMax",[6,[7,"std","clamp"],["maskedGlow",[5,"0"],[5,"1"]]]]]],[13,"sparkleHue",[6,"hueShift",[[7,"cardColor","xyz"],"hueAmount"]]],[13,"shineStrength",[6,[7,"std","clamp"],["lightIntensity",[5,"1"],[5,"100"]]]],[13,"shineIntensity",[1,[1,[5,"1.5"],"*","shineStrength"],"*","maskedGlow"]],[13,"hueMixAmt",[6,[7,"std","clamp"],[[1,[1,"hueBlendPower","/",[5,"5"]],"*","maskedGlow"],[5,"0"],[5,"1"]]]],[13,"chromaMix",[6,[7,"std","mix"],[[7,"cardColor","xyz"],"sparkleHue","hueMixAmt"]]],[13,"shineLayer",[6,[7,"std","mul"],["chromaMix","shineIntensity"]]],[10,[6,[7,"d","vec4f"],[[6,[7,"d","vec3f"],["shineLayer"]],[1,[5,"1"],"-","maskedGlow"]]]]]],"externalNames":["d","std","rotationBindGroupLayout","reverseHoloDetectionChannelFlagsBindGroupLayout","textureBindGroupLayout","maskTextureBindGroupLayout","rgbToHSV","hueShift"]},
73
+ ast: {"params":[{"type":"i","name":"input"}],"body":[0,[[13,"texcoord",[6,[7,"d","vec2f"],[[7,[7,"input","uv"],"x"],[1,[5,"1"],"-",[7,[7,"input","uv"],"y"]]]]],[13,"uv","texcoord"],[13,"centeredCoords",[6,[7,"std","sub"],[[6,[7,"std","mul"],["uv",[5,"2"]]],[5,"1"]]]],[13,"rot",[7,[7,"sharedBindGroupLayout","$"],"rot"]],[13,"center",[6,[7,"std","add"],[[6,[7,"d","vec2f"],[[5,"0"]]],[6,[7,"d","vec2f"],[[7,"rot","x"],[7,"rot","y"]]]]]],[13,"opts",[7,[7,"reverseHoloDetectionChannelFlagsBindGroupLayout","$"],"glareOptions"]],[13,"glareIntensity",[7,"opts","glareIntensity"]],[13,"glowPower",[7,"opts","glowPower"]],[13,"lightIntensity",[7,"opts","lightIntensity"]],[13,"glareColor",[7,"opts","glareColor"]],[13,"hueBlendPower",[7,"glareColor","hueBlendPower"]],[13,"hueShiftAngleMin",[7,"glareColor","hueShiftAngleMin"]],[13,"hueShiftAngleMax",[7,"glareColor","hueShiftAngleMax"]],[13,"detectionChannelFlags",[7,[7,"reverseHoloDetectionChannelFlagsBindGroupLayout","$"],"channelFlags"]],[13,"redChannelFlag",[7,"detectionChannelFlags","redChannel"]],[13,"greenChannelFlag",[7,"detectionChannelFlags","greenChannel"]],[13,"blueChannelFlag",[7,"detectionChannelFlags","blueChannel"]],[13,"hueFlag",[7,"detectionChannelFlags","hue"]],[13,"saturationFlag",[7,"detectionChannelFlags","saturation"]],[13,"valueFlag",[7,"detectionChannelFlags","value"]],[13,"cardColor",[6,"getPixelColorFromVector",["texcoord"]]],[13,"holoMaskColor",[6,[7,"std","textureSample"],[[7,[7,"maskTextureBindGroupLayout","$"],"texture"],[7,[7,"maskTextureBindGroupLayout","$"],"sampler"],"texcoord"]]],[13,"dist",[6,[7,"std","distance"],["centeredCoords","center"]]],[13,"rFalloff",[6,[7,"std","exp"],[[4,"-","dist"]]]],[13,"scaledRadial",[6,[7,"std","mul"],["rFalloff",[6,[7,"std","add"],[[5,"1"],[6,[7,"std","max"],[[5,"0"],"glareIntensity"]]]]]]],[13,"influence",[6,[7,"std","smoothstep"],[[5,"0"],[5,"1"],"scaledRadial"]]],[13,"curvePower",[6,[7,"std","clamp"],["glowPower",[5,"0.05"],[5,"64"]]]],[13,"glowMask",[6,[7,"std","pow"],["influence",[6,[7,"std","div"],[[5,"1"],"curvePower"]]]]],[13,"holoMaskColorHSV",[6,"rgbToHSV",[[7,"holoMaskColor","xyz"]]]],[13,"rgbSelection",[6,[7,"d","vec3f"],["redChannelFlag","greenChannelFlag","blueChannelFlag"]]],[13,"channelFactor",[6,[7,"std","dot"],[[7,"holoMaskColor","xyz"],"rgbSelection"]]],[13,"hsvSelection",[6,[7,"d","vec3f"],["hueFlag","saturationFlag","valueFlag"]]],[13,"channelFactorHSV",[6,[7,"std","dot"],[[7,"holoMaskColorHSV","xyz"],"hsvSelection"]]],[13,"channelFactorCombined",[6,[7,"std","mix"],["channelFactor","channelFactorHSV",[5,"0"]]]],[13,"holoFactor",[1,[1,[1,[5,"1"],"-","channelFactorCombined"],"*",[7,"holoMaskColor","w"]],"*",[6,[7,"std","pow"],["scaledRadial",[5,"1.5"]]]]],[13,"maskedGlow",[6,[7,"std","pow"],[[6,[7,"std","mul"],["glowMask","holoFactor"]],[5,"2"]]]],[13,"hueAmount",[6,[7,"std","mix"],["hueShiftAngleMin","hueShiftAngleMax",[6,[7,"std","clamp"],["maskedGlow",[5,"0"],[5,"1"]]]]]],[13,"sparkleHue",[6,"hueShift",[[7,"cardColor","xyz"],"hueAmount"]]],[13,"shineStrength",[6,[7,"std","clamp"],["lightIntensity",[5,"1"],[5,"100"]]]],[13,"shineIntensity",[1,[1,[5,"1.5"],"*","shineStrength"],"*","maskedGlow"]],[13,"hueMixAmt",[6,[7,"std","clamp"],[[1,[1,"hueBlendPower","/",[5,"5"]],"*","maskedGlow"],[5,"0"],[5,"1"]]]],[13,"chromaMix",[6,[7,"std","mix"],[[7,"cardColor","xyz"],"sparkleHue","hueMixAmt"]]],[13,"shineLayer",[6,[7,"std","mul"],["chromaMix","shineIntensity"]]],[10,[6,[7,"d","vec4f"],[[6,[7,"d","vec3f"],["shineLayer"]],[1,[5,"1"],"-","maskedGlow"]]]]]],"externalNames":["d","std","sharedBindGroupLayout","reverseHoloDetectionChannelFlagsBindGroupLayout","getPixelColorFromVector","maskTextureBindGroupLayout","rgbToHSV","hueShift"]},
74
74
  get externals() {
75
75
  return {
76
76
  d,
77
77
  std,
78
- rotationBindGroupLayout,
78
+ sharedBindGroupLayout,
79
79
  reverseHoloDetectionChannelFlagsBindGroupLayout,
80
- textureBindGroupLayout,
80
+ getPixelColorFromVector,
81
81
  maskTextureBindGroupLayout,
82
82
  rgbToHSV,
83
83
  hueShift