   Projective texturing and render to texture problem
  What I''m trying to do is render the current scene 1:1 into a texture and then project this texture onto a water plane (the next step would be mirroring the camera but I''m not there yet). Problem is, I just can''t figure out how to set the texture matrix for projective texturing right if my scrren/window is at a none square resolution like 1024x768 or 800x600.Everything would be easy if I could just render into a 1024x768 texture, but I guess that''s not possible.So what I do is:1. Render scene without water to 1024x768 window2. Render scene without water to a 1024x1024 texture (using 1024/768 as aspect ratio and setting the viewport to 1024x768). Are those even the right settings?3. Draw the water plane using fixed function projective texturing.BUT the big problem is: how to set the texture matrix correctly? I want just the 1024x768 part of the texture getting projected onto the screen, so both match up. I know how to set the matrix if the screen has the same resolution as the texture (because then I can just render 1:1 to the whole texture).But for this case?!Thanks in advance, Wolfgang 
  No one know''s this?Maybe my question is totally unclear? Or should I give some more details?Really everything I want to do is the nowadays almost standard reflective water effect where you render the scene to a texture and then draw the water using that texture and projective mapping.I now how to do this when the texture has the same res as the window. But I just can''t figure out what to do when that''s not the case.Maybe someone who has allready done this can tell me how he set up the texture matrix or whatever I may be missing the whole time?!Come on people, I thought that''s a really frequently used technique, please!;  HelloI don''t understand your problem.You must set states like that:SetTextureStageState(stage,D3DTSS_TEXTURETRANSFORMFLAGS,D3DTTFF_COUNT3 | D3DTTFF_PROJECTED);SetTextureStageState(stage,D3DTSS_TEXCOORDINDEX,D3DTSS_TCI_CAMERASPACEPOSITION);And set the texture matrix:load identitym11=2;m22=2m13=0.5;m23=-0.5;  I have set the texture stage states, and I does allready work correctly when I am rendering to a texture which has the same resolution/aspect ratio as my window.The texure matrix I''m using is:1.2f, 0.0f, 0.0f, 0.0f, 0.0f, -1.2f, 0.0f, 0.0f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f Why should I set m11, m22 to 2?My problem is:The above matrix works when I''m rendering to a 512x512 window and texture.NOW:What if I change the window resolution to 800x600?Should it still work with exactly the same texture? Doesn''t my 512x512 now contain a different view as the window?I mean, I have a different aspect ratio when rendering to the window (800/600) (the aspect ratio you have to parse to D3DXMatrixPerspectiveFovLH()). So if I render to the 512x512 texture using 1.0 as a aspect ratio, doesn''t that give a different image then I have in my window??;  I''m not sure, but I think it this is aspect ratio issue. Since UV''s are from 0 to 1, for mapping it doesn''t matter what resolution the texture is.Render the scene without water to 1024x1024 texture, using 1024/768 aspect but leaving viewport to 1024x1024-this will make the 1024x1024 texture contain 1024x768 view.Going to take fullscreen quad for example. It doesn''t matter what resolution the texture is. Only the quality changes.Render into 1024x768 texture with 1024/768 aspect, texture fits the quad.Render into 1024x1024 texture with 1024/768 aspect, texture fits the quad.Render into 256x256 texture with 1024/768 aspect, texture fits the quad.there can be artifacts on downsampling though, if you need 1:1 texture:screen_pixel ratio, then it needs 1024x768 view and modified uv''s/texture matrix for quad. 