Rendering DIB's

Hi all,

I’m currently working on an augmented reality application, used both locally and from a browser.

The webcam is send to unity over a socket connection from flash.

Everything works ok except that the performance is fast on this mac both local and inside the browser.

It is fast local and slow in the browser on a macbook.

and it’s always slow on the windows pc’s I have tested.

Fast is being able to send 50 fps.
Slow is 3fps.

When I check the profiler on this mac(the one that I develop on and goes fast) 58% if the time is spend on Texture2D.Apply();
This is because I receive a Bitmap(DIB) for every webcam frame and I have to render it.

It seems pretty realistic that this is also the cause of low performance on other computers.

In short, what other options are there for getting a webcam in unity or getting a DIB on the screen?

Thanks : )

-Bob

none cause you want to use the webplayer.

all users with weak gpus will have to wait the corresponding time to get it.

though on a webcam AR targeting anything higher than 30 isn’t realistic cause thats where many webcams pan out

what you need to work on is potentially the resolution cause 720p and higher input will pretty surely kill it on most systems, but going smaller will allow more systems to do it (or offer a quality option which you also auto adjust if you detect that they have no plan of anything and would dip around at 5 fps without you doing it)

A thought I just had,
Is it maybe possible to show an flv stream?
If it is I could try to get a AMF server running in unity and use NetConnection.AttachCamera in actioncript.

If this is possible, could I use the server part of fluorfx in a unity client?[/list]

Right ok, well I wasn’t targeting higher than 30fps really, just more than 3.

I already use a fairly low resolution, since the focus will be on the 3D anyway, and smoothing makes up for a lot, but it’s still slow.

I’m talking texture size here, does it matter how big the surface is that I render it on?
Or the size of the player?

could you define these things.

as for the “surface size to which it renders too”
depends on the hardware we talk about here. the weaker the hardware or the heavier the task you do (like using 3D rendering which will half the frames as each frame is automatically rendered twice once for each eye - be it through your work in unity or driver 3d support) the more sizes becomes impacting