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

Pages: 1 ... 126 127 [128] 129 130 ... 133
1906
Support / texture aliasing
« on: March 23, 2006, 08:50:07 pm »
hello,

this is what Egon said in an email:
Texture aliasing is an undersampling artifact that occurs, when only a few samples of a texture (due to the size of the polygon) are taken to draw the image.

Hardware is using mip mapping (i.e. smaller textures for smaller polygons in the distance) to work against this. The software renderer doesn't do this, because determining the correct mipmap level would be quite expensive. To prevent it (well, you can't really prevent it, just try to minimize the effect) use textures with less contrast and/or larger structures.


i guess, no matter how one selects a texture, he cannot avoid texture aliasing for objects like grass, trees etc due to the nature of thier texture.

so how to beat it when using software renderer ?

i thought of emulating mip mapping to some degree by re-assigning objects' textures based on distance, but i'm quite unsure if it worths a try. for trees it may help, but for large objects like ground it wont. (since camera is close to some part of object and far to other) this approach will also break 3DSLoader's multiple texture assignments to a single object. it requires an Object3D.recreateTextureCoords() each time the texture size changed (i dont know how expensive it is)

using PolygonManager to set textures per polygon instead of per object maybe an alternative but i guess doing that for every polygon will be a sure performance killer. also i dont know if there is a way of getting all polyon id's

so is there a nice solution for this ?
thx

Code: [Select]
r a f t

1907
Projects / aptal karga (foolish crow)
« on: March 23, 2006, 07:35:33 pm »
thx  :D
after the scene change and adding the lights the apperance really changed. my only problem is texture aliasing but i will open a topic about it

Code: [Select]
r a f t

1908
Projects / aptal karga (foolish crow)
« on: March 23, 2006, 05:04:30 am »
* fixed the so called 'climbing problem': avatars were climbing over others and some terrain objects when walking through.  thx Egon for the tip ;)
* added the LightsPanel to configure (place, move, delete, set color etc) lights in karga.
* changed the scene with a better one
* found and fixed a silly bug by chance: although one is always invisible, i was adding the same object twice for LoD purposes :/
* several other small improvements

behind lights panel world lights are displayed as cubes


a shot from new village


seems as a hot place ;)


Code: [Select]
r a f t

1909
Support / animation loop
« on: March 22, 2006, 10:58:21 pm »
considering my experience how much it differs between a timer based approach and animation loop, i agree with you: depending on sleep and other os timing measures is not good idea. i put it in my todo list, although not that urgent (since requires a lot of work :/)

if you dont run cpu to its limits everything is working fine, but the more you load the cpu the stranger the whole system behaves.

i also find it strange that there are so many articles, books etc suggesting fixed time step approach. it obviously eases some calculations but..

btw, i still cant figure out how on some machines that loop can run 2-3 times faster. i cant imagine how clock granularity and sleep inaccuracy may result this continuosly (it's not for a second or so, it just runs fast ??)

Code: [Select]
r a f t

1910
Support / animation loop
« on: March 21, 2006, 09:53:51 pm »
i see. so is there any alternative to sleep for fixed time step approach ? or do you mean making all things tickable is the only way ?

1911
Support / animation loop
« on: March 21, 2006, 04:22:36 am »
well, first of all this is not a jPCT question, it's about the strange behaviour of my animation loop on some rare machines. i have no idea why and when that happens, maybe you may have

i've taken the animation loop below from a book about Java games and slightly modified

as you can see, the main idea is to keep updates per second constant (as much as the desired fps = 1 / period). it works reasonably well on most machines (including my slow one) but on some rare ones, updates per second increases unexpectedly up to 2-3 times.  

i've no idea how that can happen ? i can only blame window's system clock granularity or sleep time inaccuracies (even with sleep time inaccuracies that loop shouldnt expected to run faster ??)

so do you have any ideas why this may happen ?
thx

edit: the mentioned book by Andrew Davison can be found online at http://fivedots.coe.psu.ac.th/~ad/jg/

Code: [Select]

            long beforeTime, afterTime, timeDiff, sleepTime;
            long overSleepTime = 0;
            int noDelays = 0;
            long excess = 0;
           
            running = true;
           
            while(running) {
                try {
                    beforeTime = System.nanoTime();
                    gameUpdate();
                    if (! paused)
                        gameRender();
                   
                    afterTime = System.nanoTime();
                    timeDiff = afterTime - beforeTime;
                    sleepTime = (period - timeDiff) - overSleepTime;
                   
                    if (sleepTime > 0) { // some time left in this cycle
                        try {
                            Thread.sleep(sleepTime/1000000L); // nano -> ms
                        } catch(InterruptedException ex) {}
                       
                        overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
                       
                    } else { // sleepTime <= 0; frame took longer than period
                        excess -= sleepTime; // store excess time value
                        overSleepTime = 0L;
                       
                        if (++noDelays >= KConfig.noDelaysPerYield) {
                            Thread.yield(); // give another thread a chance to run
                            noDelays = 0;
                        }
                    } // if-else (sleepTime > 0)
                   
                    /* If rendering is taking too long, update the game state without rendering it, to get the updates/sec nearer to the required FPS. */
                    int skips = 0;
                    while (running && (excess > period) && (skips < KConfig.maxFrameSkips)) {
                        excess -= period;
                        skips++;
                        gameUpdate(); // update state but don't render
                    }
                   
                } catch (Throwable t) {
                    logger.warning("exception in timer thread {0}", t);
                }
            } // while running


Code: [Select]
r a f t

1912
Support / sort offset
« on: March 19, 2006, 03:21:09 pm »
ok, i got the point. thx for quick reponse ;)

1913
Support / sort offset
« on: March 19, 2006, 02:35:37 am »
hello,

how should Object3D.setSortOffset(float) be used ? javadoc says it sets on offset for the z-Sorting but i couldnt get it. i guess it's sth like objects are sorted by given float for render but what about the camera ? should one track where the camera is by himself and set the sort offset accordingly ?

i'm having a strange rendering artifact:  it seems like polygons are sliding when camera approachs to them, as can be seen in image below. i have two transparent objects one covering another. the inner one is actually rendered (it has visible pixels) but the outer one is never seen (all black) and used for collision purposes.



strange rendering disappears if i dont put the outer one into to the world.  that made me think this may have something with that sort offset thing.

so how should i use Object3D.setSortOffset() thing ?
thx

Code: [Select]
r a f t
ps: the two objects arent that close, the inner one is fine grained (has a lot of polygons) but the outer one is a simple box with 6 faces.
ps2: infact the invisible one is inside, but their normals are looking inside and the camera in always inside ;)

1914
Projects / Raven's projects
« on: March 10, 2006, 12:54:08 am »
yeap, i've seen it walking ;) interesting project..

Code: [Select]
r a f t

1915
Projects / aptal karga (foolish crow)
« on: March 08, 2006, 02:38:48 am »
re-wrote balloons:
* changed the way they are drawn (i dont know why, previous mechanism hangs a bit on windows during first popup),
* changed their appearance,
* added some smoothness to their movements,
* and they are kind of (not that much) smart now: they try to avoid overlapping each other.

still needs some improvements for a clearer view in crowd

the new balloons


Code: [Select]
r a f t

1916
Projects / aptal karga (foolish crow)
« on: February 28, 2006, 11:45:42 am »
yeap, he is a really talented 3d artist. but unfortunately i couldnt attract his interest, he doesnt reply my emails  :roll:

i use mesh animation initially stored in a series of 3ds files. then they're saved using standart java serialization to reduce loading time

for the test tool, it is a player more than an animation editor indeed, one can only fine tune and test some aspects of animation (loop time, distance to pair etc)

Code: [Select]
r a f t

1917
Projects / aptal karga (foolish crow)
« on: February 27, 2006, 03:13:38 pm »
* added the new boy avatar.
* improved avatar mechanism to allow mixing texture and mesh based variations.
* changed avatar panel to use thumbnails.
* improved avatar tool to test and fine tune paired animations (can be found at demos section).
* slightly changed camera behaviour based on distance: one may feel it while adjusting camera with shift + arrow keys. i'm not quite happy with the new default angle but i have to since those avatars arent made to be viewed from above back

the new boy avatar


girl and boy kissing in test tool


Code: [Select]
r a f t

1918
Projects / Technopolies
« on: February 27, 2006, 03:13:14 pm »
yeap, memory is a constraint :/ it's not a problem for me since i have no jPCT world on server side but you may run into trouble..

maybe you may have a custom package, writing to them and trying wont hurt i guess

Code: [Select]
r a f t

1919
Projects / Technopolies
« on: February 27, 2006, 02:57:14 pm »
yeap, they're cool, they provide private jvm, shell access etc..

1920
Projects / Technopolies
« on: February 27, 2006, 02:14:52 pm »
Quote from: "rolz"
The most obvious problem now is laggy server. It just makes the game unplayable. I would be very grateful if someone here could offer a shelter for the game server for a while, until i find better channel.


you may wish to take hosting from http://www.jsp-servlet.net/. reasonable prices and good performance. i'm quite happy with their hosting

Code: [Select]
r a f t

Pages: 1 ... 126 127 [128] 129 130 ... 133