ashwin.sudhir Posted January 25, 2012 Share Posted January 25, 2012 We programmatically create an image that we upload to the GPU very often. To reduce the stall we'd want to keep the image size as small as possible and hence chose the R8 format. When we create a 146x146 sized image we get a strange problem. The image looks fine in this preview But when we see it in the material preview (the eye icon on the diffuse texture), we find it is distorted And this is how it comes up in the game too (distorted). Strangely this doesn't happen when we create an image of double this size (292x292). We wouldn't want to do that though, as the stall becomes more obvious. Link to comment
ashwin.sudhir Posted January 25, 2012 Author Share Posted January 25, 2012 (Forgot to attach generated image) FoW.zip Link to comment
frustum Posted January 27, 2012 Share Posted January 27, 2012 There were several fixes regarding texture loading. I think this problem will be solved with the next SDK. What graphical API do you use? Link to comment
ashwin.sudhir Posted January 28, 2012 Author Share Posted January 28, 2012 These are the APIs we use</div> C++ ======= Unigine::ImagePtr m_pImgFoW; ... memcpy_s(m_pImgFoW->getPixels2D(), nBytes, m_pBufferR8Downscaled, nBytes); m_pImgFoW->blur(1); #ifdef _DEBUG m_pImgFoW->save("FoW.tga"); #endif In unigine script ============== Material mat = engine.materials.findMaterial("mesh_terrain_base"); int idTex = mat.findTexture("fow"); mat.setImageTextureImage(idTex, img); Link to comment
manguste Posted February 3, 2012 Share Posted February 3, 2012 Please, wait for the next SDK, the problem seems to be fixed. Link to comment
ashwin.sudhir Posted February 3, 2012 Author Share Posted February 3, 2012 Thanks manguste ;) Link to comment
Recommended Posts