Skip to content

ysj018/ScreenshotToUnityProfiler

 
 

Repository files navigation

ScreenshotToUnityProfiler

openupm
日本語はコチラ

about

Embed Screenshot to Unity Profiler protocol.
ScreenshotToUnityProfiler

requirement

  • 2019.4 or newer.

reccomend

  • the platforms that supports System.supportsAsyncGPUReadback (Mobile vulkan or metal....)
    Support sync readback from 1.1.0 , however it's very slow....

install

via OpenUPM (requires openupm-cli).

openupm add com.utj.screenshot2profiler

how to use

1.Initialize.
Place the "ScreenShotProfiler.prefab" to the scene.
ScreenshotToUnityProfiler
(You can customize the settings at Inspector.)

or callling this method to Initialize. UTJ.SS2Profiler.ScreenShotToProfiler.Instance.Initialize();
or
UTJ.SS2Profiler.ScreenShotToProfiler.Instance.Initialize(w,h);
( w,h means recording texture size).

2.call "Tools -> ProfilerScreenshot" from Menu.
And then window will be displayed.

Capture specific image instead of ScreenCapture

This is a sample that use RenderTexture instead of ScreenCapture.

RenderTexture captureRenderTexture;

ScreenShotToProfiler.Instance.captureBehaviour = (target) => {
    CommandBuffer commandBuffer = new CommandBuffer();
    commandBuffer.name = "ScreenCapture";
    commandBuffer.Blit(captureRenderTexture, target);
    Graphics.ExecuteCommandBuffer(commandBuffer);
};

Whole Sample Code

change

version 1.3.0
  Add custom ProfilerModule for Unity 2021.2 or lator.

version 1.2.1
  fix release build error 

version 1.2.0
  fix NullError when there is no data in Profiler.
  add Texture compress option.
  add RenderTexture capture instead of Screenshot.
  add "ScreenshotToUnityProfiler.prefab"

version 1.1.0
  add sync readback option for gles.

About

No description or website provided.

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%