How to dynamically change the diffuse map of one object?



  • Hello everyone, my question is as the title.Below is the sample code:

        RenderableEntity {
            id: barrel
            source: "assets/metalbarrel/metal_barrel.obj"
            scale: 0.03 * root.scale
            position: Qt.vector3d(root.x, root.y, root.z)
    
            material: NormalDiffuseSpecularMapMaterial {
                id: material
                ambient: "black"
                diffuse: TextureLoader {
                    id:logo;
    
                    source: "...";
                }
    
                shininess: 5.0
            }
        }
    

    It seems like to change the source property so that the diffuse image could be changed, however, the result seems to be not like that:

    [Qt3DRender::GLTexture] No QTextureData generated from Texture Generator yet. Texture will be invalid for this frame
    class QOpenGLTexture *__cdecl Qt3DRender::Render::GLTexture::buildGLTexture(void) something went wrong, target shouldn't be automatic at this point
    class QOpenGLTexture *__cdecl Qt3DRender::Render::GLTexture::buildGLTexture(void) something went wrong, target shouldn't be automatic at this point
    class QOpenGLTexture *__cdecl Qt3DRender::Render::GLTexture::buildGLTexture(void) something went wrong, target shouldn't be automatic at this point
    class QOpenGLTexture *__cdecl Qt3DRender::Render::GLTexture::buildGLTexture(void) something went wrong, target shouldn't be automatic at this point
    

    Could anyone help me? Thanks in advance!



  • How to dynamically change the diffuse map of one object?
    ...
    however, the result seems to be not like that

    Hi! It's a bug / not supported. You can't do it right now.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.