Simple Texture Mapping

  • Pat Stevenson

    Pat Stevenson - 2011-11-15

    Hello all,
    After loading a PNG file, I am accessing the RGB components and loading an IFXTextureObject via SetRawImage() onto an IFXAuthorMesh.  When I look at the U3D file however, the mapping does not look correct.  I'm using a version of the HellowWorld program and the texture mapping is very simple:

    // Texture coordinates
    IFXVector4 tc1(0.0f,0.0f,0.0f,0.0f),
    U32 texCoordsCount = 4;

    The texture is 512x512x24 but it seems that there is some kind of offset that the texture is not aligning correctly.  From the way the texture coordinates are set and Repeat is set to stretch and not tile in the IFXShaderLitTexture, it would appear to me that the texture should stretch over the single polygon face I have and not repeat or tile.  Any ideas?


  • Pat Stevenson

    Pat Stevenson - 2011-11-16

    Wanted to give an update to this.  My texture is 512x512, but if only set the raw image in the IFXTextureObject with say the first 300x300 pixels, it lines up on the polygon.  Is there a size limit on the image data within an IFXTextureObject?

  • Michail Vidiassov

    My advice is to try the other sample - IDTFConverter.
    Try to convert idtf + large TGA texture to U3D.
    If conversion works - track how it is done in the converter.


Log in to post a comment.