You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add option for HalfFloat in vertexAnimationBaker's textureFromBakedVertexData (#16750)
For devices that support it and animations whose precision is not
affected by the precision of float16, using HalfFloat can cut down
memory usage by 50%. Currently have a warning when the engine caps don't
include HalfFloat - don't know if might make sense to return null
instead since whatever happens down the line will not be supported,
likely crazy polygon soup from the VAT shader.
Copy file name to clipboardExpand all lines: packages/dev/core/src/BakedVertexAnimation/vertexAnimationBaker.ts
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,8 @@ import type { Scene } from "../scene";
7
7
import{Constants}from"../Engines/constants";
8
8
import{Skeleton}from"core/Bones/skeleton";
9
9
importtype{Nullable}from"core/types";
10
-
import{ToHalfFloat}from"core/Misc/textureTools";
10
+
import{ToHalfFloat}from"../Misc/textureTools";
11
+
import{Logger}from"../Misc/logger";
11
12
12
13
/**
13
14
* Class to bake vertex animation textures.
@@ -140,15 +141,22 @@ export class VertexAnimationBaker {
140
141
}
141
142
/**
142
143
* Builds a vertex animation texture given the vertexData in an array.
143
-
* @param vertexData The vertex animation data. You can generate it with bakeVertexData().
144
+
* @param vertexData The vertex animation data. You can generate it with bakeVertexData(). You can pass in a Float32Array to return a full precision texture, or a Uint16Array to return a half-float texture.
145
+
* If you pass in a Uint16Array, make sure your device supports half-float textures
144
146
* @returns The vertex animation texture to be used with BakedVertexAnimationManager.
0 commit comments