Obi Official Forum
Help Camera, lights and export question - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Camera, lights and export question (/thread-4312.html)



Camera, lights and export question - troys - 01-08-2024

Hi, there are some things I wonder about. I use Unity 22.3.9, Obi 7 and default renderer.

1. When editing control points the camera controls become weird. If you middle click the camera jumps an odd distance and it's not possible to drag and move it like usual. Also the rotation is disabled. I have to turn off control points if I want to move the camera and it's really annoying. Is that how it's supposed to work?

2. Using chain renderer, the chain meshes only receives light from directional lights, not spot or point. I don't use directional lights so the chain is unlit. How do I make it work with spots point lights?

3. I want to export the finished chain as a FBX file, but Unitys FBX export tool does not work. Is there a way to do this?


RE: Camera, lights and export question - josemendez - 02-08-2024

(01-08-2024, 03:48 PM)troys Wrote: 1. When editing control points the camera controls become weird. If you middle click the camera jumps an odd distance and it's not possible to drag and move it like usual. Also the rotation is disabled. I have to turn off control points if I want to move the camera and it's really annoying. Is that how it's supposed to work?

No, it's not supposed to work like this. Rotation should be enabled, and moving the camera should work as usual, since we don't meddle with Unity's camera controls at all. I'm unable to reproduce this behavior on either Mac or Windows editor. Could you give any more details regarding this behavior? Unity version being used?

(01-08-2024, 03:48 PM)troys Wrote: 2. Using chain renderer, the chain meshes only receives light from directional lights, not spot or point. I don't use directional lights so the chain is unlit. How do I make it work with spots point lights?

This is a bug/omission in Unity's built-in pipeline, forward rendering path: additional lights (other than the main directional light) don't work properly with mesh instances. The reason is that directional lights are applied on the object's main pass (forward_main) while point and spotlights are done in subsequent, additive passes (forward_add). When using DrawMeshInstanced, Unity only performs the main pass and doesn't render the additional lights. See:

https://discussions.unity.com/t/how-to-use-point-and-spot-lights-with-mesh-instancing/717600

This works properly in the deferred rendering path. Only the built-in forward path is affected. Unfortunately we can't do anything ourselves to fix it.

(01-08-2024, 03:48 PM)troys Wrote: 3. I want to export the finished chain as a FBX file, but Unitys FBX export tool does not work. Is there a way to do this?

Unity's FBX exporter only works with the built in rendering components: MeshRenderer and SkinnedMeshRenderer. In particular, it cannot handle GPU instances which is what the chain links are (for performance reasons, as using individual gamaeObjects with MeshRenderers for each link would be very expensive).

If you need such functionality however, we can write an exporter that generates an .asset mesh in your project. This will allow you to use the resulting chain mesh as a static prefab/prop in your game, or place it in a MeshRenderer to export it as a .FBX using Unity's exporter. Would you be interested in this?

kind regards,


RE: Camera, lights and export question - troys - 02-08-2024

(02-08-2024, 07:44 AM)josemendez Wrote: No, it's not supposed to work like this. Rotation should be enabled, and moving the camera should work as usual, since we don't meddle with Unity's camera controls at all. I'm unable to reproduce this behavior on either Mac or Windows editor. Could you give any more details regarding this behavior? Unity version being used?
Unity version is in the original post, but maybe it's conflicting with some other asset? I use some that add their own scene icons, but if this is the case it would be the first time anything like this happened.

(02-08-2024, 07:44 AM)josemendez Wrote: This is a bug/omission in Unity's built-in pipeline, forward rendering path: additional lights (other than the main directional light) don't work properly with mesh instances. The reason is that directional lights are applied on the object's main pass (forward_main) while point and spotlights are done in subsequent, additive passes (forward_add). When using DrawMeshInstanced, Unity only performs the main pass and doesn't render the additional lights. See:

https://discussions.unity.com/t/how-to-use-point-and-spot-lights-with-mesh-instancing/717600

This works properly in the deferred rendering path. Only the built-in forward path is affected. Unfortunately we can't do anything ourselves to fix it.


Unity's FBX exporter only works with the built in rendering components: MeshRenderer and SkinnedMeshRenderer. In particular, it cannot handle GPU instances which is what the chain links are (for performance reasons, as using individual gamaeObjects with MeshRenderers for each link would be very expensive).

If you need such functionality however, we can write an exporter that generates an .asset mesh in your project. This will allow you to use the resulting chain mesh as a static prefab/prop in your game, or place it in a MeshRenderer to export it as a .FBX using Unity's exporter. Would you be interested in this?

kind regards,
That's messed up, since it works with regular ropes and I can't change to deferred. I tried the mesh renderer component. It works but you can't make a chain with it. A way to export the chain would solve the issue in this case since I use Obi to create static ropes/chains so that would be awesome.Thanks.


RE: Camera, lights and export question - josemendez - 05-08-2024

(02-08-2024, 01:45 PM)troys Wrote: That's messed up, since it works with regular ropes

Regular ropes don't use instancing, so this issue doesn't take place.

(02-08-2024, 01:45 PM)troys Wrote: and I can't change to deferred. I tried the mesh renderer component. It works but you can't make a chain with it. A way to export the chain would solve the issue in this case since I use Obi to create static ropes/chains so that would be awesome.Thanks.

We just added mesh exporting functionality to ObiRopeChainRenderer (by right clicking the component and selecting "Bake Mesh"). Let me know an email address to send the patched ObiRope package to, and I'll send it there.

kind regards,


RE: Camera, lights and export question - troys - 05-08-2024

(05-08-2024, 12:27 PM)josemendez Wrote: Regular ropes don't use instancing, so this issue doesn't take place.


We just added mesh exporting functionality to ObiRopeChainRenderer (by right clicking the component and selecting "Bake Mesh"). Let me know an email address to send the patched ObiRope package to, and I'll send it there.

kind regards,
That's fantastic. I'll PM you the email.