babylonjs-materials 9.10.0 → 9.10.1

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.
@@ -1077,6 +1077,7 @@ export * from "babylonjs-materials/grid/gridMaterial";
1077
1077
  declare module "babylonjs-materials/grid/gridMaterial" {
1078
1078
  import { Matrix, Vector3 } from "babylonjs/Maths/math.vector";
1079
1079
  import { Color3 } from "babylonjs/Maths/math.color";
1080
+ import { Nullable } from "babylonjs/types";
1080
1081
  import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
1081
1082
  import { PushMaterial } from "babylonjs/Materials/pushMaterial";
1082
1083
  import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
@@ -1113,13 +1114,53 @@ export class GridMaterial extends PushMaterial {
1113
1114
  */
1114
1115
  minorUnitVisibility: number;
1115
1116
  /**
1116
- * The grid opacity outside of the lines.
1117
+ * Overall mesh opacity. In linesOnly mode this also scales the maximum line alpha.
1117
1118
  */
1118
1119
  opacity: number;
1119
1120
  /**
1120
1121
  * Whether to antialias the grid
1121
1122
  */
1122
1123
  antialias: boolean;
1124
+ /**
1125
+ * Color of grid lines when the camera is below the surface.
1126
+ * When set, lineColor acts as the above-surface color.
1127
+ */
1128
+ get belowLineColor(): Nullable<Color3>;
1129
+ set belowLineColor(value: Nullable<Color3>);
1130
+ private _belowLineColor;
1131
+ /**
1132
+ * Enable multi-scale logarithmic grid LOD. Number of octaves is controlled by gridOctaves.
1133
+ */
1134
+ useMultiScale: boolean;
1135
+ /**
1136
+ * World-unit spacing of the finest octave. Default 0.001.
1137
+ */
1138
+ minGridSpacing: number;
1139
+ /**
1140
+ * Number of logarithmic octaves rendered (1–8). Default 4.
1141
+ */
1142
+ gridOctaves: number;
1143
+ /**
1144
+ * Enable camera-distance-aware horizon (grazing-angle) fade.
1145
+ */
1146
+ useHorizonFade: boolean;
1147
+ /**
1148
+ * Render an ultra-fine crosshair at the world origin.
1149
+ */
1150
+ useOriginMarker: boolean;
1151
+ /**
1152
+ * When true, only grid lines are visible — non-grid pixels are discarded.
1153
+ * Puts the material in the alpha-blend queue and enables a depth pre-pass so grid lines
1154
+ * correctly occlude translucent objects (e.g. Gaussian splats). Set mesh.alphaIndex to a
1155
+ * value lower than other transparent objects so the depth pre-pass fires first.
1156
+ */
1157
+ get linesOnly(): boolean;
1158
+ set linesOnly(value: boolean);
1159
+ private _linesOnly;
1160
+ /**
1161
+ * Scales grid line width. Values \> 1 produce thicker lines. Default 1.0.
1162
+ */
1163
+ gridThicknessModifier: number;
1123
1164
  /**
1124
1165
  * Determine RBG output is premultiplied by alpha value.
1125
1166
  */
@@ -1134,6 +1175,7 @@ export class GridMaterial extends PushMaterial {
1134
1175
  */
1135
1176
  opacityTexture: BaseTexture;
1136
1177
  private _gridControl;
1178
+ private _viewportSize;
1137
1179
  /**
1138
1180
  * constructor
1139
1181
  * @param name The name given to the material in order to identify it afterwards.
@@ -1157,6 +1199,13 @@ export class GridMaterial extends PushMaterial {
1157
1199
  clone(name: string): GridMaterial;
1158
1200
  serialize(): any;
1159
1201
  getClassName(): string;
1202
+ /**
1203
+ * Parse a JSON input to create back a grid material.
1204
+ * @param source the JSON data to parse
1205
+ * @param scene defines the hosting scene
1206
+ * @param rootUrl defines the root URL to use to load textures and relative dependencies
1207
+ * @returns a new grid material
1208
+ */
1160
1209
  static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
1161
1210
  }
1162
1211
 
@@ -3038,13 +3087,53 @@ declare namespace BABYLON {
3038
3087
  */
3039
3088
  minorUnitVisibility: number;
3040
3089
  /**
3041
- * The grid opacity outside of the lines.
3090
+ * Overall mesh opacity. In linesOnly mode this also scales the maximum line alpha.
3042
3091
  */
3043
3092
  opacity: number;
3044
3093
  /**
3045
3094
  * Whether to antialias the grid
3046
3095
  */
3047
3096
  antialias: boolean;
3097
+ /**
3098
+ * Color of grid lines when the camera is below the surface.
3099
+ * When set, lineColor acts as the above-surface color.
3100
+ */
3101
+ get belowLineColor(): Nullable<Color3>;
3102
+ set belowLineColor(value: Nullable<Color3>);
3103
+ private _belowLineColor;
3104
+ /**
3105
+ * Enable multi-scale logarithmic grid LOD. Number of octaves is controlled by gridOctaves.
3106
+ */
3107
+ useMultiScale: boolean;
3108
+ /**
3109
+ * World-unit spacing of the finest octave. Default 0.001.
3110
+ */
3111
+ minGridSpacing: number;
3112
+ /**
3113
+ * Number of logarithmic octaves rendered (1–8). Default 4.
3114
+ */
3115
+ gridOctaves: number;
3116
+ /**
3117
+ * Enable camera-distance-aware horizon (grazing-angle) fade.
3118
+ */
3119
+ useHorizonFade: boolean;
3120
+ /**
3121
+ * Render an ultra-fine crosshair at the world origin.
3122
+ */
3123
+ useOriginMarker: boolean;
3124
+ /**
3125
+ * When true, only grid lines are visible — non-grid pixels are discarded.
3126
+ * Puts the material in the alpha-blend queue and enables a depth pre-pass so grid lines
3127
+ * correctly occlude translucent objects (e.g. Gaussian splats). Set mesh.alphaIndex to a
3128
+ * value lower than other transparent objects so the depth pre-pass fires first.
3129
+ */
3130
+ get linesOnly(): boolean;
3131
+ set linesOnly(value: boolean);
3132
+ private _linesOnly;
3133
+ /**
3134
+ * Scales grid line width. Values \> 1 produce thicker lines. Default 1.0.
3135
+ */
3136
+ gridThicknessModifier: number;
3048
3137
  /**
3049
3138
  * Determine RBG output is premultiplied by alpha value.
3050
3139
  */
@@ -3059,6 +3148,7 @@ declare namespace BABYLON {
3059
3148
  */
3060
3149
  opacityTexture: BaseTexture;
3061
3150
  private _gridControl;
3151
+ private _viewportSize;
3062
3152
  /**
3063
3153
  * constructor
3064
3154
  * @param name The name given to the material in order to identify it afterwards.
@@ -3082,6 +3172,13 @@ declare namespace BABYLON {
3082
3172
  clone(name: string): GridMaterial;
3083
3173
  serialize(): any;
3084
3174
  getClassName(): string;
3175
+ /**
3176
+ * Parse a JSON input to create back a grid material.
3177
+ * @param source the JSON data to parse
3178
+ * @param scene defines the hosting scene
3179
+ * @param rootUrl defines the root URL to use to load textures and relative dependencies
3180
+ * @returns a new grid material
3181
+ */
3085
3182
  static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
3086
3183
  }
3087
3184
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-materials",
3
- "version": "9.10.0",
3
+ "version": "9.10.1",
4
4
  "main": "babylonjs.materials.min.js",
5
5
  "types": "babylonjs.materials.module.d.ts",
6
6
  "files": [
@@ -16,7 +16,7 @@
16
16
  "test:escheck": "es-check es6 ./babylonjs.materials.js"
17
17
  },
18
18
  "dependencies": {
19
- "babylonjs": "9.10.0"
19
+ "babylonjs": "9.10.1"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@dev/build-tools": "1.0.0",