I need help with CG fragment shaders. I have one big texture which holds all the tiles. I really don’t know where to start with this one.
Now when quad/sprite goes over certain size i would need to repeat texture as it was one single texture.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
0Matthias Wloka wrote a white paper on this topic when he was at NVIDIA:
https://developer.nvidia.com/sites/default/files/akamai/tools/files/Texture_Atlas_Whitepaper.pdf
It describes retrieval methods and contains some useful cautionary info about filtering/mip-levels
At its simplest, imagine that you have two textures side-by-side in an atlas.
Instead of reading
tex2D(sampler,UV)for the first texture, you would do something liketex2D(sampler,float2(frac(2.0*UV.x),UV.y))