karlz Posted November 3, 2015 Share Posted November 3, 2015 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=1A 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 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 3, 2015 Share Posted November 3, 2015 Yes, it is. By the way,Pixiv3 is easier to work with, you can add your own shaders and render managers as plugins. Quote Link to comment Share on other sites More sharing options...
karlz Posted November 4, 2015 Author Share Posted November 4, 2015 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! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 4, 2015 Share Posted November 4, 2015 I believe that your program renders something, passes it back to the browser, then uploads it on gpu again. Quote Link to comment Share on other sites More sharing options...
xerver Posted November 4, 2015 Share Posted November 4, 2015 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. Quote Link to comment Share on other sites More sharing options...
karlz Posted November 9, 2015 Author Share Posted November 9, 2015 Ok thanks for clearing that up! Seems i have to dig a little deeper then to get this job done... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.