Home › Forums › Programming › Appending params to material or Coding PRB Material?
- This topic has 6 replies, 3 voices, and was last updated 4 years, 3 months ago by Yuri Kovelenov.
-
AuthorPosts
-
2020-09-26 at 4:24 am #33379GLiFTeKCustomer
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!Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-09-26 at 5:29 am #33390GLiFTeKCustomeri 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 ?
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-09-26 at 9:13 am #33399Alexander KovelenovStaff2020-09-26 at 10:12 am #33404GLiFTeKCustomerOh 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??Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-09-27 at 10:35 am #33440Yuri KovelenovStaff2020-09-27 at 2:58 pm #33455GLiFTeKCustomerHi! 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
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-09-28 at 8:19 am #33477Yuri KovelenovStaff -
AuthorPosts
- You must be logged in to reply to this topic.