no texture wrapping with samplelevel in hlsl?
Posted 28 November 2012 - 10:55 PM
finally got my loops to not unroll in the shader and now ive got a problem that it only lets me use samplelevel, and sample level doesnt seem to work with texture wrap over!!!! is this right?
Im trying to raytrace some fractal noise, is there any solution to my problem?
Posted 29 November 2012 - 01:24 AM
Posted 29 November 2012 - 02:00 AM
You're not getting proper mipmapping this way, of course. You would need to do the texture lookup outside the loop in order for it to work. Regular texturing implicitly uses the UV derivatives to select the mip level. It seems you cannot take derivatives inside a loop or branch...that kinda sucks, but it's understandable. The hardware does derivatives by comparing values across nearby pixels, but if those nearby pixels might take a different execution path through the shader due to loops or branches, it doesn't have anything to compare to.
If you can calculate the UV derivatives yourself, you can use them with SampleGrad to get mipmapping back.
Posted 29 November 2012 - 07:17 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users