Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Raw webgl access


karlz
 Share

Recommended Posts

disclaimer: i asked this question somewhat differently over at the phaser forum (http://www.html5gamedevs.com/topic/18306-access-raw-webgl-from-phaser/), but after some research i think the question is better suited to ask here..

 

I want to render some 3d overlays and i used this article as a reference: http://dscode.cf/?p=1

A seperate webgl canvas is used for my 3d operations, which i then bind to a pixi texture.This works and you can see my test here:

http://codepen.io/anon/pen/vNaxEG

 

Now i'm wondering if this construction results in something that is pulled from and pushed back to the gpu every frame, or is the seperate canvas efficiently being updated and copied entirely on the gpu (acting like somekind of renderbuffer)?

 

Thanks in advance!

 

Karl

Link to comment
Share on other sites

Yes, it is.

 

By the way,Pixiv3 is easier to work with, you can add your own shaders and render managers as plugins.

 

You mean it updates both canvases entirely on the gpu (also the drawing over each other between these two)? I'm still learning, but what What opengl mechanism is used for this behind the screens, does each canvas create an FBO or something?

 

Thanks again!

Link to comment
Share on other sites

 

 

Now i'm wondering if this construction results in something that is pulled from and pushed back to the gpu every frame, or is the seperate canvas efficiently being updated and copied entirely on the gpu (acting like somekind of renderbuffer)?

 

If you draw to a canvas and use it as a texture, that texture is from the CPU. Regardless of how you originally created that canvas.

 

So you are drawing via GPU, copying the texture to the CPU, and pixi will upload it to the GPU for drawing. This is absolutely necessary since there are 2 webgl contexts, they cannot share textures.

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...