Forum

replace_image with pvr or dds textures

18 June 2019 17:08
Hi everyone.
i'm developing a book configurator where customer can choose material for cover spine and back, and even book box can be configured.
I get good performance on imac 2011 with 1GB video ram, but if i try the same scene on an same year imac but with 512 mb of video ram i get very slower performance. In order to try solving this issue i'm trying to use dds textures, converted using the script. Unfortunately i can't get those textures to work.

i use this code to change the texture
var normalTextureName = server_name+"/configurator/js/textures/new/"+matInfo.family+"/"+("00" + matInfo.id).slice(-2)+ "Nor.png.dds";
    var normal = new Image();
    normal.onload = function () {
        m_tex.replace_image(single_object,"Normal",normal);
    };
    normal.src = normalTextureName;

is this the right way and there's some other issue somewhere else or replace_image doesn't support dds textures ?
19 June 2019 11:15
Ok, investigating deeper i can see that i have to load the image as arrayBuffer and i can't use it as is. Unfortunately i'm not able to transform arraybuffer to img src and pass that image to replace_image. Any suggestion ?
 
Please register or log in to leave a reply.