Code Monkey home page Code Monkey logo

akvfx's Introduction

Akvfx

gif gif

Akvfx is a Unity plugin that captures color/depth data from an Azure Kinect device and converts them into attribute maps (textures) handy for using with Visual Effect Graph.

System Requirements

  • Unity 2019.3
  • Azure Kinect DK

See also the System Requirements page of Azure Kinect DK. Note that Akvfx doesn't support Linux at the moment.

How To Install

This package uses the scoped registry feature to resolve package dependencies. Please add the following sections to the manifest file (Packages/manifest.json).

To the scopedRegistries section:

{
  "name": "Unity NuGet",
  "url": "https://unitynuget-registry.azurewebsites.net",
  "scopes": [ "org.nuget" ]
},
{
  "name": "Keijiro",
  "url": "https://registry.npmjs.com",
  "scopes": [ "jp.keijiro" ]
}

To the dependencies section:

"jp.keijiro.akvfx": "1.0.4"

After changes, the manifest file should look like below:

{
  "scopedRegistries": [
    {
      "name": "Unity NuGet",
      "url": "https://unitynuget-registry.azurewebsites.net",
      "scopes": [ "org.nuget" ]
    },
    {
      "name": "Keijiro",
      "url": "https://registry.npmjs.com",
      "scopes": [ "jp.keijiro" ]
    }
  ],
  "dependencies": {
    "jp.keijiro.akvfx": "1.0.4",
    ...

akvfx's People

Contributors

keijiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akvfx's Issues

Cannot load into Unity 2019 from package manager

(Sorry for my poor skill of programing and using github)
I want install Akvfx into my Unity Project.
I added the Akvfx package from Unity Package Manager.
I have changed the package manifest depend on the guide.
*I tried the Unity version 2019.2.2/2019.3.14/20193.15/2019.4.2
Error message of Unity is the below.

Cannot perform upm operation: Unable to add package [file:G:/HoloLens/Akvfx-master/Packages/jp.keijiro.akvfx]:
  Package jp.keijiro.akvfx@file:G:\HoloLens\Akvfx-master\Packages\jp.keijiro.akvfx has invalid dependencies or related test packages:
    org.nuget.microsoft.azure.kinect.sensor (dependency): Package [[email protected]] cannot be found
    org.nuget.system.memory (dependency): Package [[email protected]] cannot be found [NotFound]
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

How can I install the package to Unity?

'ReadOnlySpan<>' could not be found

Hi
sorry, do i missing something? im getting this two errors.

Assets\Akvfx-master\Assets\Akvfx\Internal\XYTable.cs(19,16): error CS0246: The type or namespace name 'ReadOnlySpan<>' could not be found (are you missing a using directive or an assembly reference?)

Assets\Akvfx-master\Assets\Akvfx\Internal\ThreadedDriver.cs(40,17): error CS0246: The type or namespace name 'ReadOnlyMemory<>' could not be found (are you missing a using directive or an assembly reference?)

thank you

XR Plugin Management Support

Using the Test scene, as soon as the XR Plugin Management package is installed, I receive error CS0246:

C:\Program Files\Unity\Hub\Editor\2019.4.1f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\InputField.cs(1798,17): error CS0246: The type or namespace name 'Event' could not be found (are you missing a using directive or an assembly reference?)

Using LWRP / AssertionException: Assertion failure. Value was Null

Hi, VFX Graph should be compatible with LWRP, correct?
When I change the project to LWRP, I get "AssertionException: Assertion failure. Value was Null".
Is there a way to run the project on LWRP (or, my real goal is to run it on Hololens2, is it possible you think?)

Edit: I got it workking!

  1. Followed this step (changing the VFX path to LWRP) https://www.youtube.com/watch?v=UhnedxxM81Q
  2. Replaced the main camera
  3. Recompiled the VFX shader

Unity Editor crashes on script recompilation while playing

Hi Keijiro.

It seems that changing any user script while the player is running will cause the Unity editor to crash or hang until the kinect device is disconnected. I think this is something to do with the disposal and rejoining of the kinect driver thread, probably as it is still accessing a native plugin? Unfortunately my c# threading / GC knowledge is fairly limited so I cant immediately see what is wrong with the current code / method.

To reproduce crash:

  • make a new empty c# script / monobehaviour
  • run the app
  • make a minor change to the script file and return to the editor.
  • Editor crashes or hangs until the azure kinect is disconnected from the computer.

This happens regardless of the user settings for player behaviour on script changes.

unity 2019.3.14f1

documentation for creating effect

Hello,
Is there any documentation on how to create a new effect? I'm having trouble using the VFX property binder to set the value of particle positions. Thanks

Is it real-time or rendering from a recorded data?

Hi, this project is so awesome! I'm quite interested in it!

I'm wondering if this is real-time with an Azure Kinect or it's just rendering from a recorded RGB/depth data?

And I'm also very interested in the VFX that from your projects Skinner/Smrvfx/DkvfxSketches that have more fancy particle effects. So are they using a similar framework and possible to have those VFX here?

Running Multiple Sources Simultaneously

Hi Keijiro,

Great plugin! This may not be an issue, I may just be doing something wrong, but is it possible to use multiple sources simultaneously for multiple vfx renders? When I try running two mkv recordings, it keeps swapping the textures between the sources. Might just be a limitation so figured I'd ask.

Thanks!
Ian

Issue importing to 3rd party project

Hi @keijiro

We are trying to import the unity package exported from this project. and at the same time added the following to our manifest.json

{
  "scopedRegistries": [
    {
      "name": "Unity NuGet",
      "url": "https://unitynuget-registry.azurewebsites.net",
      "scopes": [
        "org.nuget"
      ]
    },
    {
      "name": "Keijiro",
      "url": "https://registry.npmjs.com",
      "scopes": [
        "jp.keijiro"
      ]
    }
  ],
  "dependencies": {
    "jp.keijiro.kino.post-processing": "2.1.15",
    "jp.keijiro.klak.motion": "1.0.1",
    "jp.keijiro.metamesh": "0.0.6",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.uielements": "1.0.0"
  }
}

We are testing with an empty project on unity 2019.4.8f1
all game objects in the Test.scene looks fine in the inspector. But the point cloud was not rendered. No error in the console.

The same setting works fine in the direct clone of this project, and we have made sure our kinect azure functions well in the kinect viewer app.

Please help.

Chang

Reading only color frame

Hello,
Great asset, works very well but can you guide me how can I get the 2D camera color image inside the vfx graph. Here it computes the depth frame and depth color frame. I just want a normal color frame with no depth. How can I compute that. Is is even possible? Sorry I am not very good with shaders. Any help will be much appreciated.

Regards,
Zubair

Need help with running

Hi,

Thanks for sharing.
I am having issues with running it. Can you share some more information on how to use it?

This is what I am currently doing.
I downloaded the git folder and opened in Unity 2020. Got three errors-

  1. InputField.cs(1628,40): error CS0246: The type or namespace name 'Event' could not be found (are you missing a using directive or an assembly reference?),
  2. error CS0246: The type or namespace name 'Event' could not be found (are you missing a using directive or an assembly reference?),
  3. InputField.cs(1628,40): error CS0246: The type or namespace name 'Event' could not be found (are you missing a using directive or an assembly reference?)

Also, none of the scripts are loaded.

I tried 'Reimporting All' , changing Event to UnityEvent / UnityEngine.Event in InputField.cs (that removed above errors but started showing several other errors in InputField.cs eg. InputField.cs(1230,24): error CS0103: The name 'GUIUtility' does not exist in the current context
), removed Packages (with manifest file) folder for unity to regenerate it (it removed above errors but nothing happens when hit run command in Unity).

I am comparatively new to Unity and thus, any insights on how to try out your code will be highly grateful.

License ?

Hello keijiro. Thanks a lot for this, very curious to play with this!
But, any chance you could add a license file to this as well as you have for rsvfx ?
Thanks!

All audio related components gone in Unity?

In this project, I can't get any audio to work. All audio related components are basically missing, for example there is no audio tab in the components menu, no audio listener can be added to the camera and in scripting also AudioSource is not recognized. What could be the reason for this?
(Other than that this is an awesome repo)

Changing camera field of view

Moving this question over from AKVJ.

Looking for a way to set the Azure Kinect to 120 degree FOV, found this bit here in ThreadedDriver.cs:

new DeviceConfiguration
{ ColorFormat = ImageFormat.ColorBGRA32,
ColorResolution = ColorResolution.R1536p, // 2048 x 1536 (4:3)
DepthMode = DepthMode.NFOV_Unbinned, // 640x576
SynchronizedImagesOnly = true });

Along with these settings here:

public static int ImageWidth => 640;
public static int ImageHeight => 576;

When I try to match what should be the WFOV_2x2Binned or WFOV_Unbinned settings with the ImageWidth and ImageHeight I either get a device error or it will start up but I get some pretty bad lines across the VFX graph effects.

My question is are there more settings that I haven't found yet, or is there another way to set the field of view?

Error running test

Trying to get this setup. I'm running into the same issue as others have reported:

"error CS0246: The type or namespace name 'Event' could not be found (are you missing a using directive or an assembly reference?)"

However, none the other fixes seem to work. I'm using Unity 2019.4.5f1 and tried restarting Unity after installing the XR Plugin Manager. Tried cloning the project again - no luck.

Any suggestion on what to try?

Error while upgrading project to 2022 and above

There is an error with regards to the unity engine video (Using UnityEngine.Video) library and the project does not run and throws an error saying that VidoePlayer namespace could not be found.

Please let me know if there is an possible fix as I would love to run this project on 2020 and above version of Unity.

Unity NuGet not available

Thank you for your work Keijiro-san,

This dependency link doesn't seem to be available. Is there any other source where I could obtain the package in order to be able to use your repository?

{
      "name": "Unity NuGet",
      "url": "https://unitynuget-registry.azurewebsites.net",
      "scopes": [
        "org.nuget"
      ]
    }

Thank you.

DllNotFoundException: k4a

Am just running the project as-is from your repo, and I get this error. Do I need to build the Azure Kinect SDK on my machine?

Kinect Error

Dear Keijiro
Working on this error whole day still haven't find solution , try both 2019.3.5 / 3.9 / 4.8
Error: Could not load signature of Microsoft.Azure.Kinect.Sensor.Allocator:GetManagedAllocatedMemory due to: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. assembly:System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 type: member:(null) signature:

See the screenshot belowed
qwe
:

When I try to open the project I got an error window.

When I try to open the project I got an error window.
I open the project in Unity 2019. 3. 14f1.

when I open the project at first I got this error window.
image

when I click continuew button, I can see the below errors on the console.
image

I wonder how can I solve these problems.

Crop image in X and Y axes

Hi @keijiro, thanks for sharing your work, it's really good experimenting with Kinect Point Cloud !

I'm looking to remove some points from the DepthMap based on a crop in the image, how would you recommend doing this ?

enabling recorder

Ola!
I can't seem to be able to install the recorder whilst in this project. I am trying to install the 2.5.5 version, which I could install on a new project in Unity 2019.4.8f1.
When I am in this AKVFX project and try to install recorder, it gives me this red message "Library\PackageCache\[email protected]\Runtime\Audio\AudioTrack.cs(29,40): error CS0246: The type or namespace name 'AudioClip' could not be found (are you missing a using directive or an assembly reference?)"

Does anyone know how to resolve this issue and enable the recorder for this, please?

How to install

This project looks like a fantastic jumping off point for Azure Kinect dev in Unity. Unfortunately, I am not sure how to install your files to get it working.

Could you provide a couple pointers?

502 Error

Hey, thanks for the awesome work! When I open the project, I am having a problem with resolving dependencies. I'm getting a 502 error. My Azure Kinect is working on my computer. I have the correct Unity version 2019.2.2f1.

Here is what happens when I open the project:
UnityErrorWhileOpeningProject

And this is what happens when I try and look at the Package Manager UI:
PackageManagerError

Any idea what is going on?

ComputeBuffer SetData(ReadOnlySpan<byte>) causes error

Hi Keijiro, firstly thanks for everything you give to the Unity community, secondly this may not be a direct issue, but more of a curiosity / issue i am facing:

I see that on line 115 of Runtime/DeviceController.cs you use:

_colorBuffer.SetData(color.Span);

to upload the image data to the compute buffer. I have been trying to use a similar technique to get kinect data onto the GPU (outside this package). I have all the Kinect libraries linking and devices opening fine but Unity (2019.3.14) will not allow this variation of ComputeBuffer.SetData causing an error:

cannot convert from 'System.ReadOnlySpan' to 'System.Array'

Could you please shed some light on how this code executes fine from within the package but causes an error from a script outside the package (in a new project). Is this a mismatch in Unity / c# versions, or something to do with assembly compilation that I need to learn more about? Or if not how I can use a similar method to get the API 'Image' capture data into Unity Textures / Buffers without performing an expensive Span.ToArray() call which copies all the data.

Any help would be appreciated.

Multiple Devices?

First of all, superb! Thanks!

Can this plugin be set up to support two Azure Kinect at one time? How?

Older Kinect Compatibility

Hi, I've got a question as to whether this will only work with Azure Kinect as compared to older Kinects?

And if it doesn't, what work would need to be done to get it up and running on older Kinects?

Getting point cloud soup when streaming textures

Hey @keijiro ,

I'm trying to use your setup with FMETP to stream the two point cloud textures over the network, and getting some distortions when trying to process the textures. A regular VFX Property Bind drawing from the Kinect produces results per spec, but when pulling it over the network produces oddities as illustrated in the screenshot from the Client (so this just receives data, no feed).

Bind

The script I used is a mod of your VFXPointCloudBinder, just drawing Texture components from a Decoder instead of the Kinect device. LMK if you need any more info. Nothing wrong with your current project, but figured you might shine some light on what's going on here. Thanks for the package.

Potential Bug in Akvfx.compute?

I've been using Akvfx as the basis for supporting Windows Kinect V2 and was puzzled by this line in Akvfx.compute.

// Buffer index
uint idx = (577 - id.y) * 640 + id.x;

I cannot work out why its using 577 for the number of rows from the depth image?
Either I'm missing some other purpose in the shader or perhaps its just a typo?

As the depth image from Azure Kinect is 640x576 and I assume id.y goes from 0 to 575 should it be

uint idx = (575 - id.y) * 640 + id.x;

I.E the height of the image - 1 to account for id.y being from 0 to 575.

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.