Hi, i have integrated JPCT-AE with ARtoolkit and it works fine but can't render black color, when i render an object the black part of the texture is rendered as transparent.
This is the ARtoolkit Render
public class ARRenderer implements GLSurfaceView.Renderer {
/**
* Allows subclasses to load markers and prepare the scene. This is called after
* initialisation is complete.
*/
public boolean configureARScene() {
return true;
}
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
// Transparent background
GLES10.glClearColor(0.0f, 0.0f, 0.0f, 0.f);
}
public void onSurfaceChanged(GL10 unused, int w, int h) {
GLES10.glViewport(0, 0, w, h);
}
public void onDrawFrame(GL10 gl) {
if (ARToolKit.getInstance().isRunning()) {
draw(gl);
}
}
/**
* Should be overridden in subclasses and used to perform rendering.
*/
public void draw(GL10 gl) {
GLES10.glClear(GLES10.GL_COLOR_BUFFER_BIT | GLES10.GL_DEPTH_BUFFER_BIT);
}
}
and this is JPCT-AE render
public class RenderARESX extends ARRenderer {
private World mWorld;
private Camera mCamera;
private FrameBuffer mBuffer ;
Matrix projMatrix = new Matrix();
@Override
public boolean configureARScene() {
Config.useRotationPivotFrom3DS=true;
// Initialize the game world and the camera
mWorld = new World();
mWorld.setClippingPlanes(0.1f, 10000.0f);
mWorld.setAmbientLight(150, 150, 150);
mCamera = mWorld.getCamera();
// Load all objects to the world
for (AmbientElement ae: MainScene.getInstance ().getAmbientElementsList()) {
// init AmbientElement
if (!ae.initRendering(mWorld) ) {
// If there was a problem, return false
return false;
}
//Log.wtf("esx","getmMarkerId = "+ae.getTracer().getmMarkerId());
}
return true;
}
@Override
public void onSurfaceCreated(GL10 gl10, EGLConfig eglConfig) {
}
@Override
public void onSurfaceChanged(GL10 gl10, int w, int h) {
Config.useRotationPivotFrom3DS=true;
super.onSurfaceChanged(gl10, w, h);
mBuffer = new FrameBuffer(gl10,w,h);
}
float[] projection;
@Override
public void onDrawFrame(GL10 gl10) {
mBuffer.clear();
try {
projection = ARToolKit.getInstance().getProjectionMatrix();
projMatrix.setIdentity();
projMatrix.setDump(projection);
projMatrix.transformToGL();
SimpleVector translation = projMatrix.getTranslation();
SimpleVector dir = projMatrix.getZAxis();
SimpleVector up = projMatrix.getYAxis();
mCamera.setPosition(translation);
mCamera.setOrientation(dir, up);
for (AmbientElement ae : MainScene.getInstance().getAmbientElementsList()) {
ae.updateMarkerTransformation();
}
mWorld.renderScene(mBuffer);
mWorld.draw(mBuffer);
mBuffer.display();
}catch (Exception e){
Log.e("esx","ERRORE RenderARESX.onDrawFrame "+e.toString());
e.printStackTrace();
}
}
}
is it possible that this make the black part of the texture transparent GLES10.glClearColor(0.0f, 0.0f, 0.0f, 0.f); in ARtoolkit render?
I tried to change this but nothing happens.
Any idea how to solve this?