Hi everyone!
I’m trying to create a portrait image of the character of my game using a separate camera, but I have some issues that I’m not sure how to resolve! This is supposed to be kind of like your profile image.
As you can see, it looks pretty good already and the image also has a transparent background, which is a must. Another thing that is a must is that only the character must be visible in the picture. However, there are issue that I haven’t been able to resolve yet:
-
How to get rid of the fullscreenui? That health bar is situated on top of the character. Is there any way to do this with
CreateScreenshotUsingRenderTarget? There is a playground visualizing this problem here: CreateScreenshotUsingRenderTargetTexture | Babylon.js Playground -
It seems that if the scene has autoClear set as false, the meshes won’t appear in the screenshot. Is there any way to handle this without changing the autoclear to true? Maybe I can have it true when the screenshot is being taken? Playground to illustrate this problem: CreateScreenshotUsingRenderTargetTexture | Babylon.js Playground
-
I have to turn off the particles since there is no way to exclude them from the screenshot. I have semi global particle effects like rain and leaves, and those appear on the screenshot if I do not turn them off. The problem is that there is a small hiccup when doing this, so it is not ideal… Any way to circumwent this? This is what I do currently
this.scene.particlesEnabled = false const base64Picture = await Tools.CreateScreenshotUsingRenderTargetAsync( this.scene.getEngine(), this.snapshotCamera, { precision: 1.0, width: this.snapshotSize, height: this.snapshotSize }, undefined, undefined, false, undefined, false, true, false, undefined, (texture) => { texture.renderList = meshes texture.useCameraPostProcesses = true texture.renderParticles = false } ) this.scene.particlesEnabled = true
Thank you in advance for any help you can give me ![]()
One thing I’ve been thinking of what I could do to circumvent most of the problems; duplicate the mesh and move it far away to a location where there are no particle effects etc., but that introduces some extra work… ![]()

