Vertex coordinates as verterx program output

hello, all
suppose i output vertex coordinates (x, y, z) in vertex program to fragment program in cg, and i want each fragment can have an attribute: containg a vector signify this fragment’s real current positons’ coordinates in world coordinates system . does it work?

Passing the vertex position from the vertex to the fragment shader will have the rasterizer linearly interpolating it and producing the fragment correct (x y z) world, object or camera space position depending on how you handle your things.
For the transfer operations, you can use varying variables or a spare texture interpolant.

big thanks

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.