michal wrote on 2010-02-05 11:05: > Brian Paul wrote on 2010-02-04 22:07: > >> michal wrote: >> >> >>> Brian Paul wrote on 2010-02-03 17:58: >>> >>> >>>> Keith Whitwell wrote: >>>> >>>> >>>> >>>>>>> Michal, >>>>>>> >>>>>>> why do you need this for linear interpolator and not perspective? I >>>>>>> think d3d mobile let you disable perspective correct texturing, but it >>>>>>> is always enabled for normal d3d. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> I could not think of a use case that uses perspective and cylindrical >>>>>> interpolation at the same time. If you think it's valid, we can >>>>>> implement cylindrical wrapping for perspective interpolator, but then I >>>>>> am not sure how exactly it should be done, i.e. should we divide and >>>>>> then wrap or the opposite? >>>>>> >>>>>> >>>>>> >>>>> Is there some way we can figure out what DX9 does here? Maybe a quick >>>>> test? >>>>> >>>>> >>>>> >>>> I suspect cylindrical wrapping would be done after the divide. >>>> >>>> >>>> >>>> >>> A quick test shows it is legal to have perspective and cylindrical >>> interpolation. In fact, I see no difference between projected and >>> non-projected version with REF device -- both are perspective correct. >>> >>> I think I am stuck at this point and need further help. I am trying to >>> modify tri_persp_coeff() in softpipe in a similar manner to >>> tri_linear_coeff(), but all I get are lousy rendering artifacts. If we >>> need do cylindrical wrapping after divide, it must be done as part of >>> shader interpolator, but the only place where we have enough information >>> to do wrapping is in primitive setup. >>> >>> >> Do you have a patch relative to gallium-cylindrical-wrap? I'll take a >> look. >> >> >> > Brian, > > I have no half-working patch for you, sorry. I tried a few approaches, > but they were nonsensical. > > The linear coeff calculation is simple: calculate distance between two > coordinates, and if it's greater than 0.5, apply wrapping by adjusting > the distance. > > However, for the perspective correct coeffs, we divide early by > position.w before calculating the distance, and so my approach that > worked for linear fails here. I am either not comprehending the math > here (why do we divide the second time in interpolator, for instance?) > or we need to put more information into struct tgsi_interp_coef so that > the interpolator code has enough information to do wrapping on its own > without help of primitive setup. >
OK, I managed to correctly implement cylindrical wrap in softpipe both for linear and perspective interpolation, both for lines and triangles. Tested with Brian's cylwrap test app -- it works. Please re-review. Thanks. ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev