Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Adding a red border while recording

Discussion in 'Scripting' started by MAKahs, Aug 1, 2023.

  1. MAKahs

    MAKahs

    Joined:
    Jan 30, 2023
    Posts:
    2
    Hi,

    I’m working on a feature to record the current game view and I need an idea on how to show some kind of visuals on the screen while recording (e.g., a red border around the window).

    The Challenge:

    The recorded images should include everything that is happening on the screen – including the current UI canvas – except for the red border.

    Things I have considered:
    • Using ScreenCapture.CaptureScreenshot in a Coroutine, after a preceding WairForEndOfFrame.
      Problem: How can I show extra visuals without recording them?
    • Record the src RenderTexture from OnRenderImage and add the recording border afterwards.
      Problem: This might not be the complete image I want to record. The recorded image is darker than what is shown on screen and the image might not be complete. The canvas and/or additional cameras are not included yet.
    • Adding a border via a second canvas.
      Problem: How can I access and save the partial image? I mean the rendered scene + the first UI canvas but without the second UI canvas.
    • Rendering the main camera on command with Camera.Render.
      Problem: This renders the main camera a second time and I wouldn’t know how to include the UI canvas.

    I feel like there is an easy solution, but I just don’t see it :D I would really appreciate new ideas.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
  3. MAKahs

    MAKahs

    Joined:
    Jan 30, 2023
    Posts:
    2
    Thanks for the answer but this package is described as Editor-Only and I need this feature available in the standalone build as well.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Ah damn, but good to know.

    I'd also check the asset store for any assets that do runtime recording. I've used AVPro in the past, but it's now been split up into so many assets that you need to double check that you get the right one (some are platform-specific, or only playback, etc). Also pricey, but worth it.