RE: [Algorithms] Hash function and cache implementation
Brought to you by:
vexxed72
From: Marcelo A. C. <ca...@es...> - 2003-07-02 14:28:23
|
> Maybe a quick crc32/16? > Or... The sum of the first 3 pixels%something? Two options worth trying. I will do some reserch on CRC. Never played with it so it may be a good opportunity to learn more about the subject. The second option seems to offer the best cost to beneffit ratio, though. --camelo ---------------------------------- Peace and love, Tweety mi...@bb... - twe...@us... YahooID: tweety_04_01 > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...] On > Behalf Of Marcelo A. Camelo > Sent: Tuesday, July 01, 2003 4:41 PM > To: gda...@li... > Subject: [Algorithms] Hash function and cache implementation > > > Hi!!! > > I'm about to implement a cache for my terrain textures and I could use > some help on choosing an appropriate data container and hash function > for cache look-up. > > Some specific information about the problem: > > I'm working on a terrain engine that uses textures much like warcraft > III, using tiny tiled textures (32x32 pixels) at the quads level. Each > tile is built on-the-fly, using the texture type information stored on > each of its four vertices (yielding c_tile_types_count^4 individual > tile textures). > > To speed-up rendering, I group tiles in patches of size 8x8, > as they are > needed (rendering them to a new texture). This texture is > what I want to > cache. > > The key to my cache should be derived from the tile data in > each vertex > used to render the texture, plus the desired level of detail. The tile > data is an array of unsigned chars [of dimension > (c_patch_size + 1)^2], > although each entry is usually in the range [0,3] ([0,7] in the worst > case). The LOD is also a char within those ranges. Any ideas on a hash > function I can use? > > If I were not limited to the MSVC6 stl, hash_map would be my first > option for the cache container but, unfortunately, I'm stuck to it. > I've found an stand alone implementation of the hash_map container > called my_hash_map > (http://www.csua.berkeley.edu/~emin/source_code/hash_map/index.html) > which I'll be evaluating. May save me some time. Any > suggestions on this > area? > > --camelo > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_06 1203_01/01 _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 |