Question for the GPU coders out there: I have an R16 texture containing palette indices. What's the easiest way, in a pixel shader, to go from a texel in that R16 texture, to a U/V pair to look up the palette entry in a 256x256 palette texture?
-
Näytä tämä ketju
-
Assuming I can only use floats, and not integer types.
2 vastausta 0 uudelleentwiittausta 1 tykkäysNäytä tämä ketju -
Vastauksena käyttäjälle @TheMogMiner
Bind the texture as an R8G8 and point-sample. Then use those values as UV coords for the palette lookup (also point sampled). You'll need a bunch of magic offsets to make the point sampling robust - try 0.375
1 vastaus 0 uudelleentwiittausta 10 tykkäystä
Vastauksena käyttäjälle @tom_forsyth
Worked perfectly, thanks!
19.07 - 12. lokak. 2019
0 vastausta
0 uudelleentwiittausta
1 tykkäys
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.