Shadow Techniques demo

This topic contains 2 replies, has 2 voices, and was last updated by  Arron 6 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30590

    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?

    #35016
    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?

    #35017

    Arron
    Member

    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.

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.