RenderHeads / UnityPlugin-AVProMovieCapture

AVPro Movie Capture is a Unity Plugin for advanced video capture to AVI/MP4/MOV files
https://renderheads.com/products/avpro-movie-capture/
48 stars 8 forks source link

Unity Bug - Terrain Grass animates too fast during offline rendering #115

Closed Torantulino closed 3 years ago

Torantulino commented 3 years ago

Describe the bug Recording in offline mode causes animations such as swaying grass on Unity's Terrain system to speed up dramatically. I am looking to switch from another unity plug-in with is able to record offline capture without this effect. This is currently the only thing preventing me from making the switch.

Your Setup (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Set up an intensive scene that requires offline rendering to record smoothly.
  2. Ensure your scene has a unity terrain with swaying grass details
  3. Press play and run an offline capture.
  4. Watch back the recorded video and compare grass sway speed to that observed in the editor.
AndrewRH commented 3 years ago

Thanks we will investigate this - we haven't tried to capture unity terrain grass before and are surprised to hear that it works differently. It should hopefully be an easy fix. We will get back to you shortly.

Thanks,

AndrewRH commented 3 years ago

Are you just using Unity's built-in terrain foliage system for the grass?

AndrewRH commented 3 years ago

We have reproduced the issue. As far as we can tell calling camera.Render() causes Unity's terrain/grass animation system to update time.. This seems like a bug to us. We will dig further to see if it is fixed in a later Unity version, or whether a workaround can be made.

Thanks,

AndrewRH commented 3 years ago

Hi,

We have reporting this as a bug to Unity. The only workaround we have found is to manually adjust the Terrain wind speed.

So if you're capturing 360 (cubemap) it will be rendering the scene 6 times, so you need to divide the wind speed by 6.

image

We will considering making this automatic as part of the capture in the future, but for now this is clearly a bug in Unity and we will wait for their response to the bug report.

I don't think any other capture solution for 360 captures will work any better.

Does that help?

Thanks,

AndrewRH commented 3 years ago

For reference here is the bug reported sent to Unity: https://issuetracker.unity3d.com/issues/terrain-grass-animation-speed-increases-when-calling-different-camera-render-methods

Torantulino commented 3 years ago

Hey,

Oh wow I see, so it's simply due to the number of cameras rendering? Thanks, I'll try that now and let you know if it doesn't work, or whether I run into this problem elsewhere.

I am very impressed with the fast response!

On Tue, Aug 17, 2021 at 8:50 AM Andrew @.***> wrote:

Hi,

We have reporting this as a bug to Unity. The only workaround we have found is to manually adjust the Terrain wind speed.

So if you're capturing 360 (cubemap) it will be rendering the scene 6 times, so you need to divide the wind speed by 6.

[image: image] https://user-images.githubusercontent.com/5418126/129685775-0891a613-53be-4acd-a4b7-248e8c1e42a4.png

We will considering making this automatic as part of the capture in the future, but for now this is clearly a bug in Unity and we will wait for their response to the bug report.

I don't think any other capture solution for 360 captures will work any better.

Does that help?

Thanks,

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RenderHeads/UnityPlugin-AVProMovieCapture/issues/115#issuecomment-900074736, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFPGKX2RJKT3VC2BBQSQKTTT5IIDBANCNFSM5CH6WCZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

AndrewRH commented 3 years ago

Hi,

Yes it's actually not caused by normal camera rendering in your scene, but calls in the script to camera.Render() or camera.RenderToCubemap() which is what we do internally in our plugin. It seems each time you call one of these, Unity is adjusting the terrain animation timer. RenderToCubemap() effectively does 6 render calls (one for each face of the cube), so this one increases the timer 6 times.

Thanks for bringing this to our attention,

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

AndrewRH commented 3 years ago

Closing this as Unity are working on it and not our issue