Skip to content

Face tracking: pass through preserveDrawingBuffer prop to WebGLRenderer#242

Open
etekweb wants to merge 1 commit intohiukim:masterfrom
etekweb:master
Open

Face tracking: pass through preserveDrawingBuffer prop to WebGLRenderer#242
etekweb wants to merge 1 commit intohiukim:masterfrom
etekweb:master

Conversation

@etekweb
Copy link
Copy Markdown

@etekweb etekweb commented Aug 23, 2022

Used for face tracking with Three.js Face Mesh.

Setting this property to true lets the rendered canvas be redrawn, allowing for screenshots of the face mesh. In my case, this is done with html2canvas. If the property is not set to true, html2canvas is not able to capture it.

Since this can theoretically lead to degraded performance, it should be an optional property. Therefore, in this implementation, it is an optional property read into the constructor for MindARThree.

@etekweb etekweb marked this pull request as ready for review August 23, 2022 20:38
@hiukim
Copy link
Copy Markdown
Owner

hiukim commented Dec 14, 2022

Hi Thanks for the PR! and sorry about the very late reply.

How about just calling mindarThree.renderer.preserveDrawingBuffer = true after you instantiate mindarThree.

I'm not very convinced it's a necessary change to MindAR. If we are to support that, I guess a more generic way is to add a parameter rendererParams in the constructor, which will pass along to the renderer constructor. So we can put anything including preserveDrawingBuffer as a property of rendererParams

@etekweb
Copy link
Copy Markdown
Author

etekweb commented Jan 27, 2023

Hi! Sorry for the late reply on my end as well.

I just tried switching to instead calling mindarThree.renderer.preserveDrawingBuffer = true after instantiating mindarThree, and it did not work. When I set preserveDrawingBuffer that way, it does not include the face mesh in the screenshot (same thing happens if I don't set preserveDrawingBuffer at all).

@TomDDH
Copy link
Copy Markdown

TomDDH commented Feb 24, 2024

add preserveDrawingBuffer as option for the renderer is best way for screenshot. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants