We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Switch between video and image with replaceTexture

Home Forums Puzzles Switch between video and image with replaceTexture

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #30425
    Avatarweb
    Licensee

    I’ve got a little issue with the replaceTexture puzzle.

    I would like to have two buttons, to switch between playing a video and showing an image on an object.

    Problem is that, as soon as I replace the map with the video, I can no longer switch back to the image, cause the map name doesnt exist anymore.

    What can I do to fix this?

    #30447

    Problem is that, as soon as I replace the map with the video, I can no longer switch back to the image, cause the map name doesnt exist anymore.

    Use two materials that look the same, load video texture into one and replace materials.

    Co-founder and lead graphics specialist at Soft8Soft. Blender only and forever!

    #30452
    Avatarweb
    Licensee

    Okay, will do it that way.
    Thx

    #31011
    Avatarweb
    Licensee

    Have to get back with this. This worked at first, but now it doesnt anymore and I dont know why.

    Maybe because of the latest update?

    I tried to debug this with a simple scene and pure puzzles. And it seems that after assigning the video material to the object, the other material gets deleted from the scene. Because after that happens the puzzle shows the material in red letters and in the dropdown it isnt anymore.

    • This reply was modified 1 week, 4 days ago by Avatarweb.
    Attachments:
    You must be logged in to view attached files.
    #31059
    Avatarweb
    Licensee

    Sorry to push that issue again. Would need to get this fixed pretty soon. So would be great if someone of the devs could get back to me :rose:

    Otherwise I would maybe need to create materials on runtime via javascript to workaround that issue.

    #31061

    Hi,
    in Verge3D 3.3 we introduced a feature when materials being replaced by other materials are automatically cleaned up. If you need to preserve it, assign (in the loaded asset or dynamically, via Puzzle) to some other invisible or remote object. So I believe in your case the issue is with geo_video material being clean-up by Screen material.

    Co-founder and CTO at Soft8Soft
    FB | Twitter | VK

    #31062
    Avatarweb
    Licensee

    Nevermind, got it working.
    I just created two hidden objects as material holders.

    This way its working.

    • This reply was modified 1 week, 1 day ago by Avatarweb.
    #31063

    Simply assign the test material on some invisible plane in your modeling tool and reexport.

    Co-founder and CTO at Soft8Soft
    FB | Twitter | VK

    #31065
    Avatarweb
    Licensee

    Damn, to slow.
    Got it working. Exactly as you said

    #31066

    Great!

    Co-founder and CTO at Soft8Soft
    FB | Twitter | VK

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