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 ... 12 13 [14] 15 16 ... 18
196
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.

197
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.

198
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.

199
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.

200
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.

201
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(); }
   }
}

202
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.

203
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?

204
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.

205
Support / default shader lighting problem
« on: August 29, 2016, 04:13:03 am »
i have a JPCT app ported to JPCT-AE. i see a grey object with default shader has color problem. its faces are either grey or total black according to light direction, look like very much overbrighted.
my device has PowerVR540 GPU and Android 4.2.2.
what could be the cause?

206
my approach is just using projective texture, except the receiver is a seperate small simple  object3d instead of a large complex object3d.
i found i could clear the alpha channel of rtt by a full window quad mesh with shader: gl_fragcolor=vec4(0,0,0,0)
then i can draw opaque object in the rtt.
using shader to render the receiver without alpha information can work too.

207
Support / trying to make fake shadow with RTT texture applied to a mesh
« on: August 20, 2016, 05:34:56 pm »
i am trying to make fake shadow. my approach is like this:
stick a transparent mesh on an object3D which should be a shadow receiver, but in fact the transparent mesh is the receiver;
render the shadow caster object into a texture and project the texture onto the transparent mesh;
the RTT should have alpha information - the part covered by shadow caster is opaque and black, other part is fully transparent.

now i wonder how to render into the alpha channel of RTT texture - i want to use openGL hardware framebuffer for the RTT task (faster) so the texture should be directly used in GPU (not downloaded for further process).
is setAsShadowMap() meant for this?

208
Support / Re: fog formula?
« on: August 19, 2016, 09:10:43 am »
i found the fixed function pipeline just uses linear fog. any other curve that i tried doesn't match in the render result.

209
Support / fog formula?
« on: August 18, 2016, 06:53:59 pm »
some parts of my scene are rendered with shader while some are not.
i need to know the formula of fog in GL's fixed function rendering and use it in shader so that all parts in the scene have the same fog effect.
i use these settings on the parts without shader:
setFogging(1);
setFoggingMode(1);
setFogParameter(100f,20000f, r,g,b)

210
Support / Re: get unloadTexture flag?
« on: August 17, 2016, 03:19:30 am »
because i have some large textures that i want to unload in a certain condition, and don't want them to be loaded accidentally.
i can write code like this:
if (Texture.isLoaded(frameBuffer)) TextureManager.unloadTexture(frameBuffer, texture);
but , i have other way : i can hide the object3d that has the texture, then the texture won't be loaded accidentally. so it's OK without knowing the flag.

Pages: 1 ... 12 13 [14] 15 16 ... 18