PDA

View Full Version : sampling extra texture in fp boosts performance !?!



Undertaker
04-29-2005, 12:18 AM
Two shaders - one only uses a texture and it`s normal map for lighting calculations ( point lights) and the other uses the same 2 textures + an extra texture( doesn`t matter what texture...let`s say cube map )

Well the second shader goes faster with about 70 fps ( from 100 to 170 ) ... I don`t even use the third texture, I only sample it....

The 2 shaders are EXACTLY the same, only the second one has an extra
TEX tex, fragment.texcoord[2], texture[2], 2D;(or3D , same result)
But it goes almost twice as fast !!

What`s wrong ??

tamlin
04-29-2005, 03:50 AM
My first guess would be bad, to the point it could be considered broken, compiler.

Presenting more details, such as what language/profile/card/drivers used could help in hunting down this problem.

Jan
04-29-2005, 04:38 AM
Yeah, i experienced the same thing, but not that extreme.

If i use specular lighting, my app becomes faster than if i disable specular lighting. Although i donīt sample any more textures, it's only more ALU instructions.

That's with ARB_fragment_program on a Radeon 9600XT, latest drivers. But the difference is not that huge, maybe 5%, so i didn't bother about it.

Strange, though.

Jan.

Undertaker
04-29-2005, 09:13 AM
I use GL_ARB_fragment_program
radeon 9800 pro, catalyst 5.3 drivers

Even sampling a 1x1 texture results in a perf boost !

I can post a demo if you want...