Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kiffa

Pages: 1 ... 6 7 [8] 9 10 ... 14
106
Support / Re: Some issues abuout rendering when camera moving out.
« on: February 26, 2013, 02:58:15 am »
Log:

02-26 09:55:59.560: D/Woo3d(15288): GL vendor:NVIDIA Corporation
02-26 09:55:59.560: D/Woo3d(15288): GL renderer:NVIDIA Tegra

02-26 09:55:58.580: D/Woo3d(15288): choose EGLConfig: CSAA enabled!
02-26 09:55:58.580: D/Woo3d(15288): Unable to find a matching config...using default!
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_RED_SIZE: 8
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_GREEN_SIZE: 8
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_BLUE_SIZE: 8
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_ALPHA_SIZE: 8
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_DEPTH_SIZE: 16
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_RENDERABL_TYPE: 4
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_SAMPLE_BUFFERS: 0
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_SAMPLES: 0
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_STENCIL_SIZE: 0

107
Support / Some issues about rendering when camera moving out.
« on: February 25, 2013, 02:29:22 pm »
With the same object3D and the same lookAt-vector, If i move camera out by Camera.moveCamera(CAMERA_MOVEOUT, distance); some abnormal things will happen:

1, the aliasing between boundaries will be rather obvious.

2, some transparency issues(I'm not very sure, but the appearance seems like that), i.e, some parts of an opacity object3D will be transparent and the object3D behind it will be visible.

3, when rotating object3D/camera, the aliasing between boundaries is rather obvious.

Some images:

1, With the near camra,  the aliasing is not obvious:



2, With the far camera, the aliasing is obvious:



3, With the rotating, the aliasing is obvious:

 

108
The width/height of texture(Framebuffer)  is 256/256. So i think the dimension is not the problem. I will try to execute the normal render sequence on the render target as you suggesting.

Some other questions:

I only render once, draw twice, because i want to get the best performance. Is World.renderScene() more expensive than World.draw()?

If i don't render to target, but draw twice to Framebuffer, the result seems good, but if render to target, i got a black screen. So are there some difference between render to framebuffer and render to texture?

The result of rendering to Framebuffer:

Codes:
Code: [Select]
frameBuffer.clear();
world.renderScene(frameBuffer);
world.draw(frameBuffer);

Config.viewportOffsetX += 0.1f;
obj.setTransparency(150);
world.draw(frameBuffer);

Config.viewportOffsetX += 0.1f;
obj.setTransparency(100);
world.draw(frameBuffer);

Config.viewportOffsetX += 0.1f;
obj.setTransparency(50);
world.draw(frameBuffer);

Config.viewportOffsetX = 0;
obj.setTransparency(-1);




109
Support / Render to target, blit the texture, but got a black screen.
« on: February 02, 2013, 05:51:44 am »
I want to make the special effect like that:





What i do:
1,  Render skeleton animation, assume the frame sequences are  1\2\3\4\5\6...
2,  When rendering frame-1, first render to frameBuffer, then change the transparency  of obj3d, render frame-1 to a texture.
3,  When rendering frame-2, first render to frameBuffer, then blit the last render-target-texture(frame-1). So there are 2 obj3ds in frameBuffer now, one is frame-1 with  transparency, one is frame-2. then change the transparency  of obj3d, render frame-2 to a texture.
4, Goto step 3.

Problem:
When blitting, i got an black-screen. OpenglES 2.0, Code:

Code: [Select]
//onDrawFrame

frameBuffer.clear();
world.renderScene(frameBuffer);
world.draw(frameBuffer);

if(mTexture == null){
      mTexture = new Texture(frameBuffer.getWidth(), frameBuffer.getHeight(), 100);
      Log.d(D.TAG, "texture width: " + mTexture.getWidth());
      Log.d(D.TAG, "texture height: " + mTexture.getHeight());
}
else {
      frameBuffer.blit(mTexture, 0, 0, 0, 0, frameBuffer.getWidth(), frameBuffer.getHeight(), FrameBuffer.TRANSPARENT_BLITTING);
}

obj.setTransparency(100);  // Adjust Config, so transparency value is between 0 - 255;
frameBuffer.setRenderTarget(mTexture);
world.draw(frameBuffer);

frameBuffer.removeRenderTarget();
obj.setTransparency(-1);
 





110
Support / Some issues about materials and lights.
« on: January 30, 2013, 01:07:45 pm »
Does the engine support the materials of models?

For example, export .obj and .mtl, there are some materials data in .mtl, does the engine use them to calculate the lights effect?

Could i specify the ambient\diffuse\specular for Object3D\mesh?

Could i specify the ambient\diffuse\specular for lights?

111
Support / Some issues about Texture.defaultTo4bpp
« on: January 29, 2013, 06:52:28 am »
What does the 4bpp mean? 4 bits per pixel? If so, what's the pixel format? 1111?

Or it means 4 bits per pixel-component?  i.e 4444.

Texture.defaultTo4bpp defined the pixel format of textures in GPU, right? 

112
Support / Re: No supporting World.drawWireframe()?
« on: January 29, 2013, 06:46:21 am »
For example, move furnitures in a room, when pick up one furniture, i hope all the objects are Wireframed, so the users can align them easily.

113
Support / No supporting World.drawWireframe()?
« on: January 28, 2013, 10:42:42 am »
The java-doc of jPCT-AE doesn't say that, but a run time exception was thrown when running:

01-28 17:33:43.910: E/AndroidRuntime(2477): java.lang.RuntimeException: Wireframe rendering isn't supported ATM!

I want to use this method to do some special effects, could you add it? Thanks.

Another question: what's the "ATM" mean? At the moment?


114
Support / What does the "compiled objects"actually mean?
« on: January 26, 2013, 04:00:25 pm »
I want to know the difference between "uncompiled objects" and "compiled objects".

I have read the wiki, which describe  the advantages and disadvantages of compiled objects. But i want to know more details.

For example, the compiling process 、 the structures of compiled objects 、 why does it have the advantages/disadvantages... and so on.

Thanks.

115
I want to decrease the memory usage and the disk-space of .bones file.

What should i do to get the best result?

1, decrease the total frames of animation.

2, decrease the vertexes of the model.

3, decrease the joints of the model.

My obj has 1818 frames, 4947 vertexes, 18 joints.

116
Support / Could i only draw the object3Ds which are modified per frame?
« on: January 21, 2013, 09:56:10 am »
In my game, some scene has a fixed camera, so there are some object3Ds which are staying the same per frame(background, trees and so on).

I want to just redraw the object3Ds which are modified per frame(for example: animated objs), don't redraw the others.

How to do this? And how much is the difference of the performance between the 2 methods(one is redrawing all the objects per frame, the other is just redrawing the modified ones.) Could i keep some pixes in the framebuffer instead of refilling it?


117
The FrameBuffer.resize() method is just what i needed! Thanks!

 And when will you add this to an new version jar?

118
The window size i talked about is the layout size of an android-top-level-view(For my game, it's a GLSurafaceView).

My project is not a full-screen-activity game, but a small-floating-window game,  the game window will display on top of all other windows. 64*64 means a window of 64 * 64pixels, the jpct-world is drawn in this window(also means a 64*64 surface and  a 64*64 frameBuffer).

When my game start, the phone-screen can split to 2 windows, one is the game-window, one is the launcher(home\desktop...)window, the game-window will overlay on the launcher window. And the users can see and operate both of them.

May be also some confused, sorry for my english, if needed, i will show an Screen-Print image soon. Some codes:

Code: [Select]
GLSurfaceView gameWindow = new GLSurfaceView();
LayoutParams params = new LayoutParams();
params.width = 64;
params.height = 64;
 // A new window will be added to the WMS to show, and will call Renderer.onSurfaceCreate() -> onSurfaceChange(64, 64) -> onDrawFrame()
WindowManager.addView(gameWindow, params);

// scale window to 128*128
LayoutParams params = getCurrentParames(gameWindow);
params.width = 128;
params.height = 128;
WindowManager.updateViewLayout(gameWindow, params);  // will cause Renderer.onSurfaceChanged(128, 128);


And thanks for your advices, i will check the gl instance for context change and try the new method.

119
I am not clear when will the OpenGL context  lose and what the system do when the context lose. Please give me some advice.

What i want to do is that:
When window size changed, the world will auto-scale to the right size but without unloading the textures from gpu because i don't want to the delay.

If i change code to an empty implement:

Code: [Select]
// in class which implements Renderer
  public void onSurfaceChanged(GL10 gl, int width, int height)  {
    Log.d("jPCT-AE", "3d Renderer Surface Changed: " + width + ", " + height);
    Log.d("jPCT-AE", "3d Renderer Surface Changed: update frameBuffer");
   
  }

When the window size changed(64*64 to 128*128), the world didn't scale to 128*128, but all are rendering fine.

WindowSize: 64*64 -> 128*128

1, Before change code: the world will scale to larger after a delay

2, After change code: the world won't scale, but rendering fine, and there is almost little delay.

I am not clear if the OpenGL context will lose when the window(surface) size changed?  Or only when the surface destroyed, the context  lost.

I tried this: GLSurfaceView.setVisiable(GONE); 

Then the view will gone and the surface will destroy(GLSurfaceView.onDestroyed()), the OpenGL context seems to be destroyed,  but when i "GLSurfaceView.setVisiable(VISABLE)", things happened like this:

GLSurfaceView.surfaceCreate() -> GLSurfaceView.surfaceChanged() -> Renderer.onSurfaceCreate()(the method has an empty implement) -> Renderer.onSurfaceChanged()(the method has an empty implement)  -> onDrawFrame()

And this situation looks like the one of "window size changed": the world didn't scale, but render fine. 

Full codes:

Code: [Select]
// in class which implements Renderer

public void onSurfaceCreated(GL10 gl, EGLConfig config)
{
    Log.d("jPCT-AE", "3d Renderer Surface Created");
}

 public void onSurfaceChanged(GL10 gl, int width, int height)
{
    Log.d("jPCT-AE", "3d Renderer Surface Changed: " + width + ", " + height);

    if(mFirstEntry)  // mFirstEntry wiil change to false in onDrawFrame
    {
      initFrameBuffer(gl, width, height);
      getGameContext().setFrameBuffer(mFrameBuffer);
      initFpsShown(); // rely on initFramebuffer
      mGameLogic.onCreate();
    }
//  else if(getGameContext().getGameConfig().canWindowScale())
//  {
//    Log.d("jPCT-AE", "3d Renderer Surface Changed: update frameBuffer");
//    mFrameBuffer.dispose();
//    initFrameBuffer(gl, width, height);
//    getGameContext().setFrameBuffer(mFrameBuffer);
//    initFpsShown();
//  }

    mGameLogic.onResize(mFrameBuffer.getWidth(), mFrameBuffer.getHeight());
}




120
Support / Could i hold the textures on GPU when the surface size changed?
« on: January 11, 2013, 06:59:52 am »
In my app, the window size will change at some time, and i coded below to handle this:

Code: [Select]

  // in class which implements Renderer
  public void onSurfaceChanged(GL10 gl, int width, int height)  {
    Log.d("jPCT-AE", "3d Renderer Surface Changed: " + width + ", " + height);
    Log.d("jPCT-AE", "3d Renderer Surface Changed: update frameBuffer");

    mFrameBuffer.dispose();
    initFrameBuffer(gl, width, height);
    getGameContext().setFrameBuffer(mFrameBuffer);
    initFpsShown();
   
    mGameLogic.onResize(mFrameBuffer.getWidth(), mFrameBuffer.getHeight());
  }

The code "mFrameBuffer.dispose();" will unload all the textures from GPU. There are 2 problems:

1, The action of unloading and reloading will cause a rendering delay.

2, I need hold all the textures in vm memory(Texture.defaultToKeepPixels(true);) or use the Virtualizer(it will cause more delay because of I/O, and can't help with the peak of memeory) .

Could i rebuild other contexts but hold the textures on GPU when the surface size changed?


Pages: 1 ... 6 7 [8] 9 10 ... 14