Search the Community
Showing results for tags 'RenderTexure'.
-
Hello ?! I am experimenting with making a split screen multiplayer game, using a game engine backed by PIXI, GDevelop. To do so, I'm moving the "camera" (the root Container's position) to center each player and render the root container into a sprite, each sprite being a player's screen. To do the rendering, I've used code that looks like this (simplified for readability and to contain only the PIXI code, not the engine specific one) that runs every frame of the game: const source = the root PIXI Container; const width, height = the viewport width & height; const renderTarget = a PIXI sprite; global.rt = (global.rt || RenderTexture.create({ width, height })); global.sprite = (global.sprite || Sprite.from(global.rt)); if(!renderTaget.texture instanceof RenderTexture) renderTarget.texture = RenderTexture.create({ width, height }); renderer.render(source, { renderTexture: global.rt }); renderer.render(global.sprite, { renderTexture: renderTarget.texture }); The texture of the render target seems to be replaced, but it seems to be transparent (or the background color), no messages in the console, but after a few dozens of seconds the webgl context is lost. The more renders the quicker, so i am guessing it has something to do with the amount of times i do the rendering. Does anyone have some pointers about what i may have done wrong? Thanks
- 1 reply
-
- context
- rendertexure
-
(and 1 more)
Tagged with:
-
Hi all While working on my game I encountered some obstacles, of which I'm not sure how to solve them. 1: For my game I have created an animated tree with a particle container for leaves and a normal container for a tree trunk SimpleRope. The tree has some moving animation, as shaking and being chopped, and a simultaneous parallel copy of the tree containing normal map images. However, I cant just recreate the tree as it requires some performance. RenderTexture was a great solution to just create one tree and render it multiple times as texture, but obviously this way the animation will happen on all the trees. Now, for this I thought of a solution but I'm not sure if its good. I figured that when there is interaction with the tree, I could replace it with a new container of the tree, do the animation and erase it or keep it in a pool afterwards. This still could increase performance issues drastically, when multiple trees are interacted with. What do you think is a good solution? Or maybe I could extract the different frames and make an animation loop out of it at the start of the game. 2. I build a character system for the game, which builds a character out of different parts. with the legs, arms and torso as a SimpleRope. this works fine for one character, but I think that when there are more on the map, it will become laggy. Since these SimpleRopes are meshes, these body parts all have separate individual render calls I think, which would amount to a lot, if there are more characters. Would it be doable to create this code of the characters movement of the different body parts inside 1 mesh? if yes, how could I approach it? Thank you for thinking with me for an approach. If you think of something, let me know!
-
Hey, I want to ask if there's a way to create render textures of displayObjects which aren't rendered/shown on screen? For example, let's say I have a container which has the sprites of normal maps, I want to create a render texture of this container which I could then maybe use in a shader. Now, I obviously wouldn't want this container to be visible at all, if I make it invisible, the renderTexture is going to be empty as well. So, the use case is that I have a container which is just used to create textures that could be used in a shader, and I dont want this container to be visible in the scene. Is there a way to achieve this?
- 4 replies
-
- rendertexure
- container
-
(and 1 more)
Tagged with:
-
Hi! Is it possible to render a rotated DisplayObject into a RenderTexture. Atm it looks like "RenderTexture.render" and "RenderTexture.renderXY" just ignores rotation on the object. My current solution is to use "BitmapData.draw" which works fine. But I'm still wondering why RenderTexture ignores the rotation? Cheers, Klaus
- 2 replies
-
- RenderTexure
- BitmapData
-
(and 2 more)
Tagged with: