www.jpct.net
jPCT-AE - a 3d engine for Android => Support => Topic started by: lawless_c on June 30, 2016, 05:45:49 pm
-
Are there any delays or locks in sending a framebuffer image to texture?
I'm trying to reuse the same texture across two object3d's , the texture is shared to both via Two texture info's
When i run this however , textureA isn't applied to objectB as it should be. Is it possible there is delay in the first render that locks the texture? I found that if i reversed the order
i ran into the same issue but with the other object3d.
fb.setRenderTarget(TextureA);
objectA.setVisibility(true);
fb.clear();
displayWorld.renderScene(fb);
displayWorld.draw(fb);
fb.display();
objectA.setVisibility(false);
fb.setRenderTarget(TextureB);
objectB.setVisibility(true);
fb.clear();
displayWorld.renderScene(fb);
displayWorld.draw(fb);
fb.display();
objectB.setVisibility(false);
-
No, there's no delay. Which OpenGL ES version are you using? 1.x or 2.0?
-
yeah should be two. Set it in the manifest and set in the config on startup.
-
I don't think that I fully understand what you are trying to do here. What do you mean by 'shared' in this context? You are setting texA as a render target, render objA into it, then you set texB and render objB into it. I don't see anything shared here... And what exactly is the outcome and in which way does it differ from what you actually want to get?
-
The result of rendering objA to to TextureA is then used by objectB rendering to textureB
texinfo = new TextureInfo(TextureManager.getInstance().getTextureID("TextureA"));
texinfo.add(TextureManager.getInstance().getTextureID("TextureB"), TextureInfo.MODE_ADD);
objectB .setTexture(texinfo);
I'm picking up TextureA with a shader in objectB
TextureA is also used by object A, maybe that's the issue?
-
TextureA is also used by object A, maybe that's the issue?
Yes, most likely. You are not supposed to render into a texture that is used in the rendered scene as well.
-
oh darn
-
oh darn
You might get aroudn this by introducing a third texture and swap textures on the object (that's a pretty cheap operation). Try to imagine what the outcome is supposed to be if you use your render target in the same scene...it could be everything depending on how the hardware/driver deals with it... ;)
-
Will try that, going to have to work it out with a pen and paper.
-
Should texture replace be enough to do this?
If I'm using a textureinfo as a texture do i have to redo those to? As they seem to rely on a retrieved texture id.
-
No, I actually meant to replace it on the object, not in the TextureManager.
-
Hmm no look yet. I used settexture to switch the object texture something that is not being rendered to but it was ineffective.
It's always which ever process is done 2nd that ends up not working and remaining unprocessed.
-
I'm not sure what you are doing exactly. Can you create a simple test case for me that shows your problem?