marcofugaro / three-projected-material

📽 Three.js Material which lets you do Texture Projection on a 3d Model
https://marcofugaro.github.io/three-projected-material/
MIT License
671 stars 57 forks source link

Convert to TypeScript #34

Closed trusktr closed 2 years ago

trusktr commented 2 years ago

Also reduce repetition of versions in examples using import maps, and import only needed classes rather than the whole Three.js library in all examples except video.html.

One thing I'm not sure about yet is this bit of GLSL code:

// apply the enccoding from the texture
// textureColor = projectedTexelToLinear(textureColor);
// TODO ENCODINGS is this correct now that encodings have been removed.
textureColor = textureColor;

All constants except for sRGB and Linear have been removed, and three updated all their shaders to essentially remove conversions just like that. See the multiple TODO ENCODINGS comments.

All the examples work.

marcofugaro commented 2 years ago

Nope, thanks. I see no benefit in converting to typescript this project. Also your PR is pretty opinionated.

I'll add a .d.ts file for ts users instead.

davedbase commented 2 years ago

Just reviewing the project and I would have preferred this PR instead. @trusktr you should fork a version and publish it on your own as three-improved-projected-material, I'd like to make use of it.

trusktr commented 2 years ago

I figured it was likely this would have to remain forked, and that I'd submit a PR anyway just to show it. LUME will compile to WebAssembly with AssemblyScript (TS to Wasm compiler) which doesn't support declaration file types or JSDoc types.

I didn't figure I'd get a kinda snarky response though.

marcofugaro commented 2 years ago

@trusktr you should fork a version and publish it on your own as three-improved-projected-material

I'd prefer you didn't.

I didn't figure I'd get a kinda snarky response though.

Sorry, I didn't explain myself very much. At this point in time the active development on this repo is done. The library is pretty stable and there is only some maintainance to do once every few months. I see no point in converting the whole library to typescript now, it would require much more maintainance time with all the tsc ecosystem. I have provided a .d.ts file for typescript users as well.

LUME will compile to WebAssembly with AssemblyScript (TS to Wasm compiler) which doesn't support declaration file types or JSDoc types.

If AssemblyScript doesn't like .d.ts files, then yes, you can use your fork. I have no plan of supporting AssemblyScript.