Asked 4 months ago by JovianNomad197
Decal Sinks and Duplicates on Tajine Plate Mesh
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 4 months ago by JovianNomad197
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
I'm applying decals to a Tajine Plate mesh, but I'm encountering two issues: the decal doesn’t appear on the bottom part of the mesh, and the image seems duplicated along the seam, resulting in distortion.
Below are the decalMaterial properties I’m using:
JAVASCRIPTmap: decalTexture, transparent: true, depthTest: false, depthWrite: false, polygonOffset: true, polygonOffsetFactor: -5, polygonOffsetUnits: 1, blending: THREE.NormalBlending,
And here are the decal positions:
JAVASCRIPTconst decalSize = new THREE.Vector3(0.15, 0.15, 0.15); const decalPosition = new THREE.Vector3(0, 0.5, 0.02); const decalOrientation = new THREE.Euler(0, Math.PI / 2, 0);
Any suggestions on how to fix these issues would be greatly appreciated.
Comments 0
•Answers 1
•Views 24
Answer by TychoAI Agent • 9 days ago
Based on the issues you're experiencing with your decals on the Tajine Plate mesh, here are some suggestions to address both the visibility on the bottom part and the duplication/distortion along the seam.
The issue might be related to your decal position and orientation. Your current setup has:
JAVASCRIPTconst decalPosition = new THREE.Vector3(0, 0.5, 0.02); const decalOrientation = new THREE.Euler(0, Math.PI / 2, 0);
Try these adjustments:
Adjust the position: The y-value of 0.5 might be positioning your decal too high on the mesh. Try lowering this value to place it closer to the bottom part.
Modify the orientation: Your current orientation is rotated 90 degrees around the y-axis. You might need to adjust this to properly align with the bottom surface.
Increase decal size or depth: Your z-component of decalSize (0.15) might not be deep enough to project onto the bottom surface.
JAVASCRIPT// Try adjusting these values const decalSize = new THREE.Vector3(0.15, 0.15, 0.3); // Increased depth const decalPosition = new THREE.Vector3(0, 0.2, 0); // Lower position const decalOrientation = new THREE.Euler(-Math.PI / 4, Math.PI / 2, 0); // Angled downward
This is likely related to UV mapping issues. Here are some solutions:
depthTest: false
, which might be causing the decal to appear on both sides of surfaces. Try:JAVASCRIPTdepthTest: true,
JAVASCRIPTpolygonOffsetFactor: -4, // Less aggressive offset
Consider using multiple decals: Instead of trying to wrap one decal around a complex surface, use multiple smaller decals positioned strategically.
Check your DecalGeometry parameters: When creating the DecalGeometry, make sure you're using appropriate parameters:
JAVASCRIPTconst decalGeometry = new THREE.DecalGeometry( targetMesh, decalPosition, decalOrientation, decalSize );
If these suggestions don't resolve your issues, you might need to examine the specific geometry of your Tajine Plate mesh and adjust your approach accordingly, possibly using multiple decals for different parts of the mesh rather than trying to apply a single decal across complex curvature.
Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?
No comments yet.
No comments yet.