Hi, Dennis!
No matter how I adjust the Position, mCamera farPlane, nearPlane, or adjust the mSkybox Position, Scale, I see the box is always the same, but adjust the size of the FieldOfView after, depending on the mouth get bigger, and surface and surface of the joint between also appeared perspective effect, and now I don’t need this perspective effect, I need the ordinary Skybox effect, such as the Min3D Skybox effect, what have i got to do?
Does it always have to be animated/positioned individually or there’s a way to link it to the camera, so it moves according to it, like the rest of the scene?
Hi, Dennis. I tried to use skybox in Min3D and Rajawali. Skybox in Min3D load much faster than in Rajawali. Even a low-res skybox in Rajawali loads about 10 seconds (in Min3D only 1-2 seconds).
Hi,
Yes, Rajawali uses 6 textures for the skybox. That’s the reason why it takes longer to load.
This is a nicer way of doing things but not necessarily the best way. I will add the option to use a single texture to speed up things. Stay tuned
Thanks for Single Skybox, but it’s working very strange: after loading, the background image is too zoomed. I tried to use different images and change the parameter of “setFarPlane” method, but it makes no difference. Help please.
FATAL EXCEPTION: GLThread 727
java.lang.NullPointerException
at rajawali.materials.TextureManager.addTexture(TextureManager.java:257)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:204)
at rajawali.materials.TextureManager.reload(TextureManager.java:661)
at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:246)
at com.example.rajawalitut.RajawaliRendererThis.onSurfaceCreated(RajawaliRendererThis.java:37)
Hi, rajawali is really a cool framework
btw
I have experianced the issue above too while using the skyBox
I was testing onPause and onResume behavior of my app then it crashed just after turning on the screen with the same nullpointer exception:
java.lang.NullPointerException
at rajawali.materials.TextureManager.addTexture(TextureManager.java:257)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:204)
at rajawali.materials.TextureManager.reload(TextureManager.java:661)
at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:246)
it seemed that cubemapmaterialInfos have “null” compression type by default.
Ive just set my cubemapmaterialInfo’s compressiontype to NONE, then it worked.
and I had to reset it to NONE in onSurfaceChanged method becuase it was turning null again.
I dont know if this issue is just about the version of the android OS we used or if it is a bug. But this worked for me.
[...] to Rajawali Tutorial 5: Skybox. Tags: 3D, Android, OpenGL, OpenGL ES, optimization, [...]
[...] Rajawali Tutorial 5: Skybox [...]
Hi, Dennis!
No matter how I adjust the Position, mCamera farPlane, nearPlane, or adjust the mSkybox Position, Scale, I see the box is always the same, but adjust the size of the FieldOfView after, depending on the mouth get bigger, and surface and surface of the joint between also appeared perspective effect, and now I don’t need this perspective effect, I need the ordinary Skybox effect, such as the Min3D Skybox effect, what have i got to do?
Does it always have to be animated/positioned individually or there’s a way to link it to the camera, so it moves according to it, like the rest of the scene?
Thanks in advance
Hi, Dennis. I tried to use skybox in Min3D and Rajawali. Skybox in Min3D load much faster than in Rajawali. Even a low-res skybox in Rajawali loads about 10 seconds (in Min3D only 1-2 seconds).
Hi,
Yes, Rajawali uses 6 textures for the skybox. That’s the reason why it takes longer to load.
This is a nicer way of doing things but not necessarily the best way. I will add the option to use a single texture to speed up things. Stay tuned
Hi John,
There’s a faster skybox now. Just grab the latest version of Rajawali and read this post
http://www.rozengain.com/blog/2012/02/15/rajawali-tutorial-5-skybox/
Thanks for Single Skybox, but it’s working very strange: after loading, the background image is too zoomed. I tried to use different images and change the parameter of “setFarPlane” method, but it makes no difference. Help please.
Is it possible to completely remove a skybox from the scene?
^ Answered my own question. You should destroy it and set it to null.
FATAL EXCEPTION: GLThread 727
java.lang.NullPointerException
at rajawali.materials.TextureManager.addTexture(TextureManager.java:257)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:204)
at rajawali.materials.TextureManager.reload(TextureManager.java:661)
at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:246)
at com.example.rajawalitut.RajawaliRendererThis.onSurfaceCreated(RajawaliRendererThis.java:37)
I got this error and i have used below code.
@Override
protected void initScene() {
mCamera.setFarPlane(1000);
/*
* Skybox images by Emil Persson, aka Humus. http://www.humus.name
* humus@comhem.se
*/
setSkybox(R.drawable.posz, R.drawable.posx, R.drawable.negz, R.drawable.negx, R.drawable.posy, R.drawable.negy);
}
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
super.onSurfaceCreated(gl, config);
mLight = new DirectionalLight(0.1f, 0.2f, 1.0f); //set the direction
mLight.setPower(1.5f);
Bitmap bg = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.selera_sari);
mSphere = new Sphere(1, 12, 12);
DiffuseMaterial material =new DiffuseMaterial();
mSphere.setMaterial(material);
mSphere.setLight(mLight);
mSphere.addTexture(mTextureManager.addTexture(bg));
addChild(mSphere);
//mCamera.setZ(-4.2f);
}
@Override
public void onDrawFrame(GL10 glUnused) {
// TODO Auto-generated method stub
super.onDrawFrame(glUnused);
mSphere.setRotY(mSphere.getRotY() + 1);
//mSphere.setRotX(mSphere.getRotX() + 1);
}
setSkybox method is not working in wallpaper template.
Hi, rajawali is really a cool framework
btw
I have experianced the issue above too while using the skyBox
I was testing onPause and onResume behavior of my app then it crashed just after turning on the screen with the same nullpointer exception:
java.lang.NullPointerException
at rajawali.materials.TextureManager.addTexture(TextureManager.java:257)
at rajawali.materials.TextureManager.addTexture(TextureManager.java:204)
at rajawali.materials.TextureManager.reload(TextureManager.java:661)
at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:246)
it seemed that cubemapmaterialInfos have “null” compression type by default.
Ive just set my cubemapmaterialInfo’s compressiontype to NONE, then it worked.
and I had to reset it to NONE in onSurfaceChanged method becuase it was turning null again.
I dont know if this issue is just about the version of the android OS we used or if it is a bug. But this worked for me.
cubeMapInfo.setCompressionType(rajawali.materials.TextureManager.CompressionType.NONE);
by saying cubeMapMaterialInfo, I meant the TextureInfo object that holds the cubemaptextures.
Hi,
I dont know to load background image ,Pls can anyone help me on this