Git Product home page Git Product logo

unity-webcamtexture-devices-issue-research's Introduction

WebCamTexture Devices Performance Issue Research

A separate unity project was created to investigate the WebCamTexture Devices performance issue. The objetive is to be able to display the connected devices every certain period of time. It is necessary to know if any device was disconnected.

Performance issue

A performance issue has been found in WebCamTexture.devices. To test the issue, it must be done using a build. With this build you will be able to analyse the performance issue from the Unity Profiler.

WebCamTexture-devices-performance-issue

Specs of the PC used

Device name	William
Processor	AMD Ryzen 5 3600 6-Core Processor                 3.59 GHz
Installed RAM	16.0 GB
System type	64-bit operating system, x64-based processor
Pen and touch	Pen support

Edition	Windows 11 Pro
Version	21H2
Installed on	25/06/2022
OS build	22000.978
Experience	Windows Feature Experience Pack 1000.22000.978.0

BaseBoard Manufacturer	ASRock
BaseBoard Product	B450M-HDV R4.0

Display name	Radeon RX 570 Series
Display driver version	30.0.13023.4001

Script

using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;

public class DeviceManager : MonoBehaviour
{
    void Start()
    {
        Debug.Log("DeviceManager Init");
        ShowDevices();
    }

    private async void ShowDevices()
    {
        while (true)
        {
            // https://docs.unity3d.com/ScriptReference/WebCamTexture-devices.html
            WebCamDevice[] devices = WebCamTexture.devices; // Performance issue

            for (int i = 0; i < devices.Length; i++)
                Debug.Log(devices[i].name);
            await Task.Delay(1000);
        }
    }
}

unity-webcamtexture-devices-issue-research's People

Contributors

germanfica avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.