Main Menu
Menu

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.

Show posts Menu

Messages - EgonOlsen

#11836
Support / launching problem
July 21, 2005, 10:23:46 AM
Looks fine to me at first glance. Maybe your scene is simply dark now. OpenGL's lighting mode is multiplicative, i.e. an ambient lighting of (0,0,0) will make everything dark. Try to draw a wireframe using world.drawWireframe(...) and see if something happens.
The command queue is a queue that the renderer uses internally because it has to do some tricks to get jPCT rendering into a canvas. Set Config.glVertexArrays=true to minimize the size of that queue.
#11837
Support / launching problem
July 21, 2005, 12:13:49 AM
Are you actually using the Canvas that enableGLCanvasRenderer(<int>) returns you? Maybe you are just using the legacy software renderer for output. A small introduction to the different renderers:

When creating a new FrameBuffer, it is in legacy software mode. Legacy mode stinks. Don't use it. To switch to another one, you can do:

buffer.enableRenderer(IRenderer.RENDERER_SOFTWARE);

This will give you a software renderer in OpenGL lighting mode. This is what you want, if you have no hardware support for OpenGL.
To see the results, you usually paint the rendered image into a component using buffer.display(<Graphics>).

To get OpenGL support via hardware, you first have to disable software rendering (or it will continue to be used together with hardware...possible but senseless in almost every case):

buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL);

You'll get a native LWJGL window (if sizes and color depth are fine). Considering your app, this is most likely not what you want.

And then there is the AWTGLCanvas support. To use it, do:

buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
Canvas c=buffer.enableGLCanvasRenderer(IRenderer.MODE_OPENGL);
<Component>.add(c);
// your gameloop:
//...do your rendering here...
buffer.display(null);
c.repaint();

Edit: If you want to use the AWTGLCanvas, download the latest jar as it fixes some bugs in it: http://www.jpct.net/download/jpct107a2.jar
#11838
Support / Re: similar problem
July 20, 2005, 11:52:31 PM
Quote from: "manumoi"
new KeyMapper(myFrame);
Try to init it with jPCT's canvas instead of the frame or panel.
#11839
Support / launching problem
July 20, 2005, 11:44:34 PM
Seems like you are lauching your app from inside the AWT event dispatch thread...not a good idea, because that will block this thread forever, i.e. you'll get no more key events or repaints of other components. Try something like


new Thread() {
  public void run() {
       Test t = new Test(args);
       t.panel3D.start();
  }
}.start();


in the actionPerformed(...) method instead and see if it helps.

Edit: And by the way: buffer.enableGLCanvasRenderer(IRenderer.RENDERER_SOFTWARE);
is not correct. You are supposed to give a mode there, not a renderer. I.e. IRenderer.MODE_OPENGL or (possible, but not advised...don't do it) IRenderer.MODE_LEGACY. But that's not the reason for your problem, as the values of both constants are the same anyway... :wink:
#11840
Projects / Technopolies
July 20, 2005, 11:36:17 PM
I tried to reproduce it in a modified CarTest-example, i.e. changed it to use the AWTGLRenderer, loaded your trees instead of my plants and placed 2K of them on the map. Had fog enabled and the car was emitting light...just like in Technopolies, but it worked just fine. No blinking at all. If this is a jPCT problem, it must be a very strange one.... :?:
#11841
Projects / Technopolies
July 20, 2005, 10:23:12 PM
But at least some translations on transparent objects (i don't know exactly how to detect a tree, so i limited it to transparent objects) are happening from inside a netty-evt-thread:

com.threed.jpct.Object3D@b51c29Thread[main,5,main]/(228.44463,627.73645,148.74597)---
com.threed.jpct.Object3D@4bf53eThread[netty-evt-0,5,main]/(383.0,667.0,162.75)---
com.threed.jpct.Object3D@d1e7c2Thread[netty-evt-0,5,main]/(252.60387,475.0233,118.229996)---
com.threed.jpct.Object3D@c68a98Thread[main,5,main]/(237.27441,624.1358,150.66376)---
com.threed.jpct.Object3D@b51404Thread[netty-evt-0,5,main]/(393.0,508.5864,160.44)---
com.threed.jpct.Object3D@354749Thread[netty-evt-0,5,main]/(327.56393,472.576,170.94)---
com.threed.jpct.Object3D@1db484dThread[main,5,main]/(246.53288,620.346,144.48578)---
com.threed.jpct.Object3D@bf1d3bThread[netty-evt-0,5,main]/(406.24905,725.4451,121.59)---
com.threed.jpct.Object3D@cc0e01Thread[netty-evt-0,5,main]/(289.96194,466.99997,161.49)---
com.threed.jpct.Object3D@ab7165Thread[main,5,main]/(256.31824,616.3402,138.6347)---
com.threed.jpct.Object3D@19a37aThread[netty-evt-0,5,main]/(410.00003,613.0,150.78)---
com.threed.jpct.Object3D@13bdd36Thread[main,5,main]/(265.8971,612.4185,136.0576)---
com.threed.jpct.Object3D@1381960Thread[main,5,main]/(275.305,608.56665,135.85318)---
com.threed.jpct.Object3D@9fa8fThread[netty-evt-0,5,main]/(432.49133,679.6593,150.15001)---


Or maybe it's a problem with the quadtree somehow? I also managed to get a "blinking house" once or twice.
#11842
Projects / Technopolies
July 20, 2005, 09:09:39 PM
Quote from: "rolz"nice to see you back :)

for 4 type of terrains ( dirt, rocks, grass and sand),  and 10 levels of transitions 62 textures were generated. I used 64x64 images for tile textures.
I was never gone. :wink:
So that means around 1MB of textures...that's not much, i thought it would require more.
I noticed some jPCT/AWTGLRenderer related problems in your client and i spent some time today to get rid of them. I've uploaded a new version that includes this fixes here:

http://www.jpct.net/download/jpct107a2.jar

Changes are:

Fixed a threading issue in the AWTGLRenderer when changing the FOV. Added the option to blit into the backbuffer. This is a fix for a problem that occures when one tries to blit into the background of a over-/undersampled framebuffer. Added on option to modify sorting order of the VisList. Can be helpfull in case of sorting issues with transparent objects. Added on option to Loader to disable vertex sharing (helpfull for loading otherwise unusable keyframes in some cases). Added a new constructor to Texture to create Textures directly from Images. Improved texture loading a little bit.
Some fixes for the AWTGLRenderer: Fixed an occasional class cast exception when setting RGB-Scaling. Fixed a stupid bug that caused green color values to be mapped to green and blue when rendering (i can't believe that this one remained unnoticed). Modified frustum handling to cover a problem that could occur if two or more frames lie between two actually painted ones and the fov has been changed in between. Fixed a bug that prevented the command queue from being resized when needed in some cases which could result in some polygon missing for a frame or two. Fixed a bug that caused queued commands to be removed from the queue in some cases.



However, there still is a problem which i couldn't get fixed and i'm at a point where i'm having my doubts that's its reason can be found in jPCT but in the client. The problem is: Trees are flickering/disappearing (not sure what they really do) sometimes for a frame. I'm not talking about the "normal" sorting problems on transparent objects...this must be something different. To me, it looks like a kind of threading problem (because i had this kind of problems myself on hyperthreading/dual cpu machines). I'm just not sure if it's located in my code (i doubt it because it seems to affect trees only) or in yours. Are you by any chance doing some matrix/object/world/...-manipulation in a different thread than the one that executes the calls to World.renderScene() or World.draw()? Or in other worlds: Is there a chance that rendering and manipulation of the scene and/or objects interfere sometimes?
#11843
Projects / Technopolies
July 19, 2005, 11:43:26 PM
The texture transitions are very well done. How much texture data does this approach produces?
Using OpenGL acceleration for AWT is a bad idea at least on my machine (WinXP, P4HT, Ati X800XT-PE), because it flips RGB to BGR (i.e. the loading screen is blue and the character screen brown (with a blue body)) and the VM crashes hard when i'm clicking into the chat window. It works fine using the normal AWT pipeline. Why are you limiting max. memory to 64MB? Isn't that a bit on the short side?
#11844
German corner / Textures ohne X11
July 18, 2005, 10:59:41 PM
Das Problem liegt bei Java bzw. bei AWT...es läuft unter Unix standardmäßig nicht ohne X11 Server. Um das zu lösen, gibt es mehrere Ansätze.

1. X11-Server installieren (Ja, nicht immer eine gute Lösung...)
2. X11-Dummyserver installieren (z.B. Xvfb)...das soll gehen, ich habe es aber noch nie probiert
3. Java 1.4+ im Headless-Mode betrieben. Dazu muss man einen Aufrufparameter angeben: -Djava.awt.headless=true
Aber auch damit geht nicht alles...manches wirft eine HeadlessException. jPCT als API sollte damit aber gehen.
#11845
Support / Changing textures!
July 11, 2005, 09:29:37 AM
The for whole Object3D (i.e. one texture for the whole mesh), use setTexture(...) in Object3D. If you want to modify only parts of the object, things are more complicated and you can use the PolygonManager for this. An example: for (int i=0; i<level.getMesh().getTriangleCount(); i++) {
         level.getPolygonManager().setPolygonTexture(i,TextureManager.getInstance().getTextureID("ql1.jpg"));
}


If you want to modify the texture's pixel data itself, you can use a ITextureEffect for that. But beware that this may be slow when using OpenGL.

Hope this helps.
#11846
News / Gooooooogle Adsense
July 08, 2005, 05:18:48 PM
I've added Google's Adsense to the site. Maybe this helps to cover the hosting costs of jpct.net...but i somehow doubt it. Well, it's worth a try. I hope the ads are not too distracting...
#11847
Support / collision detection
July 05, 2005, 12:09:28 AM
Because your models should collide with others objects (models or the level) but each one should act as a collider itself to others, you have to use a combination of both modes on your model(s).
Try:

model.setCollisionMode(Object3D.COLLISION_CHECK_SELF|Object3D.COLLISION_CHECK_OTHERS);
#11848
Support / Background Images
July 04, 2005, 09:20:17 PM
I've added a new constructor to Texture that offers a possibility to create a Texture directly from an Image. Now you can do something like this to load and rescale your image before making it a texture:


Image image=Toolkit.getDefaultToolkit().getImage(<yourfile>);
MediaTracker myTracker=new MediaTracker(new Canvas());
myTracker.addImage(image, 0);
try {
   myTracker.waitForAll();
} catch (Exception e) {
  // do stuff here
}
image=image.getScaledInstance(512, 512, image.SCALE_SMOOTH);
TextureManager.getInstance().addTexture(<name>, new Texture(image));


I hope this helps to solve your problem. You can download this version by clicking the link i provided above. I've updated the jar.
#11849
Projects / Technopolies
June 29, 2005, 01:15:02 AM
Works fine (except for the bat directing to jre\...which doesn't work on my system), but i don't have a clue how to attack the NPCs. They are all standing around doing nothing (not even moving) but i don't know how to attack them... :?:
#11850
News / Forum? 2.0.16!
June 29, 2005, 01:06:05 AM
Yep! There are more updates for phpbb than there are for jPCT.