Jump to content

Babylon render to texture for use in existing non-babylon project


wolsen
 Share

Recommended Posts

Hello

the trick will be to create an babylon engine from an existing context. 

You could do the following:

- create a dummy canvas and instantiate a new Engine from it

- update the engine._gl to the gl context you already have

 

This should do the trick. Then create a scene, a rendertarget and do what you want with it.

The renderTarget has a _texture property which is a webgl texture that you can use in your current webgl app

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...