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 - MichaelJPCT

Pages: 1 ... 5 6 [7] 8 9 ... 12
91
Support / can framebuffer be smaller than sceen?
« on: September 03, 2016, 06:16:01 pm »
i have an idea that i want to keep the game window's aspect ratio, for example 16:9, while the screen of device is usually not accurately 16:9.
can i have a framebuffer smaller than the screen and keep some black margins around the framebuffer?

92
Support / Re: default shader lighting problem
« on: September 01, 2016, 01:30:30 pm »
the way i judge specular effect is that when viewed from different angles, a polygon has different light intensity. that is what "diffuse" lighting can't have.

93
Support / Re: default shader lighting problem
« on: September 01, 2016, 12:14:35 pm »
do you mean you see specular effect with the new jar?
i tested my app on another device with powervr 544 and IPS(better color) screen, i still don't see the effect similar to desktop version.
settings are the same as desktop.

94
Support / Re: questions about render-to-texture
« on: August 31, 2016, 07:04:10 pm »
i have some more questions about RTT.
rtt is only stored in vram, can i call unloadTexture on a rtt texture?
can a rtt texture be freed in order to save vram?
if a rtt is freed from vram, will calling setRenderTarget re-create the rtt ?
if vram is full, what will happen if one more texture is needed for render?

95
Support / Re: blitting problem in rtt
« on: August 31, 2016, 06:48:52 pm »
thanks , it works.

96
Support / blitting problem in rtt
« on: August 31, 2016, 09:31:02 am »
i found if i draw object3d in rtt (with World,Camera), then blitting in rtt had wrong size - much larger.
my rtt texture size is 128x32.

97
Support / no setDepthBufferWrite?
« on: August 31, 2016, 08:13:16 am »
i have an object (a sky plane, or sky dome) which should not affect depth buffer. but in JPCT-AE there is no setDepthBufferWrite(), so now i have to clear depth buffer after drawing the sky.
it would be better if there is the setting.
also, setDepthBufferTest() could be useful too.

98
Support / Re: default shader lighting problem
« on: August 31, 2016, 06:11:13 am »
i think using an empty world to reset fov is good enough. just that more operations are done than simply changing the frustum. if cpu speed is high enough, it's ok.

99
Support / Re: default shader lighting problem
« on: August 30, 2016, 04:33:48 pm »
ok, my objects are all compiled, so that i didn't change lightmul in desktop app.

100
Support / Re: default shader lighting problem
« on: August 30, 2016, 12:27:10 pm »
my desktop app has noticeable specular effect.
my desktop app uses hardware GL, so max lightmul is 1 , right?
i didn't set lightmul in it.

101
Support / Re: default shader lighting problem
« on: August 30, 2016, 11:00:37 am »
i tested the newer version of jar, but i didn't see any specular effect.
my settings specterm=20 specpow=90.

102
Support / Re: default shader lighting problem
« on: August 30, 2016, 06:06:42 am »
this is test code, you'll see a white square on top left corner and it moves a little.
if your screen has high resolution, maybe it's less noticeable, test screen is 1024x600.

package abc.def;
import com.threed.jpct.*;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.opengles.GL10;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.app.Activity;

public class Sim extends Activity {
   static GLSurfaceView GLview;
   static MyRenderer renderer;
   static FrameBuffer fb;
   static World world=new World();
   static Camera cam=world.getCamera();
   static Texture tex;
   static float fov=0.1f;

   protected void onCreate(Bundle a) {
      super.onCreate(a);
      renderer=new MyRenderer();
      GLview=new GLSurfaceView(getApplication());
      GLview.setEGLContextClientVersion(2);
      GLview.setRenderer(renderer);
      setContentView(GLview); }
   @Override
   protected void onPause() { super.onPause(); GLview.onPause(); }
   @Override
   protected void onResume() { super.onResume(); GLview.onResume(); }
   @Override
   protected void onStop() { super.onStop(); }

   class MyRenderer implements GLSurfaceView.Renderer {
      public void onSurfaceCreated(GL10 g,EGLConfig c) {}
      public void onSurfaceChanged(GL10 g,int w,int h) {
         if (fb!=null) fb.dispose();
         fb=new FrameBuffer(w,h);
         cam.setFOVLimits(0.0001f,10f);
         cam.setClippingPlanes(0.1f,100f);
         tex=new Texture(1,1,new RGBColor(200,200,200));
         TextureManager.getInstance().addTexture("tex",tex);
      }
      public void onDrawFrame(GL10 g) {
         fb.clear(); cam.setFOV(fov);
         fov-=0.001f; if (fov<0.01) fov=0.1f;
         world.renderScene(fb); world.draw(fb);
         fb.blit(tex,0,0,10,10,0,0,80,80,-1,false);
         fb.display(); }
   }
}

103
Support / Re: default shader lighting problem
« on: August 29, 2016, 10:10:14 am »
also , i found a problem with blitting.
if before blitting, the fov is very small (say 0.05 rad), the blit result is inaccurate - text distorted/biased.
can you reset the fov to a normal figure before blitting?
i use an empty world to reset the fov as a temperary solution for now.

104
Support / Re: default shader lighting problem
« on: August 29, 2016, 10:02:12 am »
great! thanks!
will you fix it based on the version with correct camera nearclip/farclip/fov settings?

105
Support / Re: default shader lighting problem
« on: August 29, 2016, 09:44:43 am »
i found it was setSpecularLighting(true) that cause the problem.
but even if specpow=0 specterm=0 , the problem is still there.
here is a screenshot without specular.

Pages: 1 ... 5 6 [7] 8 9 ... 12