Shadow Techniques demo

I am going over the 1.1 demo, OGLESShadowTechniques looking at the FBO section. There is no explanation as to the derivation of the values in the glScale call:








          glScalef(0.003f, 0.003f, 1.0f);





Am I do assume that is just a total hack requiring the values to be hardcoded? And why is the UV space of the checkerboard face so tiny to require the FBO texture to be scaled down by so much?


distantsuns wrote:
I am going over the 1.1 demo, OGLESShadowTechniques looking at the FBO section. There is no explanation as to the derivation of the values in the glScale call:





          glScalef(0.003f, 0.003f, 1.0f);



Am I do assume that is just a total hack requiring the values to be hardcoded? And why is the UV space of the checkerboard face so tiny to require the FBO texture to be scaled down by so much?




Arggh.!



Should be: "Am I to assume..."



No takers yet?

Hi.





If you look a few lines up from this function you’ll see that the model’s vertices are being used as texture coordinates in the call to glTexCoordPointer. As the model’s vertices are in the range of -100.0 to +100.0, the scale is required to reduce the UV size to something more appropriate (in the range of 0.0 to 1.0): using 0.003 is simply a magic number.





Thanks for bringing this to our attention - I’ll comment this block of code appropriately.