To simplify the matter I just added an offset to the objects position. In Unity it is offsetted correctly but in ThreeJS it has its normal position. I’m trying to have “swaying leaves” in the end but nothing I feed into the vertex position seems to have an effect
@marcel Thanks for reply. It looks good it just doesn’t apply the “vertex position”. Looking at the image I posted above Unity will apply the Y movement
(Notice how the leaves are moved in the Y-axis in Unity but not in ThreeJS)
The shader has the label and as you can see the Fragment part is working but not the vertex. I am basically right-clicking the tree and exporting as GLB
For explanation: the shader is compiled to glsl and transformed slightly by our exporter to work in threejs (what unity does doesnt work out of the box in three). When the glb is loaded on needle engine we read the gltf extension containing the shader code (via a gltfloader extension) and then build a threejs RawShaderMaterial.
This can be done in r3f the same way - you would only need to add the shader extension (that Needle Engine has) to the GltfLoader that is used to load your glb
I’m using Needle to export my scenes / prefabs so I then can load them however I want individually in my ThreeJS project.
I’m not scripting etc in Unity which is why I’m partially using Needle
The workflow I am interested in is to take Unity assets and create shaders using ShaderGraph and then export them.
In my external ThreeJS project I want to control them / handle all the scripting necessary
You can do what you describe, sure. Nothing is tied to Needle Engine and all data is just stored in the gltf in a couple of extensions. Youll find some info about it in the docs and if you have questions feel free to ask.
What do you mean by “scripting in Unity”? You dont need to write any code in unity for that in fact: most users dont write any c# code when using Needle Engine
I just mean that Needle saves me the headache of going into Blender to modify Unity assets / shaders in order to get GLTFs into my project. I want to control everything outside Needle and merely use Needles export system to help me tranferring Unity assets to Three. It’s actually amazingly useful
Do you know which extension it is and/or where I can find it? I seem to have a hard time locating it. I also don’t see any traces of the compiled shader in the generated r3f project. I see the glb but not the shader data (searching for uniforms I am using in my vertex shader)