Projection compensation


I want to project a movie onto a curved screen which could be modelled as an inner portion of a sphere. I want to do the geometry correction on the graphics card in real time and have a whole number of questions.

I have worked through the gpu morphing tutorial and it looks good.

What I think I need to do is start from a flat rectangular grid mesh that is textured using the movie. I then need to define the curved target mesh and write (?) a vertex shader to map between the two.

q1. How to get the input vertex buffer - I was looking at the grid nodes and Grid (DX9) is the one that takes the texture in. So what I want to is get the mesh out. However the output of the grid is a layer and not a mesh. The Grid (EX9.Geometry) outputs a mesh but I can’t see how to get the texture in.

q2. How to get the output vertex buffer - This is a similar to q1. I have been looking at the Sphere (DX9) node and it again produces a layer not a mesh. On top of this I’m not sure how I can isolate the target area of the sphere. The situation is that the projectors will be positioned about 10% of the radius from the top of the sphere and projecting onto the inner surface that is, from the point of view of the centre of the sphere, maybe 45 to 70 degrees from the vertical.

q3. Vertex shader programming - The tutorial was good but only touched the tip of the proverbial iceberg. I couldn’t find a decent reference on how to program the vertex buffers. Most of the links to the microsoft pages are out of date.

Any help would be very much appreciated.

at q3: can you point at the pages with outofdatelinks?

I’m not sure what that means.

it would be nice if you could tell joreg about wikipages with outdated links to the microsoft reference so he could fix them and help everybody else to find the info they need in the documentation (instead of having to ask in the forums).

you could use the Grid (DX9) node and distort the mesh using the ArbitraryPoint (Transform).
you could also use the Grid (EX9.Geometry) and distort the mesh by splitting it open with Mesh (Split) & VertexBuffer (Split) and joining it again afterwards.
to display the distorted mesh you will have to feed it into an effect/shader (like DrawFixed, Constant, Gouraud, Phong etc). the texture is also put into the shader.

see above; Mesh (Split) and VertexBuffer (Split) are the way to get these out of any EX9.Geometry
with a little help from CircularSpread (Spreads), you could deform a regular Grid (EX9.Geometry) to fit your projection surface.

i don’t think it is really necessary to program a shader for that kind of projection.

Great. Thanks for that.

I have something working. In the end I created a derivative of the Template node and put a “Grid (EX9.Geometry)” and a “Video Texture” into it. I do the morphing in the vertex shader (vs2ps VS) and manipulate the Out.Pos.y and Out.Pos.x values. Not very 3d I know but I am a coder at heart.

(I have been been looking for those broken links but can’t find them. I suspect they have been fixed. 8-) - next time I will definitely use the outOfDateLinks mechanism)