Comments (4)
Check out the following screenshot:
![image](https://private-user-images.githubusercontent.com/12612165/259354127-9d521086-be91-4ed9-82b8-9a6859a9ce3f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg0NjA2MDUsIm5iZiI6MTcxODQ2MDMwNSwicGF0aCI6Ii8xMjYxMjE2NS8yNTkzNTQxMjctOWQ1MjEwODYtYmU5MS00ZWQ5LTgyYjgtOWE2ODU5YTljZTNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE1VDE0MDUwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmOTEzMjY4YjMwM2U5NmU0MDQxMjk5OGExMDU2M2IwM2ViOGEzNDBiNzVmZmFkZWQyMjliNjM3MWEwYTYyMmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7vuNTSQbi9Dl69fQzWWq2SS_F4fj7B26SxWuVhGu4Fw)
It shows the wireframe of the shape with focus on the left hole. The interesting part is the top side of the quad where you can see the narrow triangle that goes to the right (it's actually the first triangle definition in ShapesGeometry
). EdgesGeometry
can't properly process the bottom edge of this triangle.
If you translate the second hole slightly upwards, the glitch goes away because the triangulation ends up differently and EdgesGeometry
produces your intended output. https://jsfiddle.net/xprqv1ns/
The triangulation isn't wrong, imo. It's just not the expected input for rendering border edges with EdgesGeometry
. For now, I would just state that EdgesGeometry
can't properly handle shape definitions with holes.
from three.js.
You might want to consider to detect the outline with a post processing pass like sobel. The edges would look like so:
![image](https://private-user-images.githubusercontent.com/12612165/259361165-4682a0d1-6d48-4235-9588-d8205a5a7d72.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg0NjA2MDUsIm5iZiI6MTcxODQ2MDMwNSwicGF0aCI6Ii8xMjYxMjE2NS8yNTkzNjExNjUtNDY4MmEwZDEtNmQ0OC00MjM1LTk1ODgtZDgyMDVhNWE3ZDcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE1VDE0MDUwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk1YTVmNjk0MzNmYTE0YzBiYWUzM2ZiNGUxNGUwMGNlNGRiYTVlMmY2YzQzZjZkMzE4NzI2NDY5YjkzNmJkZWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.z34KxY34Y7lGyFzMkid6vCxaQ8mVpYtQi3hL55jX1kw)
You could use a custom shader to blend the result over your beauty pass.
from three.js.
Thanks for the analysis @Mugen87. I understand the triangulation issue now. Since the meshes I am working with are generated, simply translating holes will probably not solve my issue reliably. EdgesGeometry does not seem to be the right tool for my use case here.
You are right, in this case it would probably be better to use post processing for the outlines. Thanks for the suggestion.
If this is not a bug from your perspective, feel free to close this issue.
from three.js.
I don't think we can update the implementation in a reasonable way such that these use cases are supported. Let's consider this issue as a limitation of EdgesGeometry
.
from three.js.
Related Issues (20)
- rotate-to-cursor on touch events HOT 1
- VolumeNodeMaterial only renders 1x1x1 HOT 2
- normal z-buffer #webgl_camera_logarithmicdepthbuffer rendering issues cross OS, gpu, browser HOT 3
- Uncaught (in promise) ReferenceError: Request is not defined HOT 2
- TSL: Unusual right associativeness of `sub` and `div`
- what happened? How can I solve this problem? HOT 1
- TSL: Some names for a TSL function break the syntax of translated WGSL or GLSL code
- Editor: Shadow properties in OBJECT tab do not refresh UI when UNDO/REDO
- Editor: Geometry parameters in GEOMETRY tab do not get refresh when UNDO/REDO
- Inconsistent layout in `aomap_fragment` include, compared to i.e. `roughnessmap_fragment` HOT 3
- WebGPU: WebGPURenderer throws a DOMException error on a non-WebGPU browser HOT 2
- Docs: Please updates "WebGL compatibility check" page
- USDZLoader: TypeError: target is undefined HOT 2
- Improve GPUComputationRenderer performance by using fullscreen triangle HOT 3
- WebGPURenderer: Weird DirectionalLight Behavior Between WebGLRenderer and WebGPU Renderer HOT 3
- NodeMaterial: Alpha channel behaves wrong on non-transparent materials HOT 1
- `GLTFExporter` <> `GLTFLoader` round trip `TypeError: Cannot set properties of undefined (setting 'isBone')` HOT 2
- WebGLRenderTarget Texture breaks glTF export HOT 2
- games_fps Example: Collision detection anomaly HOT 3
- Bug Collision detection anomaly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from three.js.