Hi,
I’ve been working on a project that uses clipping planes.
I’ve gotten multiple objects w/ materials loaded from Blender, fine and dandy.
However I’m having one problem.
The code I’m using and changed from the stencil code example here with (live demo of the examples code here) has a new object created with new materials.
I am loading my own objects to use, and want to use my own materials.
I’ve done the loading of the materials from the loaded object and adding the properties to them that the example code does.
that would be (from line 175):
clippingPlanes: planes, clipShadows: true, shadowSide: v3d.DoubleSide,
(which works fine for the main parts of the object, no problem there)
this issue is importing my own material into the ‘planeMat’ material (the material made for the geometry that is sliced at the clipping plane)
I do the same importing and adding of properties, but it bugs out. serous graphic artifacts.
I believe it’s because it’s in a loop for each plane.
where on line 150
which is:
clippingPlanes: planes.filter(p => p !== plane),
…needs to be iterated with each plane (3) intersection’s geometry.
I have the desired material from Blender stored in a var ‘material_Clip’.
after i load it, i append to it…
`console.log('material_Clip BEFORE appending clipping planes and stencil: ',
material_Clip);
// this line omitted for some attempts
// material_Clip.clippingPlanes= planes.filter(p => p !== plane),
material_Clip.stencilWrite = true,
material_Clip.stencilRef = 0,
material_Clip.stencilFunc = THREE.NotEqualStencilFunc,
material_Clip.stencilFail = THREE.ReplaceStencilOp,
material_Clip.stencilZFail = THREE.ReplaceStencilOp,
material_Clip.stencilZPass = THREE.ReplaceStencilOp,
material_Clip.name = 'material_Clip',
console.log('material_Clip AFTER appending clipping planes and stencil: ',
material_Clip);`
How would any of you have your own imported material go through that loop to be appended with the iterated attributes?
Thanks.
P.S. my material from blender is a NodeMaterial, wonder if there are incompatibility issues here with the attributes.