karlz 0 Posted November 1, 2015 Report Share Posted November 1, 2015 Hi i just started with phaser and thought it would be cool to mix in some 3d overlays for certain elements. Is it possible to render uv mapped meshes using phaser? I tried to pass the gl context (game.renderer.gl) to a function that does some raw webgl operations, but it bails out with the message: "INVALID_OPERATION: uniform2f: location not for current program", which seems pixi related? (https://github.com/pixijs/pixi.js/issues/181) Thanks! Karl Quote Link to post Share on other sites
karlz 0 Posted November 2, 2015 Author Report Share Posted November 2, 2015 update: i found a post explaining how to do what i want for three.js and phaser, by hooking a canvas to a pixi texture: http://www.html5gamedevs.com/topic/4183-mixing-in-3d-elements/http://dscode.cf/?p=1 With the help of this article i cooked up a minimal example that draws a triangle in a "raw" webgl context which can then be used as a sprite in the phaser world:http://codepen.io/anon/pen/vNaxEG While this works i noticed the animation is not smooth... i have the suspicion that this method causes the "backbuffer-canvas" in my example to be uploaded back to the gpu every frame phaser renders.. can anybody with more knowledge about how this canvas to pixi binding works confirm this? Is there any way to have this setup but keep the "backbuffer-canvas" as texture on the gpu? Thanks in advance! karl Quote Link to post Share on other sites
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.