ReadyPlayerMe Avtar 2D Model rendering

Hi there!
I am currently working on multiplayer project , So as for now we are currently using 3rd app for avatar “ReadyPlayerMe”. I have to display modal avatar image in ui , i am get getting 3d model asset from ReadyPlayerMe, so, the requirement is convert the 3d modal into 2d image.

In this above this there were discussing about how to put the 3d character on 2d screen , But my requirement is to convert the 3dmodal into 2d image

you could render it to texture perhaps?

example here:
https://playcanvas.github.io/#/graphics/render-to-texture

1 Like

Or for an Editor version of the above: Render 3D World to UI | Learn PlayCanvas

we only need to have the image once and do not require it to render it all the time

that’s fine, disable / destroy the camera when not needed.

The Render is also getting destroyed when we destroy the camera

@surya is it possible to share your code/setup or if possible a sample project that reproduces the issue?

when we destroy the camera , here is the issue

Here is the link to the project…
https://playcanvas.com/editor/scene/1467260

So if you disable the Blue camera then it works as expected. If you destroy the Blue camera, then you are correct the texture disappears. The reason is simple, the renderCameraToElement script is attached to that camera.

And when the script instance is destroyed with the entity, the render target is destroyed too.

You can either disable the camera as soon as the texture is rendered, or simpler if it works for you check renderOnce on script settings (just make sure your model is loaded before the script executes).

image

1 Like

hi there
how can we able to get the transparent background image

Even after disabling the clearBufferColor
image

You have to change the render texture that is generated to have an alpha channel and change the fill color of the cameras rendering the avatars to use 0 alpha.

See project https://playcanvas.com/project/956419/overview/transparent-render-3d-world-to-u

1 Like

Thanks @yaustar for the reply