Hi, I'm updated my Three.js version version 0.100.0 to 0.116.0 in my own project.
And, that's happened.
my code
import * as THREE from 'three';
import {
GPUComputationRenderer,
Variable
} from 'three/examples/jsm/misc/GPUComputationRenderer';
const fooTex = gpuCompute.createTexture();
// my function
fillTextures( fooTex );
const fooVar = gpuCompute.addVariable( 'textureVelocity', computeShaderFoo(), fooTex );
const velocityUniforms = fooVar.material.uniforms;
compiler said
ERROR in /Users/my-projects/src/index.ts(84,44)
TS2339: Property 'uniforms' does not exist on type 'Material'.
So, I suspected what's wrong is type definition file, then I rewrite like below, finnaly it works!
three/examples/jsm/misc/GPUComputationRenderer.d.ts
line on 16
export interface Variable {
name: string;
initialValueTexture: Texture;
// material: Material;
material: ShaderMaterial;
dependencies: Variable[];
renderTargets: RenderTarget[];
wrapS: number;
wrapT: number;
minFilter: number;
magFilter: number;
}
v12.11.1
"ts-loader": "^7.0.1",
"typescript": "^3.8.3",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
Would you like to make a PR with the fix? Yes, the type of material has to be ShaderMaterial.
Thank you for confirming, I will push a PR later.
2020年5月22日(金) 21:08 Michael Herzog notifications@github.com:
Would you like to make a PR with the fix? Yes, the type of material has
to be ShaderMaterial.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/mrdoob/three.js/issues/19421#issuecomment-632658995,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJ2YXQ7WBX7Q6JNIPCUU6WLRSZTKBANCNFSM4NHXFF3A
.
Most helpful comment
Thank you for confirming, I will push a PR later.
2020年5月22日(金) 21:08 Michael Herzog notifications@github.com: