Real 3D (IMAX like) get pixelinformation from view

Posted By: HoopyDerFrood

Real 3D (IMAX like) get pixelinformation from view - 01/02/08 10:24

Hi, I made some experiments creating real 3D pictures, watchable with red/cyan glasses, with the A7. And more ore less I succeeded. The problem is once again the framerate. For creating a stereoscopic so called anaglyphic image I use pictures from two differnt views with a small offset between them. From each pixel of the views I take the colour information and calculate the colour of the pixel in the 3D view. Creating the picture pixel by pixel with "pixel_to_bmap" is not fast but this is not the problem. The problem is bring the two views in a format I can read from with "pixel_for_bmap" and "pixel_to_vec". First I displayd them on screen made a screenshot and read from this. This was really dumb and very slow. Now I render them both to one texture an read from this. The Problem is I have to do "bmap_to_format" first. And this is so slow I get only 2fps creating a 400x300 3D image. Converting the 800x300 texture containing the two views takes most of the time. Is there a faster way to get the colour of pixels in a view?

Here a 3D picture created with the A7 if someone is interested to try itself. Use glasses with a red colour filter in front of the left eye and a cyan colour filter in front of the right one to watch it.

Posted By: ello

Re: Real 3D (IMAX like) get pixelinformation from - 01/02/08 10:43

maybe you should use a postprocessing shader for this. i dont have sucha 3d-glass otherwise i'd already have tried it
Posted By: HoopyDerFrood

Re: Real 3D (IMAX like) get pixelinformation from - 01/02/08 11:09

I thought about a postprocessing shader, too. Unfortunately I'm not familiar with shader programming.

So if someone is interested in accepting this challenge please contact me. I for myself do this experiments not for one of my own Projects. Just to ceck what is possible with the A7 and provide this knowledge to the community. I'd glad if someone wants to join my research.

I made my glasses myself. All you need are two colour filter gels which cost about $1 each.
Posted By: ello

Re: Real 3D (IMAX like) get pixelinformation from - 01/02/08 11:50

Quote:


I made my glasses myself. All you need are two colour filter gels which cost about $1 each.




aint that problematic because you need somewhat normed colors to get it working? or else i could think of creating a panel where you can adjust the colors for the stereo image.
Posted By: HoopyDerFrood

Re: Real 3D (IMAX like) get pixelinformation from - 01/02/08 12:05

You need more or less normed colours, but they are easy to get. Just primary red (RGB: 255,0,0) and a Cyan (RGB: 0,255,255). Everywhere you get filter gels you also get some in these colours. And they don't have to fit absolute perfectly. Your brain is used to see 3D, if it gets information that looks like a stereoskopic view it creates a steroskopic view. And anyhow these cheap filters are not physical perfect. But they are absolut sufficient.

And its not good to change the algorithm becaue with these colours you can create coloured steoroscopic images (all colours exept red).
Posted By: Gumby22don

Re: Real 3D (IMAX like) get pixelinformation from - 01/08/08 03:12

Couldn't you create two VIEWPORTS on top of each other with a 50% transparency and a sum on the top one?

Don
have a great day
Posted By: HoopyDerFrood

Re: Real 3D (IMAX like) get pixelinformation from - 01/08/08 19:54

I've tryed this way first. But for good results you have do use this algorithm for each Pixel.

pixel = pixel_for_vec(vector(PixelColour2[0],PixelColour[1],0.7*PixelColour[1]+0.3*PixelColour[0]),50,format);

PixelColour1[0] = blue value first view
PixelColour1[1] = green value first view
PixelColour2[0] = blue value second view
PixelColour2[1] = green value second view

I tryed views with coloured objects in front of the camera, too. But I never get the same results like "filtering" the colour information with this formula.

For each pixel you have to take the blue and green value from one view and calculate the red value from the blue and green value of the other view. And so you get an partly colourd anaglyphic picture containing all colours except red.
Posted By: HoopyDerFrood

Re: Real 3D (IMAX like) get pixelinformation from - 02/21/08 23:06

Good news everyone!

Slin wrote a shader which is so simple, even I can understand. And it's so fast and effective that the small testlevel I created runs with full framerate at XGA resolution using this shader.

I try to write a tutorial about using it in the next time. And maybe I try to translate it into english, too.


Posted By: Felixsg

Re: Real 3D (IMAX like) get pixelinformation from - 02/27/08 20:29

You goes to publish the code?
or a demo with the source of that shader
working?
Posted By: HoopyDerFrood

Re: Real 3D (IMAX like) get pixelinformation from - 03/12/08 10:22

Yes, I want to publish everythig as soon as possible. But it may take some weeks before I can find the time.
If you need the code immediately, send me an email or contact me via ICQ.
© 2024 lite-C Forums