shaders in the hunk


(chavo_one) #1

Does anyone know how wolf stores shaders when a map is loaded? The reason I ask is because I have two different shaders that use the same texture. However, one of them uses the alpha channel of the tga and the other doesn’t. I’m wondering if replacing the tga with a smaller filesize jpg for the second shader would be more resource conscience than using the tga in both cases.

So does the game load all of the used textures into memory once and then have each individual shader reference the same memory address, or does each shader get it’s own block of memory?


(cloudscapes) #2

I believe textures even if used in many shaders are stored only once. I may be wrong though. But anyways even if the engine did store the same texture a few times, jpeg compression is irrelevant because the engne decompresses jpegs when storing them in video memory. A 256x256 30kb jpeg will use up the same amount of texture memory as a 256x256 190kb tga.