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.

Change Emission Intensity of Texture

Home Forums Programming Change Emission Intensity of Texture

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1552
    donalffons
    Customer

    Happy new Year :)!

    I have a simple texture setup in Blender, which looks like this:

    I would like to dynamically change the ‘Emit’ Parameter of the ‘Extended Material’ through java script, i.e. with
    window.v3dApp.scene.children[0].children[5].material.???
    …and then…?! How can I do that? Or is there maybe an alternative way of defining textures with varying emission intensities?

    Help would be greatly appreciated!

    Regards
    -Sebastian

    #1553
    donalffons
    Customer

    …I did a bit more digging and found that the extended material node seems to live here:
    `window.v3dApp..scene.children[0].children[5].material.nodeGraph.nodeInfo’

    But changing the values doesn’t do anything to the looks of my material. Do I have to call some kind of update function to get this to work?

    #1556

    Hi,

    Happy new Year :)!

    Same to you :)

    Do I have to call some kind of update function to get this to work?

    Off the top of my head, material internals should get updated if you
    set its ‘needsUpdate’ param to true.
    https://www.soft8soft.com/docs/#api/materials/Material

    Chief 3D Verger | LinkedIn | Twitter

    #1558
    donalffons
    Customer

    I made a simplified test scene (download)
    The cube on the left has Emit = 1, the one on the right has Emit = 0.

    The following code does nothing

    #1562
    donalffons
    Customer

    …I can even delete the complete node graph without any changes and complaints:

    Therefore it doesn’t seem like the nodeGraph is touched anywhere.

    #1565

    will take a look into this :scratch:

    Chief 3D Verger | LinkedIn | Twitter

    #1574

    Hi, in Verge3D we support dynamic assignment/editing output values for Value and RGB nodes. So basically you need to connect Value node to Emit input and assign values through material.nodeValue array (e.g material.nodeValue[0]).

    If you have many Value nodes in your material you might also use material.nodeValueMap to resolve the index in the array by the node name (e.g material.nodeValue[material.nodeValueMap[“node_name”]])

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #1583
    donalffons
    Customer

    Perfect, thank you for you response! I will try it ASAP. By the way, it would be helpful if there was a documentation about the MeshNodeMaterial, mentioning this.

    Thanks again!
    -Sebastian

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