Azure / azure-remote-rendering

SDK and samples for Azure Remote Rendering
MIT License
106 stars 38 forks source link

[Remote rendering problem] When applying transforms to a part of a model, sometimes parts of the model do not render #75

Closed raiviok closed 2 years ago

raiviok commented 2 years ago

Describe the problem

I am rendering a helicopter model, and making the rotor rotate with runtime transforms of the rotor. However, sometimes parts of the model do not render once the rotating has been started. Please see the attached videos for reference [edit: all are captured from the Unity game pane]:

https://user-images.githubusercontent.com/104123292/164387721-14bfc395-ecf3-4a7e-b8f5-33bc6542b49d.mp4

https://user-images.githubusercontent.com/104123292/164387739-c911678c-2a8f-460a-9c0a-2b17244148d5.mp4

https://user-images.githubusercontent.com/104123292/164387747-d0b0abe8-babd-4418-8c2d-bcfcf446d027.mp4

Once the model has finished loading in ARR, I programatically attach a custom component to the rotor submodel that makes the rotor rotate. It might be that applying the rotation when the model is far away from world origin makes the glitch appear. The rotator code looks like this:


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RotorRotator : MonoBehaviour
{
    public bool RunEventLoop = false;

    public float radius = -2.295f;
    public float speed = 16;
    public Vector3 offset = new Vector3(-1.25f, 29f, -34f);

    // Start is called before the first frame update
    void Start()
    {

    }

    void FixedUpdate()
    {
        if (RunEventLoop)
        {
            transform.RotateAround(transform.position, transform.parent.transform.TransformDirection(Vector3.forward), speed);
            transform.position = transform.parent.transform.TransformPoint(offset) + transform.rotation * (radius * Vector3.up);
        }
    }
}

I have already tried updating ARR to the latest version, but that didn't help.

What might be causing this? There was already discussion about this on the Holodevelopers Slack, but some person there instructed me to file an issue here. Please let me know if you need any additional information.

FlorianBorn71 commented 2 years ago

Hi @raiviok! Thanks for posting the videos, this makes it much clearer now, and this is certainly a bug rather than near/far clip plane issues. It looks like parts of the models are falsely clipped so I assume there is something wrong with the conversion of the per-part bounding boxes. I guess the model conversion is also a recent one from the last weeks? For further analysis, it would be required that we have a look at the source model. Would it be possible to provide us the model (both source .fbx/.glb and converted arrAsset)? FWIW, there is nothing wrong with your approach to assign a rotation component.

FlorianBorn71 commented 2 years ago

Hi @raiviok, do you think it would be possible to get access to your source model? Or have you been working with a very old (>1 year) conversion of the model? Because in early converters we did have a problem with clipping boxes which has been fixed since then.

jakrams commented 2 years ago

@raiviok we currently have no way to reproduce this issue. There have been such issues with models that have been converted a long time ago, so reconverting the model may fix your problem. Unless you can provide us with a source GLTF or FBX file that exhibits this behavior with the latest ARR version, I will soon close this issue.

FlorianBorn71 commented 2 years ago

Closing this due to no activity. Please re-open in case the problem still persists.