PDA

View Full Version : Color conversion of mesh-vertex colors ...



Christoph
10-13-2002, 09:22 PM
Dear All,

I was wondering if the color matrix in OpenGL can also be used for color conversion of mesh-vertices (I want to do image-based rendering, using line, resp. triangle strips for image resampling and the images that are to be "warped" come from an MPEG decoder, they are therefore YUV 4:2:0)? Or can it only be used with images? If it can't, is there another fast way to convert colors of vertices?

Best regards

Christoph

Dodger
10-14-2002, 10:08 AM
Interesting idea. I'd say the color matrix will not provide the functionality you're looking for, but a vertex program should be able to do what you need, and may even be faster than a cpu implementation, depending on the VP implementation, the hardware and the tesselation of your mesh. Are you wanting to replace each pixel of the stream with a vertex of the color found in the stream?

Christoph
10-14-2002, 08:30 PM
Originally posted by Dodger:
Interesting idea. I'd say the color matrix will not provide the functionality you're looking for, but a vertex program should be able to do what you need, and may even be faster than a cpu implementation, depending on the VP implementation, the hardware and the tesselation of your mesh. Are you wanting to replace each pixel of the stream with a vertex of the color found in the stream?

Yeap, that's what I'm doing. I'm actually doing this for a 3D-TV project, where the two views are created at the receiver side from video + depth by means of image-based rendering. That means I need to render two 720x576 images @ 25 fps. This is a lot of work for the resampling, that's why I wanted to use the graphics card (GeForce4 Ti 4600).

Dodger
10-15-2002, 07:35 AM
So that's a mesh of a little over 400K verts... hmm. It may be a little too much to handle depending on your GPU (definitely look into NV_vertex_array_range and ATI_vertex_array_object for a static meshe of that size).
Where are you getting the depth from, and do you need that kind of tesselation for what you're wanting to do?

[This message has been edited by Dodger (edited 10-15-2002).]

Christoph
10-15-2002, 08:20 AM
Originally posted by Dodger:
So that's a mesh of a little over 400K verts... hmm. It may be a little too much to handle depending on your GPU (definitely look into NV_vertex_array_range and ATI_vertex_array_object for a static meshe of that size).
Where are you getting the depth from, and do you need that kind of tesselation for what you're wanting to do?

[This message has been edited by Dodger (edited 10-15-2002).]

You get depth information either from a special depth camera or by 2D-to-3D conversion of a regular 2D video. I already had a look at the NVIDIA extensions, but they don't seem to help a lot for dynamic meshes. I still hope that my graphics card will be powerfull enough. I'm currently at about 50 to 60 ms. So only a factor of 1.5. Cheers Christoph.

Dodger
10-15-2002, 11:09 AM
Well... if we're talking 400k triangles at 20 fps, that's 8 MTris/sec which is not too shabby (what kind of graphics card are you running this on?).

Are you displacing the vertices of the mesh depending on the depth information that you're getting? If so, a lower tesselation than 1 vert per pixel may be sufficient (may even look better since it would reduce potential noise from the depth input).

If you could theoretically turn the tesselation of the mesh down, but need the color conversion to happen per-pixel, maybe a fragment shader could do the color conversion?