   rendering to texture is very slow
  Hi, I have a Geforce 6600 and I'm doing some shadow mapping tests. I noticed that rendering to texture induces a pretty big performace penalty. Is this to be expected or is a video board/DirectX specific problem?Thanks.   
  What performance difference are you noticing? How are you measuring the performance hit?   ;  I'm measuring the performance by FPS. It drops from above 300 to about 180. That is a 40% drop. And if I do multiple lookups in my pixel shader and blur the shadow map (another 2 render to texture operations) it gets to about below 50 FPS for a very simple scene   ;  How big is your texture anyway?   ;  Step 1: Stop measuring performance with FPS, it can be very confusing. For example, a drop from 300 to 180 fps is 5.55ms - 3.33ms = 2.22ms difference. 1-2ms is very believable for a full-screen processing pass, which is what you are doing with the shadow map. How big is it?Step 2: Identify your bottleneck. I believe in your case the bottleneck is fill-rate (writing pixels to the framebuffer), but it can also be texture lookups. Making the shadow map smaller will definitely help and as a side effect it will get blurry.Step 3: Optimize the bottlenecked unit. There is not much you can do with fill-rate, other than making the buffer smaller, but you can do some tricks with texture lookups. Are you using the built-in PCF filter or are you programming your own filter in the shader? Built-in filters are always faster.   ;  Before asking more details, take a look at Is tex2D extremely slow? - GameDev.Net Discussion Forums.Only after you've got a real profiler running, you could start estimating whether you're getting the performance you should be.Also, I nice entry by Promit:Every Game Should Have an In-Code Profiler;  Thank you all for answering.My shadow map is 1024x1024.How can I use the built-in PCF filter in DirectX? (I know how to do it in OpenGL, I'm not sure if it works with arbitrary floating point textures (like GL_RGBA16F_ARB)).   ;  PCF filtering is not documented in Direct3D. On NVIDIA cards you can just declare the texture in SHADOWMAP format and the hardware will do automatic PCF filter when you call tex2Dproj in the shader.See this forum post.   