Alchemist0823 / three.quarks

Three.quarks is a general purpose particle system / VFX engine for three.js
https://quarks.art
480 stars 22 forks source link

Unity Prefab loader for Shuriken Particle System #64

Closed Alchemist0823 closed 2 months ago

Alchemist0823 commented 11 months ago

Implement a loader for a unity prefab loader for Shuriken Particle System. many developer want to use Unity asset in their web game.

dellwatson commented 11 months ago

let's try to share simple asset from unity too here, so other can try. though the possibility of working/experimenting might be you alone XD or mybe both of us but it can be a track of learning and motivation for others.

but if it's too much dont mind me then.

Alchemist0823 commented 11 months ago

Thanks for your interest. I am considering making this thing separate from this open source project because Unity is commercial. and the conversion is not going to be perfect, users may need some extra adjustments after the import. I am planning to tight it with quarks platform. let us talk in private about potential collaboration.

hybridherbst commented 11 months ago

@Alchemist0823 we're doing something quite similar but transmit the data as part of custom glTF extension(s). Maybe there's potential to align on a format for that (would just be JSON and could be used both inside glTF and standalone).

Alchemist0823 commented 11 months ago

@hybridherbst in the long term, we really want to make a node-based format for general VFX that can be ported any platform and engine that is not tied to unity. We want particle behavior to be implemented in node graph style, and specify the execution of them on either CPU and GPU. There is node graph gltf extension that adobe and threekit is proposing for KhronosGroup. https://www.youtube.com/watch?v=-XLOkDiAYkQ&ab_channel=TheKhronosGroup . https://github.com/bhouston/behave-graph/ . even though that's not what we exactly want, that's the direction we want to move to. we may want to talk to them at some point.

hybridherbst commented 11 months ago

Sure, I meant in relation to your original post. I just donโ€™t think loading a Unity prefab or package is a good inbetween step towards interoperability, an open format may :)

Alchemist0823 commented 11 months ago

When you say open, do you mean open in terms of openness of the specification or the generalization of VFX system?

Would love to see what does your format in needle look like? Is it matching Unity's file format in json style? Our current particle system format is an extension to three.js's object json format. The work-in-progress 2.0 format implements all the fixed behavior of the current format in node graph style. and also support more customizable behavior. This loader for here will convert unity prefab to 1.0 format. It's a temporary measurement to increase the adoption and solve problems for the current community. For 2.0 format, we can be more open about the specification of the format and potentially collaborate with gltf format. Because we think it's going to be more widely adopted by other people.

Ctrlmonster commented 11 months ago

Just wanted to say that this issue is so important if three.js is to become a more viable option for making games ๐Ÿ™. Designing good-looking effects is hard and as indie-devs we're usually already working at capacity just programming our games.

I wouldn't presume myself (unless trained) to be able to do the modeling or texturing for my game, the same goes for VFX. The Unity Store is a rich ecosystem that has tons of good looking effects created by experienced artists. If this would allow us to tap into that from three.js (even if it's not 100% compatibility) it would be an enormous step forward for three.js as a game-creation tool.

Cheers

Alchemist0823 commented 11 months ago

Thanks for the feedback. some updates on the feature. because the unity particle system file depends on Material, Texture, Model, and ShaderLib shader. A lot of Unity packages has customized shader and the render properties on custom shader has different name and style. it's very tricky to support the conversion of all assets. But we can definitely convert the unity asset automatically to a stage and do some manual adjustments later.

hybridherbst commented 11 months ago

Really recommend you at least check out how we're handling that at Needle and putting all of the Unity Particle System data, materials, textures, even custom shaders into glTF ๐Ÿ˜ not saying it's the only way but it's a pretty nice way I think. I'll stop bothering :)

Alchemist0823 commented 11 months ago

No it all. thanks for the suggestion, I thought those things were in your proprietary code. I will definitely take a look. My approach is a little different. I don't really want to have a unity plugin to do the work. but the shader conversion would be interesting.

Alchemist0823 commented 2 months ago

Supported on https://quarks.art