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 ... 9 10 [11] 12 13 ... 18
151
Support / about multi-texture, different stages inside an object?
« on: June 24, 2017, 06:38:08 am »
the TextureInfo/PolygonManager method gives me an impression that polygons in an object3D can have different tex stages, such as polygon A has 3 stages while polygon B has 2 stages. is it correct?

152
Support / how to identify the version of the engine jar file
« on: June 14, 2017, 07:23:17 am »
when i have multiple copies of the jar file in different places, i want to know which file is newest or most suitable.
currently i can only check the size or time of the file. but these are both unreliable.

153
Support / Re: is result of setboundingbox permanent?
« on: June 14, 2017, 05:22:50 am »
in my actual app, the shape is a quad -- 2 triangles, same problem.
do you mean the new version would slow down particle rendering? if so , i would prefer the old version. there is other way to solve the culling problem - make the shape larger and modify the shader.
since you don't keep branches of the engine, i like the one with faster performance. you just need to tell (in javadoc) people why setBoundingBox doesn't work in some case.

154
Support / Re: is result of setboundingbox permanent?
« on: June 13, 2017, 07:22:34 am »
see below. in the sample, you can see a triangle suddenly disappears when fov changes, while it shouldn't.
i found if the shape is created by Primitives.getBox, setBoundingBox works correctly.

Code: [Select]
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 rend;
static FrameBuffer frmBuf;
static World world=new World();
static Camera cam=world.getCamera();
static float fov=1f;
static Object3D shape;
static String glslV="uniform mat4 modelViewProjectionMatrix;"+
"attribute vec4 position; void main(){ vec4 p=position;"+
"p.y*=2.0; gl_Position=modelViewProjectionMatrix*p; }";
static String glslF="void main(){gl_FragColor=vec4(1,1,1,1);}";
static GLSLShader glsl=new GLSLShader(glslV,glslF);

protected void onCreate(Bundle a) {
super.onCreate(a);
rend=new MyRenderer();
GLview=new GLSurfaceView(getApplication());
GLview.setEGLContextClientVersion(2);
GLview.setRenderer(rend);
setContentView(GLview); }

class MyRenderer implements GLSurfaceView.Renderer {
public void onSurfaceCreated(GL10 g,EGLConfig c) {
shape=new Object3D(new float[]{5,0,0,0,-5,0,-5,0,0},null,new int[]{0,1,2},-1);
shape.build();
shape.setBoundingBox(-100,100,-100,100,-100,100);
world.addObject(shape);
shape.translate(0,15,50);
world.setGlobalShader(glsl);
cam.setFOVLimits(0.001f,1); }
public void onSurfaceChanged(GL10 g,int w,int h) {
if (frmBuf!=null) frmBuf.dispose(); frmBuf=new FrameBuffer(w,h); }
public void onDrawFrame(GL10 g) {
frmBuf.clear();
fov-=0.002;
if (fov<0.1) fov=1f;
cam.setFOV(fov);
world.renderScene(frmBuf);
world.draw(frmBuf);
frmBuf.display(); } }

}


155
Support / Re: is result of setboundingbox permanent?
« on: June 11, 2017, 06:56:29 am »
i tried, smaller value has no effect either.

156
Support / Re: is result of setboundingbox permanent?
« on: June 09, 2017, 04:54:28 pm »
i tried calling getBoundingBox immediately after setBoundingBox, the value i got was the small, original one, not the larger one i set.
but the javadoc says getBoundingBox triggers a recalculation, so getBoundingBox  should output the original value, right?

157
Support / Re: is result of setboundingbox permanent?
« on: June 09, 2017, 11:15:46 am »
i called setBoundingBox with larger values, then called getMesh().getBoundingBox(). i got the small , original values.
and i am sure my program doesn't change the BB after i call setBoundingBox.

158
Support / Re: is result of setboundingbox permanent?
« on: June 08, 2017, 08:52:41 am »
how to obtain the BB? i don't see getBoundingBox() method.

159
Support / Re: is result of setboundingbox permanent?
« on: June 07, 2017, 09:20:31 am »
i am sure setboundingbox is called after build().
after i create the object3d, i call getMesh().compress() -> build() -> strip(), can these affect the result?

160
Support / Re: is result of setboundingbox permanent?
« on: June 06, 2017, 08:57:58 am »
my shader modifies vertex position so that the model look larger than the actual Mesh defined.
but the bound box is as large as the defined Mesh.
so if a small portion of the modified model should be visible but the defined Mesh is out of view, the model is not rendered.
so i want to enlarge the bound box to be the same as the modified model.
but it didn't work - the model is still not rendered if the defined Mesh is out of view.

161
Support / Re: is result of setboundingbox permanent?
« on: June 06, 2017, 06:55:12 am »
i tried setboundingbox at runtime, after build(), but i didn't see any effect - the bound box was still small.

162
Support / Re: shared shader but unshared uniform parameter?
« on: June 06, 2017, 06:50:56 am »
i found that it's not too much trouble.

163
Support / shared shader but unshared uniform parameter?
« on: June 05, 2017, 08:31:36 am »
http://www.jpct.net/forum2/index.php/topic,3965.msg27866.html#msg27866

i search the forum and found the above thread and maybe it's the same question as i have.
i hope to use 1 shader instance for multiple objects but their uniform parameters are different.
is the solution in the above thread the only solution?
is it more troublesome than using 1 shader for each object? is it worth the trouble?

164
Support / is result of setboundingbox permanent?
« on: June 05, 2017, 07:31:54 am »
i want to enlarge a bound box as the shader for the object3d enlarges the object.
after i setboundingbox, is there anything in the engine that may reverse the bound box back to the smaller one?
i ask this question because another engine would recalculate the bound box automatically.

165
Support / Re: How to do "Fog" in particular axis?
« on: June 05, 2017, 06:55:14 am »
i guess it is called "layered fog". it requires shader and quite much calculation.
but somtimes you can do fake fog - use a transparent plane with foggy texture.

Pages: 1 ... 9 10 [11] 12 13 ... 18