• Advertisement
Sign in to follow this  

when occurs the perspective correction in directx pipeline ?

This topic is 3026 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

1. the perspective correction occurs when tex2D ? 2. or when coming into pixel shader ? so all value coming from TEXCOORDn is corrected related to linear interpolation ? 3. in rasterization , perspective correction occur to TEXCOORDn value ? i searched for the doc about that , but i cant

Share this post


Link to post
Share on other sites
Advertisement
Values coming out from vertex shader are interpolated with perspective correction and fed to pixel shader. Any data in PS is already "perspectively correct".

Share this post


Link to post
Share on other sites
perspective correction work well for texture coordinate (u,v)
cuzo the (u,v) is linear to (x,y,z) in world coordinates.

but if one value is not linear to (x,y,z) in world coordinates.
and the value comes from vertex shader,then the the interpolation of perspective correction is wrong method for the value.
if the value is interpolated correctly by the spherical interpolation or dual quaternion,
what can i do for the value to be correctly interpolated ?


Share this post


Link to post
Share on other sites
If you need other than linear interpolation you'll have to correct somehow the values. For example linearly interpolating normals will give you non-normalized vectors. You can normalize them in the pixel shader to correct them (a bit). If you need some special interpolation you can use additional texture as a lookup (linearly interpolated value -> correct value). Normal maps can be thought of as a case of this approach.
Anyway, I don't think there's any general way of handling arbitrary interpolations.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement