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.

Appending params to material or Coding PRB Material?

Home Forums Programming Appending params to material or Coding PRB Material?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #33379
    GLiFTeK
    Customer

    Hi,
    In the clipping plane stencil example, tat I’ve successfuly gotten custom objects in, working in a puzzles project, the code has a part where it requires to recreate materials to apply to the clipped object. Ie:

    now when i apply the new materials it has to make with the clipping planes,.. im trying to have the original material on a variable then re apply it but then ADD the clipping planes parameters. i

    the code is …
    // object new material
    var material = new v3d.MeshStandardMaterial({

    color: 0xFFC107,
    clippingPlanes: planes,
    clipShadows: true,
    shadowSide: v3d.DoubleSide,
    });
    i want to apply my original material, then add the clipping code to it…

    I have my original material from the loaded, clipped object stored in a variable.

    Is there any way to “append” the above code parameters to my original material, to combine them?

    I’d like to be able to still feel free to use Blender’s materials for objects in this project.

    If this isn’t possible…
    Even though my original materials are not PBR, I’m guessing that PBRs would be the most options for me to use.

    If I can’t append the clipping planes code to my original materials, then which material type in the dev referred is the kind closest to PBRs, or which kind ARE PBRs?

    EDIT: possibly use the “append” text puzzle on the original material’s var?
    Thanks! :good:

    #33390
    GLiFTeK
    Customer

    i got the params into the material with :

                    originalMat.clippingPlanes = "planes";
                    originalMat.clipShadows = "true";
                    originalMat.shadowSide = "v3d.DoubleSide";

    material didn’t show up and got a bad repeating console error …
    “type error e is undefined in v3d.js”
    and crashed the broswer. :-(

    think i need to just rebuild a metal texture in code…

    thinking “MeshNodeMaterial” is what i’m looking for for the PBR ?

    #33399

    Hi,
    you don’t need any qoutes in material parameters. See the code example here for more info on how to asssign clipping planes.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #33404
    GLiFTeK
    Customer

    Oh yeah, I have the stencil clipping Planes example working great within a puzzles project.
    And I removed those quotes, and loading the back the appended material works.

    Thing is, the original material was a yellow metal PBR, now all I see is a plain gray material.

    I thought it was a missing environment map for the new scene not being there to be reflected… I added an environment scene puzzle, but still the original material is gray.

    Possibly I have to code the world environment material?

    The clipping plane example code umm using makes it’s own v3d.WebGLrenerer.
    And adds it to the v3d-container com.

    How would I code it to use the renderer already being used in my puzzles scene?
    app.renderer?? :wacko:

    #33440

    Hi! Try app.scene.renderer

    Chief 3D Verger | LinkedIn | Twitter

    #33455
    GLiFTeK
    Customer

    Hi! Try app.scene.renderer

    What’s the difference between that and
    v3d.apps[0].renderer.localClippingEnabled = true?

    Also I saw Alex recommending this
    v3d.SceneUtils.getMaterialByName(v3d.apps[0], ‘YourMaterial’)
    Which is great, gives me the actual thing not it’s name. Is there something like that for objects? I looked I the sceneutilities dev page and couldn’t find one.
    i mean it’s obviously getObjectByName .. but a utility like the one above that shows every detail in console?

    Thanks :good:

    #33477

    you might try this:
    v3d.apps[0].scene.getObjectByName

    Chief 3D Verger | LinkedIn | Twitter

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