Show Posts
|
|
Pages: [1]
|
|
1
|
Game Development / Performance Tuning / floating performance, Take II
|
on: 2005-03-23 11:21:00
|
hello. opend a new one as old thread drifted away and grown to long.. about the float/double benchmarks: most benchs ive seen do the same "calculate something with three numbers" thing. this is wrong bench'ing as i guess, because no one has to "calculate" over the same number millions of times (except fractal iterations maybe) with three numbers, all this values then fit to vm-registers /real cpu-registers rather then real memory. that makes about big advandtage for the double, which is the "native cpu format". the fact that it is twice the data has no much impact, as all cpu-actions are 80bit at intel as someone wrote. i just redoing some those tests now, but it seems at the moment just beginning that float is nearly twice as fast on my old machine (Athlon 1.generation, 750mhz) than double. why this "strange" / "incompatible" results? i think is it just because i use some thousand floats, e.g. in arrays... and maybe some real program (ok maybe very rarely) uses more than three numbers... this may seem strange for some people, but for my part, my programs, game programs in fact :-) do so. thats why i extended my ram from the old 1k to now 256mb...  exact results will follow & greets Paul
|
|
|
|
|
2
|
Java Game APIs & Engines / OpenGL Development / Re: specular lightning broken?
|
on: 2005-03-19 08:08:49
|
|
now got it working too the reason was that i misunderstood "projection" and placed my camera postion on GL_PROJECTION stack. this is wrong, projection should do only last phase of prejection, the world-to-view transform is therefore splited to cam.positional treansform which i now placed in GL_MODELVIEW stack, and the real clean perspective projection which resides in GL_PROJECTION, all now working fine.
|
|
|
|
|
3
|
Java Game APIs & Engines / OpenGL Development / Re: strange crash
|
on: 2005-03-16 18:05:27
|
|
on my system: start -> screen: switch to demo resoulution -> screen: switch back *
thats all
no output on screen, nor on cosole. last echo is the java.exe command itself. WinXP, Athlon, Geforce2, SoundBlaster PCI
|
|
|
|
|
5
|
Java Game APIs & Engines / OpenGL Development / Re: Textures failing with Threads
|
on: 2005-03-13 16:28:40
|
|
hello bug gone... but don't know why. "cleaning" my code i changed some details, maybe execution order or something else, mostly in unposted code... and don't encountered the bug again. i checked it for a while for "maybe relevant" changes but found none to my honest opinion.
the only thread-interaction to my view is the "other thread fills buffer" thing, which is still there unchanged.
sorry for the inconvinience
if it reappears or i got any clue i'll post again.
sorry & thanks Paul
|
|
|
|
|
6
|
Java Game APIs & Engines / OpenGL Development / Textures failing with Threads
|
on: 2005-03-12 15:46:15
|
Hello. I encountered a strange bug, reason seems "deep inside". on my system, LWJGL works fine.. ...except until i try texturing with multithreading. I am aware of the fact that OpenGL is a state machine, so ALL LWJGL commands are used in-order by just one thread. The only thing i do in fact "multithreaded" is writing the byte buffer for texturing. As result, textures vanish entirely as if glBindTextture / glTexImage would never been called. anyone any idea? seems to be inside java native code for the buffer or lwjgl native :-( snippets of the code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| package org.dronus.concept.gl;
import java.nio.*; import java.nio.ByteBuffer; import java.nio.ByteOrder;
import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL11;
public class Texture implements Renderer{ final int level=0, internalformat=3, border=0, format=GL11.GL_RGBA, type=GL11.GL_UNSIGNED_BYTE; protected int width,height,size; public ByteBuffer pixels; int texid; boolean ready=false; public Texture(){ IntBuffer idbuf = BufferUtils.createIntBuffer(1); GL11.glGenTextures(idbuf); texid = idbuf.get(0); } public void setSize(int s){ height=width=s; size=width*height*4; if (pixels==null){ if (size<=0) throw new RuntimeException("setSize() first!"); pixels = ByteBuffer.allocateDirect(size); pixels.order(ByteOrder.nativeOrder()); } } public void putPixels(byte[] bytes){ pixels.put(bytes); } public void putPixel(int r, int g, int b, int a){ pixels.put((byte)r);pixels.put((byte)g); pixels.put((byte)b); pixels.put((byte)a); } public ByteBuffer getBuffer(){return pixels;} public void update() { if (pixels!=null) { pixels.flip(); GL11.glBindTexture(GL11.GL_TEXTURE_2D,texid); GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); GL11.glTexImage2D(GL11.GL_TEXTURE_2D,level,internalformat,width,height,border,format,type,pixels); pixels=null; }else throw new RuntimeException("nothing to update!"); ready=true; }
public void render() { if (ready) GL11.glBindTexture(GL11.GL_TEXTURE_2D,texid); }; }
|
and 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| package org.dronus.concept.gl;
import org.dronus.concept.RandomEngine; import org.dronus.gloom.space.renderers.Detail;
abstract public class GeneratedTexture extends Texture implements Runnable{ RandomEngine seed; double time; Detail detail; boolean needsupdate; static boolean generating; public GeneratedTexture(RandomEngine seed) { this.seed=seed; } public void update(double time, Detail detail) { if (needsupdate ) { update(); needsupdate=false; generating=false; } if(width<detail.getTextureSize() && !generating) { needsupdate=false; generating=true; this.time=time; this.detail=new Detail(detail); Thread updater=new Thread(this); updater.start(); } } boolean running; public void run(){ setSize(this.detail.getTextureSize()); genTex(seed, time, detail); needsupdate=true; } abstract public void genTex(RandomEngine seed, double t, Detail d); }
|
the buffer is written inside genTex. by replacing updater.start(); with updater.run(); it runs reliable. also it runs sometimes, if started "fresh", eg. opengl not used for longer times, but mostly not. it also works more often if amount or size of textures is heavily increased. strange, eh? i would be grateful for eny idea Paul
|
|
|
|
|
7
|
Java Game APIs & Engines / OpenGL Development / specular lightning broken?
|
on: 2005-03-08 23:04:18
|
hi got some probs, dont know wether they are due to lwjgl, opengl or stupidness  : specular highlights don't move on objetcs if i just move the viewer. but they should. moving lightsources produces moving lights. i just state the circumstances which maybe affect this: i set the projection stack every frame with glLoadIdent, glFrustrum and gluLookAt. i enabled local lightning as stated in docs via GL11.glLightModeli(GL11.GL_LIGHT_MODEL_LOCAL_VIEWER, GL11.GL_TRUE); i only draw via compiled display-lists is there anything i forgotten? thanks for help Paul
|
|
|
|
|
8
|
Java Game APIs & Engines / OpenGL Development / Re: Diplaylists & GLU primitives
|
on: 2005-02-28 12:09:03
|
|
Got a clue The other parts of the list are drawn, but black. with lighting disabled, all geometry reappear. This not only apply to display list, but also to instant rendering. This is strange, AFAIK GLU only renders geometry not bothering about light/material attributes. but they seemed to mess up when a GLU primitive is included. any idea?
|
|
|
|
|
9
|
Java Game APIs & Engines / OpenGL Development / Diplaylists & GLU primitives
|
on: 2005-02-28 11:08:28
|
|
Hello. I thought a gl list could consist every rendering-related gl command. But when i use org.lwjgl.opengl.glu.Quadric for exaple, the quadric seems to "delete" all other content of my list. so is only one glBegin / glEnd block allowed inside the display list? or is GLU doing some other nasty things that destroys the other display list content? I tried out that order is no reason, there is no difference if i draw the GLU-quadric before or after the other contents of the display list, which will vanish at any case.
thanks for help
|
|
|
|
|
10
|
Java Game APIs & Engines / Java 2D / Re: ImageIO / Java Web Start bug: Workaround
|
on: 2005-02-20 13:28:07
|
|
Simple workaround:
Store images uncompressed gif /png are already compressed and will get euqal or maybe even bigger in size if zip'ped. So I JARed my application without gfx, and used a zip packer to add the gfx with compression factor = zero. this worked well for all my apps. (and its no "dirty" fix as JAR gets smaller most times...)
|
|
|
|
|
11
|
Game Development / Shared Code / Re: isometric tiles in Java2D w/ scrolling
|
on: 2005-02-20 08:28:57
|
|
I suggest performance by balancing:
two things you have to weight up against each other:
-time to convert data -time to copy data
when you draw more surface than actually seen (and you do, as rectified tiles overlap here) maybe a backbuffer-and-copy strategy would be better. i experienced that in my game. the reason is that your images (paletted gifs for example) need to be converted to screen mode which is 24/32bpp mostly and can have several different alignments of data (bitmap type; eg INT_RGB, BYTE etc..)
so there are three different ways to use:
-draw directly to a flip-buffer (as you do, if it is available) pro: less to draw con: every tile, and so more then actually visible surface is converted every time drawn
-draw to a backbuffer that exactly matches image-bitmap-mode (eg. paletted mode with global palette for gifs) pro: conversion is only done once for exact the whole visible surface con: whole surface will be converted even if less is drawn (eg. no scrolling but moving sprites), for gif's a global palette is needed
-convert all images first pro: no conversion at runtime at all con: heavy memory footprint
for me the last worked best in fact i copy every loaded image to a same-sized bitmap with the exact properties of the output-screen, and use this new duplicates for drawing. if all works, no conversen is done then. this even accelarates alpha-channel blits i used a lot, but these are allways many times slower than direct blit.
hopes that helps Paul
|
|
|
|
|
12
|
Games Center / Archived Projects / Re: XAP - maniac experience
|
on: 2005-02-17 18:07:59
|
seems cas is everywhere it smells of games ..."One day people will make remakes of my games  ".. i HAD to do so... i remember somewhere back in the 90's as i see cas's xap first it was a real impact.. i still own my amiga computer, and as i tested it one year ago... after years of disuse.. well, i plugged it and it worked.. and one of the first things i tried was to bring xap back to life. it was one relic of the good'ol times... shortly after that i glued myself to my comp and 2 weeks later released xap!.. after some time of disinterest, i got some visitors to it, and as i tracked their referer: it was an board thread of cas, just found my remake. i greatly admire he took it with pleasure, as in fact he tried to sell alienfluxx at that time... but no, he had no problem doing some very effective promotion for my remake :-) thx, cas. i hope you sell some copys of it, as i remember you stated xap orignial was not selled effectivly, the highscore on puppygames seemes that its now better. (the interest in xap! today is very poor...but tats no economic question for gods sake. in fact the whole highscore is made of friends of mine who for some reason seemed more glued to the game..) thx for response & greetz Paul P.S. game is finished now except details, so control won't change, as this would be some inpact on gameplay i guess.
|
|
|
|
|
13
|
Games Center / Archived Projects / XAP - maniac experience
|
on: 2005-02-15 13:30:28
|
XAP! This is a creative manic arcade game, a not-so-stupid, maybe quite smart shooting game. 250kb achieve quite nice graphics & sound. It runs as browser applet, can also be downloaded and started as application, but then online highscore logging is disabled. http://hirnsohle.de/xapentry.htmwould be very pleased to see some comments of yours about here. thx & greets Paul
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|