A better way to handle texture scale/cache
|
06-20-2014, 07:46 PM
Post: #6
|
|||
|
|||
RE: A better way to handle texture scale/cache
The problem is, consider a game using the texture you screenshoted above. I have seen tons of games use textures like that for 3d models.
In that case, it's obvious (to a human) that the entire texture is actually a texture. Hashing the whole thing is right. Here's what happens if you don't hash the whole thing: 1. Game uses top half of texture, ending 50% into texture Y. 2. We calculate the hash as 5123456. 3. Game later (after using another texture, maybe) uses the other half of the texture (going as low as you showed.) 4. Now we see its sizeInRAM as different, so even though the data is identical, we calculate the hash as 2344576. 5. We reload the texture into OpenGL unnecessarily. 6. Go back to 1, where we will again reupload. This would kill framerates. At best, it would need to track the highest value used in the texture recently. Even then, it will slow down the initial draw of screens (like we saw with Type-0 recently) since it would re-upload textures like I described above for the first frame. In my example, I meant that texture replacements would say how many bytes of RAM they thought the texture is, therefore allowing the issue to be worked around manually. The same address can and definitely is used for completely different textures. The only way we get any sort of unique id right now is by hashing it. -[Unknown] |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
A better way to handle texture scale/cache - RadarNyan - 06-18-2014, 10:37 AM
RE: A better way to handle texture scale/cache - [Unknown] - 06-18-2014, 05:25 PM
RE: A better way to handle texture scale/cache - Henrik - 06-18-2014, 10:01 PM
RE: A better way to handle texture scale/cache - [Unknown] - 06-18-2014, 11:04 PM
RE: A better way to handle texture scale/cache - YaPeL - 06-23-2014, 01:27 PM
RE: A better way to handle texture scale/cache - RadarNyan - 06-20-2014, 06:34 PM
RE: A better way to handle texture scale/cache - [Unknown] - 06-20-2014 07:46 PM
RE: A better way to handle texture scale/cache - RadarNyan - 06-21-2014, 07:52 AM
RE: A better way to handle texture scale/cache - Arborea - 06-23-2014, 02:20 PM
RE: A better way to handle texture scale/cache - RadarNyan - 06-23-2014, 07:54 PM
|