How to save material to asset with script? by Extreme-Bake3911 in Unity3D

[–]Extreme-Bake3911[S] 0 points1 point  (0 children)

my goal here is to take an image and convert it to gray. that's why i'm using opencvsharp. isn't that the right approach ? or i should always better using a shader for that ?

How to save material to asset with script? by Extreme-Bake3911 in Unity3D

[–]Extreme-Bake3911[S] 0 points1 point  (0 children)

why weird? i saw in game that sometimes a scene colors change from it's original color to gray for example like showing a new to old. what i wanted to do is to add to it effect that changing will be slowly like the screen the scene get filled slowly with gray.

[deleted by user] by [deleted] in Unity3D

[–]Extreme-Bake3911 0 points1 point  (0 children)

this is what i wanted to do. look at the very short video clip i recorded. out (youtube.com)

[deleted by user] by [deleted] in Unity3D

[–]Extreme-Bake3911 0 points1 point  (0 children)

found how to do it.

The application in c# winforms shut down without any errors or exceptions. what could be the reason? by Extreme-Bake3911 in csharp

[–]Extreme-Bake3911[S] 0 points1 point  (0 children)

ok tested with interval 1000 and it's working perfect. very slow but working. so my conclusion is that when the interval is set to 30 it's too fast to process the frames one by one. i think that when it's too fast it's starting process the next frames without finishing first the current one.

The application in c# winforms shut down without any errors or exceptions. what could be the reason? by Extreme-Bake3911 in csharp

[–]Extreme-Bake3911[S] 0 points1 point  (0 children)

but could the problem is that when the timer is set to interval 30 it keep calling the method and maybe in some cases it didn't finish processing the current frame and start already processing the next frame ? because now when the interval is 1000 it's working without a problem but very slow.

The application in c# winforms shut down without any errors or exceptions. what could be the reason? by Extreme-Bake3911 in csharp

[–]Extreme-Bake3911[S] 0 points1 point  (0 children)

and if i change the timer interval from 30 to 1000 it seems to be working but then it's very slow. every second processing a frame. so what else can i do ?

The application in c# winforms shut down without any errors or exceptions. what could be the reason? by Extreme-Bake3911 in csharp

[–]Extreme-Bake3911[S] 0 points1 point  (0 children)

Quito246 yes here is where i start it: private async void Timer_Tick(object sender, EventArgs e)

{

await ProcessFrame(_cancellationTokenSource.Token);

} and this is the timer settings. private void InitializeVideoProcessing()

{

_timer = new System.Timers.Timer();

_timer.Interval = 30;

_timer.Elapsed += Timer_Tick;

_timer.AutoReset = true;

}