Is dds image file format a lot faster for cgfx shaders?

Hello, I’ve been told that dds may boost some huge performance improvements in cgfx shaders.

I’ve been using cgfx shaders in Maya for my pipeline for a while, but am not quite pleased with the performance. Currently I make use of tga files as the textures feeding my custom fx shaders. tga are the base image format for our pipe, but we can always convert to them in the end.

I’m thinking of converting the pipeline (at least in Maya) to using dds instead of tga on fx shaders. This is a lot of work, so just thought I’d get some ideas from anyone who may have some experience using dds before, or made any comparisons for using them over other image formats in cgfx shaders?

Thx for any feedback.

I experienced some major performance gains in one test case when I switched from tga to dds. I haven’t used this in production - just one particular scene - but the increased performance in the test was well worth the conversion.

I think that the speed-up may have been due more to the fact that the textures were compressed in dds. I don’t think you’d get any performance improvement from uncompressed dds files. Smaller file sizes = less memory bandwidth = better performance. That’s the theory anyway.

I did my test in 3ds Max, so your results in Maya may be different. I’d recommend that you pick a texture-heavy scene, convert all the textures to compressed dds and measure performance gains against the original.

Welcome to www.coverallchance.compatio furniture,outdoor furniture,wood furniture,garden furniture,dog house,furniture,wood,outdoo,patio,cedar,bench,gardenOutdoor Furniture,Teak Furniture,Wood Furniture,Porch Swings,Garden Bench,Garden Furniture,Wooden Furnitureoutdoor wood furniturediscount outdoor furnituremetal outdoor furniturepool furnitureoutdoor bar furnitureiron outdoor furniturewicker furniturewalmart outdoor furnituredoor furniturepatio furniturechairs

凑齐了四个人之后,[b]昆明机票[/b]两个航班在五分钟内,相继准点起飞,开始了这场漫漫旅途。 在快要降落昆明的时候,飞机飞过了著名的东川红土地,[b]昆明特价机票[/b]从空中俯视这一块五彩斑斓的土地的时候,除了感叹还是感叹,感叹这真的是上帝不小心打翻在人间的调色板。 没过多久两架飞机先后都降落在了巫家坝机场,没费多大劲就和小葛重新会合了,[b]昆明机票[/b]打车去车站买了下午往丽江的车票。还剩下点时间来不及去滇池了,只能在吃上面圆我的昆明之梦了,那就是吃一碗昆明的过桥米线。在车站附近找了一家看上去还有点样子的饭店,点了一碗过桥米线,不过味道实在不敢恭维,过桥米线迄今为止,还是当年读大学的时候,在嘉定吃过的那家店最棒。 吃完后就准备坐车去丽江了,此去丽江路途遥远,我很担心那两个mm的身体,[b]昆明特价机票[/b]因为这两位全是晕车的主,而且又从来没坐过这么长时间的长途汽车,一路上还真替她们捏了把汗。汽车在大理停了一会,吃了顿晚饭,司机说这是免费的,大家都很高兴,但是来到了偌大的大理石餐桌上一看,每桌只有两菜一汤一盆饭,每桌十人,真让人厥倒,这是喂鸡还是吃饭呢。 吃完饭后继续上路,那两个mm继续倒头就睡,也不知道她们怎么那么能睡[b]昆明机票[/b],我就边看书边和先锋部队联系接头。快到十一点的时候,终于在夜色中抵达了丽江古城,前来接车的vici已经等在大水车那里了。我们四个一脸疲惫和倦色,死气沉沉的跟着后面走,七绕八绕来到了住处。没过多久,ivy和丁丁也回来了,至此,七剑终于会齐了。简短的讲了下明天的计划后,宣布睡觉,由于昨天晚上只睡了两个小时,今天一天又是飞机又是汽车,累得实在够呛,很快我就在古城丽江昏昏睡去,尽管我连丽江的模样都还没来得及看清。

DDS is only a container format like AVI etc.

DXT is the compression format commonly used inside DDS files because hardware supports it and its much faster to read than uncompressed 32bit textures.

It may or may not improve performance depending on the content on your scene and which graphics card you are using. How many textures and at what size etc.

We generally keep our data uncompressed because we may decided to compress it in different ways for different platforms and also artists don’t want to do the conversion every time they change a texture.

I have thought about making a proxy system that could replace your textures with “cheaper” versions, but I haven’t got around to trying that.
Max has a bitmap proxy system, but it only works with software materials.

In MAx you can switch between using the render materials instead of dx9 materials, this gives some improvement in speed.

DXT can be UGLY, in that you can get very bad results.

Thanks for the info guys. So if I understand this right, the performance is really from reducing the memory band-width piping to the card on each draw call? This is assuming of course, that the texture-uncompression overhead is negligable and all handled by the card?

I’m not sure how cgfx is implemented in Max, but in Maya they seem horribly cpu-bound. Meaning 10 shader instances shall produce 10x the slowness. Regardless of how they’re assigned to geometry (even if they’re not assigned to geo they’ll compute)! Thus, I’m trying as hard as possible to speed this up as best as I can, using dds shall hopefully help.

Also, I have a strong suspicion that the textures in my shader (currently using tga) are not actually cached and loaded each time the shader evaluates. I’m hoping by using dds, that this forces the shader to not have to keep on re-loading the texture every time.

I think DXT is also faster due to the fact that the textures are swizzled, and modern graphics cards draw batches of pixels in small quads, so the memory and cache coherency are much better. But this is at the extreme performance end of things - the likely speedup will just be the better memory bandwidth.

[QUOTE=IAmTheWalrus;4134]I’m not sure how cgfx is implemented in Max[/QUOTE]

Poorly.

You can’t do half the stuff with CGFX you can normally do with it.It is really a bare bones implementation.

HLSL is implemented much better in max.

Still, both are a lot (!!) slower in the max viewport then what you get in a game engine though.

The biggest speed improvement I’ve seen in Max is to compile the shader with FXC and use assembly instead of HLSL. It was a little cumbersome to maintain, but it did improve the speed. This was back on Spider-man 3. Since then I haven’t needed to do that. Maybe it’s due to improvements in Max’s HLSL support or maybe it’s just because we’re using faster machines these days.