alex_h Posted October 9, 2017 Share Posted October 9, 2017 A while ago I made an outrun type racing game with pixi.js v2.2.9, using graphics objects to render the road and ground polygons. This meant I had to use the Canvas renderer because with the webgl renderer I'd have had to re-upload all the graphics objects to the GPU every frame as they constantly changed shape. I'm now thinking of making a similar game so I just wanted to check whether graphics objects are now rendered differently with webgl in the latest version of pixi? In which case I might be able to modify the vertex positions of graphics objects at run time while running the webgl renderer without worrying about the impact on performance? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 9, 2017 Share Posted October 9, 2017 > as they constantly changed shape In a racing game? Are you sure? Even if they change shape, there are optimization for graphics, but I need more details. Quote Link to comment Share on other sites More sharing options...
alex_h Posted October 9, 2017 Author Share Posted October 9, 2017 Yes they changed shape, it was an outrun type 'psuedo-3D' game so each road segment was constantly modified for perspective, especially when going around bends. Something like this: If I recall correctly, at the time graphics objects were drawn using the stencil buffer under the webGL renderer, which also meant their edges could not be smoothed. Is this still how it works? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 9, 2017 Share Posted October 9, 2017 Their edges can be smoothed, just not as good as in canvas. Yeah, that seems to be a problem. You better use Mesh instead, and not many meshes, but a big one. You really have to make your own management for indices, UV's and vertices. It will be much faster than canvas graphics if you make it right Quote Link to comment Share on other sites More sharing options...
alex_h Posted October 9, 2017 Author Share Posted October 9, 2017 Ok thanks, I'll have a look at the mesh option 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.