Comments (10)
At first I would have guessed it was from using a second material with {wireframe: true} but I can't see this being the case.
from three.js.
Unfortunately there is no way to avoid the diagonal lines appearing when using CanvasRenderer and opacity < 1 materials.
A work around for you would be to fake the transparency in the texture directly. You could achieve this by having 2 canvas. One with the original image, and another one with the fake-transparent (dynamically tinted to white) image. So every time you interact with the picture you update the texture by drawing the 1st one and then applying fillRect() with the amount of white that you need to give the feeling it's "transparent".
Take a look at materials_video.html
to see how to update a texture per frame.
from three.js.
@mrdoob are the diagonal lines from the triangles overlapping?
from three.js.
Yep. No workaround for that, because canvas antialias (depending of the browser) the shapes. So, either you have gaps or if you overlap the triangles you have visual overlapping when opacity < 1.
from three.js.
Do you plan on implementing a depth buffer for the CanvasRenderer?
I think using NOT_EQUAL compositing in conjunction with a depth buffer could alleviate this issue...
from three.js.
How exactly are you achieving Z-buffering ATM?
I had a look through CanvasRenderer but I can't seem to find any reference to anything other than DepthMaterial which I imagine is what you're utilising somehow. But I cannot see the compositing code.
from three.js.
CanvasRenderer and SVGRenderer (and DOMRenderer) use Projector(.js) for projecting the 3d scene in 2d (and that's where the sorting gets done).
from three.js.
So it's painters algorithm?
That explains why my transparent plane pops in and out of cubes I place on it.
Since you already have DepthMaterial, implementing a depth buffer would be relatively easy. It's definitely something to look into as it will solve multiple issues.
from three.js.
I think this issue has been resolved/question has been answered.
pyrotechnick: I think you're question is unrelated here (I have the feeling you're talking about WebGLRenderer). Feel free to open another issue if it's not. Lets try to be organised and keep conversations on-topic.
from three.js.
I'm indeed suggesting CanvasRenderer should implement depth buffering. Depth buffering is currently available in WebGLRenderer since it's handled provided by WebGL and implemented in hardware.
My suggestion entirely relates to this issue since what I propose would allow for hiding the diagonal lines currently drawn by CanvasRenderer.
Nevertheless, as mrdoob suggests, let's move this conversation to another issue; with a more appropriate title.
from three.js.
Related Issues (20)
- Imposter.js Not Found HOT 1
- 3DS Loader - possibly use MeshPhysicalMaterial HOT 2
- GLTFLoader Failed to loading Texture with mimeType (mimeType:"image/ktx2") HOT 1
- HTMLMesh throws error if radio element has height of width of 0. HOT 2
- When using Box3.setFromObject() on GLTF containing animation, the cloned model does not display properly. HOT 5
- The webxr_ar_lighting sample does not work HOT 2
- Textures / UV mapping incorrect after exporting FBX with GLTFExporter HOT 10
- Code paths for WEBGL_multisampled_render_to_texture HOT 2
- DRACOLoader: use decoder from gstatic by default HOT 2
- Colors much darker after upgrading from 151 to 158 HOT 1
- Useful extensions for the webgpuRenderer HOT 9
- OrbitControls update event always fired if using an Orthographic Camera HOT 2
- SpotLight map affected by distance updates HOT 7
- Custom Shaders not working in r159 anymore HOT 2
- Bug: GTAOPass treats culled faces as occluders HOT 10
- HBAO pass is not the "real" HBAO, but N8AO HOT 4
- Example of WGSL shader for Three.js WebGPU renderer HOT 12
- When used in Vue3, when refreshing with F5, the background of the model scene displays white HOT 1
- Cache clobbering when loading same file through `FileLoader`, `ImageBitmapLoader`, or `ImageLoader` HOT 4
- Flow reports an error in multiple materials HOT 3
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.