Skip to main content
1 of 2
philB
  • 159
  • 9

As expected the elongation on various horizontal plane can result from concatenation of matrices. given R the amount of elongation, H the height of a reflexion plane, and P the reflexion matrix for this plane:

PSTMat = P*XMMatrixScaling(1, R, 1)*XMMatrixTranslation(0, H*(1 - R), 0);

then concatenate PSTMat to the WorldMat of the object and the Scene ViewProj and use this during the reflexion map generation.

for objects O GlobalMat = WorldMat*PSTMat*ViewProj;

A couple of screenshots in the figure show the result for A) R=1, B) R=2 qnd C) R=0.5. The rain comes from a simplified version of the NVidia rain demo. When used the reflexion map texcoords are "distorded" to gives the ripples and some random offset to simulate the impacts of drops.

enter image description here

philB
  • 159
  • 9