Low performance when using uncompiled objects

Started by Jakes, October 13, 2019, 06:40:54 PM

Previous topic - Next topic

Jakes

Hello,

I've been using a lot jpct alongside other libs. The problem is, every time I use uncompiled objects, I experience some frame rate drops for a while (like 5/10 secs) and then it gets fine as it seems like its buffering building something on the fly.

Is this normal? Or is there anything I could do to minimize this?

Regards,
Jakes

EgonOlsen

It might be normal, but it's difficult to say from a distance. If a hickup happens, is there some corresponding log output at the same moment?

Jakes

#2
There is a log, but there's nothing I could explicitly say for sure that could be the reason:

Java version is: 1.7.0_80
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Using LWJGL's AWTGLCanvas
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Software renderer disposed
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
[ Sun Oct 13 18:23:57 BST 2019 ] - WARNING: Unsupported Texture width (206)...resizing to a width of 256 pixels!
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Adding Lightsource: 0
Adding Lightsource: 1
Adding Lightsource: 2
Adding Lightsource: 3
Adding Lightsource: 4
Adding Lightsource: 5
Adding Lightsource: 6
Adding Lightsource: 7
Adding Lightsource: 8
Adding Lightsource: 9
Adding Lightsource: 10
Adding Lightsource: 11
Adding Lightsource: 12
Adding Lightsource: 13
Adding Lightsource: 14
Adding Lightsource: 15
Adding Lightsource: 16
Adding Lightsource: 17
Adding Lightsource: 18
Adding Lightsource: 19
Adding Lightsource: 20
Adding Lightsource: 21
Adding Lightsource: 22
Adding Lightsource: 23
Adding Lightsource: 24
Adding Lightsource: 25
Adding Lightsource: 26
Adding Lightsource: 27
Adding Lightsource: 28
Adding Lightsource: 29
Adding Lightsource: 30
Adding Lightsource: 31
Adding Lightsource: 32
Adding Lightsource: 33
Adding Lightsource: 34
Adding Lightsource: 35
Adding Lightsource: 36
Adding Lightsource: 37
Adding Lightsource: 38
Adding Lightsource: 39
Adding Lightsource: 40
Adding Lightsource: 41
Adding Lightsource: 42
Adding Lightsource: 43
Adding Lightsource: 44
Adding Lightsource: 45
Adding Lightsource: 46
Adding Lightsource: 47
Adding Lightsource: 48
Adding Lightsource: 49
Adding Lightsource: 50
Adding Lightsource: 51
Adding Lightsource: 52
Adding Lightsource: 53
Adding Lightsource: 54
Adding Lightsource: 55
Adding Lightsource: 0
Adding Lightsource: 1
Adding Lightsource: 2
Adding Lightsource: 3
Adding Lightsource: 4
Adding Lightsource: 5
Adding Lightsource: 6
Adding Lightsource: 7
Adding Lightsource: 8
Adding Lightsource: 9
Adding Lightsource: 10
Adding Lightsource: 11
Adding Lightsource: 12
Adding Lightsource: 13
Adding Lightsource: 14
Adding Lightsource: 0
Adding Lightsource: 1
Adding Lightsource: 2
Adding Lightsource: 3
Adding Lightsource: 4
Adding Lightsource: 5
Adding Lightsource: 6
Adding Lightsource: 7
Adding Lightsource: 8
Adding Lightsource: 9
Adding Lightsource: 10
Adding Lightsource: 11
Adding Lightsource: 12
Adding Lightsource: 13
Adding Lightsource: 14
Adding Lightsource: 15
Adding Lightsource: 16
Adding Lightsource: 17
Adding Lightsource: 18
Adding Lightsource: 19
Adding Lightsource: 20
Adding Lightsource: 21
Adding Lightsource: 22
Adding Lightsource: 23
Adding Lightsource: 24
Adding Lightsource: 25
Adding Lightsource: 26
Adding Lightsource: 27
Adding Lightsource: 28
Adding Lightsource: 29
Adding Lightsource: 30
Adding Lightsource: 31
Adding Lightsource: 32
Adding Lightsource: 33
Adding Lightsource: 34
Adding Lightsource: 35
Adding Lightsource: 36
Adding Lightsource: 37
Adding Lightsource: 38
Adding Lightsource: 39
Adding Lightsource: 40
Adding Lightsource: 41
Adding Lightsource: 42
Adding Lightsource: 43
Adding Lightsource: 44
Adding Lightsource: 45
Adding Lightsource: 46
Adding Lightsource: 47
Adding Lightsource: 48
New WorldProcessor created using 1 thread(s) and granularity of 1!
Waiting for renderer to initialize...0
Waiting for renderer to initialize...1
Driver is: igdumdim64/10.18.10.3496 on NVIDIA Corporation / GeForce 840M/PCIe/SSE2
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
VBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 34/object36 compiled to indexed data using 24/9 vertices in 0ms!
Object 34/object36 compiled to 1 subobjects in 123ms!
Creating new world processor buffer for thread Renderer Thread
Checking for triangle strip...
Not a triangle strip at position 1!

[...REPEATS the same 5 lines above, for 200+ times...]

VBO created for object 'object3526'
VBO created for object 'object3363'
VBO created for object 'object3328'
VBO created for object 'object3424'
VBO created for object 'object3427'
VBO created for object 'object3464'
VBO created for object 'object3467'
VBO created for object 'object3398'
VBO created for object 'object3523'
VBO created for object 'object3518'
VBO created for object 'object3344'
VBO created for object 'object3320'
VBO created for object 'object3390'
VBO created for object 'object3368'
VBO created for object 'object3387'
VBO created for object 'object1442'
VBO created for object 'object3315'
VBO created for object 'object2429'
VBO created for object 'object1263'
VBO created for object 'object3430'
VBO created for object 'object3555'
VBO created for object 'object2040'
VBO created for object 'object3446'
VBO created for object 'object3539'
VBO created for object 'object3502'
VBO created for object 'object3366'
VBO created for object 'object3331'
VBO created for object 'object3579'
VBO created for object 'object3520'
VBO created for object 'object3635'
VBO created for object 'object3611'
VBO created for object 'object40'
VBO created for object 'object1592'
VBO created for object 'object3576'
VBO created for object 'object3336'
VBO created for object 'object3379'
VBO created for object 'object3552'
VBO created for object 'object3531'
VBO created for object 'object3470'
VBO created for object 'object3606'
VBO created for object 'object3595'
VBO created for object 'object3440'
VBO created for object 'object3507'
VBO created for object 'object3632'
VBO created for object 'object3603'
VBO created for object 'object3563'
VBO created for object 'object3462'
VBO created for object 'object3616'
VBO created for object 'object1259'
VBO created for object 'object3590'
VBO created for object 'object3480'
VBO created for object 'object3600'
VBO created for object 'object3478'
VBO created for object 'object3488'
VBO created for object 'object41'
VBO created for object 'object3392'
VBO created for object 'object2427'
VBO created for object 'object3360'
VBO created for object 'object3475'
VBO created for object 'object3411'
VBO created for object 'object3494'
VBO created for object 'object3574'
VBO created for object 'object3483'
VBO created for object 'object3571'
VBO created for object 'object3598'
VBO created for object 'object3512'
VBO created for object 'object3419'
VBO created for object 'object3550'
VBO created for object 'object3624'
VBO created for object 'object43'
VBO created for object 'object3422'
VBO created for object 'object3323'
VBO created for object 'object3352'
VBO created for object 'object2437'
VBO created for object 'object38'
VBO created for object 'object1255'
VBO created for object 'object3384'
VBO created for object 'object3358'
VBO created for object 'object3558'
VBO created for object 'object36'
VBO created for object 'object3587'
VBO created for object 'object3630'
VBO created for object 'object3456'
VBO created for object 'object3614'
VBO created for object 'object3350'
VBO created for object 'object1257'
VBO created for object 'object3504'
VBO created for object 'object42'
VBO created for object 'object2435'
VBO created for object 'object3454'
VBO created for object 'object3472'
VBO created for object 'object3318'
VBO created for object 'object3608'
VBO created for object 'object3486'
VBO created for object 'object3403'
VBO created for object 'object3414'
VBO created for object 'object3515'
VBO created for object 'object3566'
VBO created for object 'object3542'
VBO created for object 'object3374'
VBO created for object 'object1590'
VBO created for object 'object3582'
VBO created for object 'object3496'
VBO created for object 'object3568'
VBO created for object 'object3451'
VBO created for object 'object3584'
VBO created for object 'object3536'
VBO created for object 'object3622'
VBO created for object 'object3400'
VBO created for object 'object3627'
VBO created for object 'object3592'
VBO created for object 'object3510'
VBO created for object 'object2062'
VBO created for object 'object3326'
VBO created for object 'object1440'
VBO created for object 'object3438'
VBO created for object 'object3376'
VBO created for object 'object3432'
VBO created for object 'object2431'
VBO created for object 'object3406'
VBO created for object 'object2433'
VBO created for object 'object1253'
VBO created for object 'object3408'
VBO created for object 'object3619'
VBO created for object 'object3499'
VBO created for object 'object3334'
VBO created for object 'object3547'
VBO created for object 'object3355'
VBO created for object 'object1261'
VBO created for object 'object3560'
VBO created for object 'object3528'
VBO created for object 'object3416'
VBO created for object 'object3339'
VBO created for object 'object3371'
VBO created for object 'object2038'
VBO created for object 'object3459'
VBO created for object 'object2064'
VBO created for object 'object3347'
VBO created for object 'object3534'
VBO created for object 'object3443'
VBO created for object 'object3448'
VBO created for object 'object3491'
VBO created for object 'object3382'
VBO created for object 'object3342'
VBO created for object 'object3544'
VBO created for object 'object3395'
VBO created for object 'object3435'
Compiled 147 VBO!
Max. anisotropy supported: 16
0(1) : warning C7554: OpenGL requires sampler variables to be explicitly declared as uniform


Shader program compiled and linked fine!
Tangent handle not found (tangents needed: false)!
Shader compiled!

EgonOlsen

I fail to the relation between the log output and your question, because your question was about uncompiled objects while the log shows the usage of compiled ones...

Jakes

Yes, the reason is mainly because I wrote a procedure that either compiles all of the objects (when using compiled mode) or  only compiles sprites (billborded ones, because they're a part of a framework based pool Structure).

but I'm only using 200+ compiled vs the full 3400+ compiled scene, which is when its way smoother without any stutter os hickups.

which in this example, I have some hickups on the start as you said, but if I were to compile the full scene, I don't have any problem whatsoever.

EgonOlsen

You can try to do these at startup- Maybe that helps:

http://www.jpct.net/doc/com/threed/jpct/TextureManager.html#preWarm(com.threed.jpct.FrameBuffer)

http://www.jpct.net/doc/com/threed/jpct/World.html#buildAllObjects()

But actually, compiled objects are more likely to cause initial hickups...which puzzles me a bit here...

Jakes

Quote from: EgonOlsen on October 14, 2019, 12:54:45 PM
You can try to do these at startup- Maybe that helps:

http://www.jpct.net/doc/com/threed/jpct/TextureManager.html#preWarm(com.threed.jpct.FrameBuffer)


I already knew about this kind of optimization, I've read all the wikis you have to help improve 3D scenes, and I'm already using all the tips.

Quote
http://www.jpct.net/doc/com/threed/jpct/World.html#buildAllObjects()

didn't know about this one though, but everytime I'm loading a new object onCreateScene event I'm building each one right on the spot, so, no help so far.

Quote
But actually, compiled objects are more likely to cause initial hickups...which puzzles me a bit here...

Really? I've used this framework for a lot of projects and tests of mine, and every single one worked better without any setbacks or staggering when compiled, but everytime I use uncompiled objects (around 90% of them) the more it grows the worse it gets.

But quick note, it might help on understanding this, this only happens once any tipo of object becomes rendered for the first time, after that, all the copies of that will be loaded quickly without any hickups. lets say that I have a "database of 3 objects":

- Ball
- Chair
- Car

I load the Ball and put it in the scene in front of the camera, it will reduce my frame rate to around 10fps for like 1 or 2 secs, and then its all good, back to my fixed 60. after that I can load as many Balls as I want that i will be fine for the time the program is running. The same will happen for the Chair for the first time, and then will be fine the other times it will be rendered.

Can we take a guess that this could be due to java itself? Or maybe OpenGL while sending the objects to the GPU?
Because it seems like some kind of caching, that on the second time is already there which wont stagger my game the second times.

on another note, I though of loading all objects to a test scene the first time while loading but to no result because they need to be displayed, and that will be a weird user experience and will crash my memory.

so I'm stuck

EgonOlsen

#7
Actually, the uncompiled pipeline renders individual polygons by pushing them to the GPU triangle after triangle. That's slow in itself, but I don't see why this should cause such a performance drop.
Can you provide me with a simple test case that shows this problem?

Jakes

In the past, I've also came across this same problem while dealing with individual polygon structure passed on the pipeline when using no VBOs, therefore I would assume that this is not entirely a Java/jPCT problem, the strange thing is the way this happens, it only seem happen the fisrt time each object is rendered.

About the sample, sure, do you want a package of the code? Lemme wrap it up with a simple example and some objects that I have here with a compiled and uncompiled case.

EgonOlsen

Yes, just some simple example that compiles and shows the issue.

Jakes

Here is the test with both modes, compiled and non compiled, you can also check the result image to analyze the data.
you can see that in every graph there's a little "warm up" for the non compiled objects.

EgonOlsen

I would be hard pressed to say that I really see the mentioned effect in these tests...Here are the graphs as they look when running the tests on my machine from Eclipse with -Xmx and -Xms both set to 1024m in the test's runtime configuration:

Compiled:


(I guess it's too fast so the graph is out of scale, but as we don't have a problem with compiled objects, I don't mind it)

an uncompiled:



What am I looking for here? The lower framerate at the beginning? That would be caused by the JIT compiler warming up, because it gets smaller when you start the test with -server -Xcompile. Anyway, when looking at the rendered output, I can't even notice this phase, so I'm not sure if that's what we are talking about?

How do these graphs look on your machine? Oh, and another idea, just in case it's somehow caused by the graphics driver: Try Config.glVertexArrays=false before setting up your actual scene. Maybe that changes something....

Jakes

Thanks, yes the difference in both machines is clear, but there still persists the "warming up" which I also thought it could be caused by the JIT, but if that were to be true, why aren't compiled objects reacting in the same way?

Compiled:


Non-Compiled:


Machine Specs:
Core:  i7-4510U @ 2.00GHz
Ram:  12 GB
OS:    Win 8.1 64x
GPU:  GeForce 840M, Graphical Clock: 1029 MHz
Java:  7, 64x

its clear that in both machines (even with different specs) we still have the warm up, but although its just a short initial period, it will happen everytime a different object comes into play (rendered) which is a bit weird, because when using compiled objects such behaviour is nonexistent.

I thought this could besome kind of caching on the application side once we are using computer memoty to store the objects to be sent to the pipeline every frame, so that could lead to the warm up, but could it be optimized on the jPCT framework? Or is it really java's only fault here?

Anyway, I tried the VM params (-server -Xcompile) you used and "Config.glVertexArrays=false;", and it got a little better:

but on bigger scenes with a lot more dynamic stuff happening, I still expierience the warm up everytime a new object comes into play.

Anyway, even if this "issue" got somehow better, there still be performance issues when expanding the scene, as we can see on the "non-compiled" case. Thereforce I'll bet on the compiled scene, so I gotta hit the road on learning GLSL so I can use more dynamic lighting and stuff.

thanks a lot for your time on this matter.


EgonOlsen

From an engine perspective, there's nothing going on for uncompiled objects that could cause this IMHO. There's no caching or any other kind of one-time processing involved when rendering an uncompiled object for the first time.

Jakes

    Hello,

    I'm once more back to this post because I've converted my scene to a full compiled one, and I still have the same "warm-up" effect, this time a bit shorter but still appliable. It happens everytime a new objct with texture(s) comes into play.

    The example I've sent you is a simpler one, but the scene I'm working on, is a much complex one with a framework built on top of it, but the rendering system is jPCT alone, and I've tested a lot of different scenarios, adding/removing properties and enabling/disabling modes (such as collision) to debug the source cause, but so far, I haven't reached any answer.

    My scene consists of:

    • Multiple Compiled objects sharing the same data using "shareCompiledData" cloned from an original one.
    • Few light sources at once (3/4)
    • Over 100 textures (512 x 512,  1024 x 1024, 2048 x 2048)
    • Sprites with alpha channel and transparency using "Add" mode
    • Objects can be added/removed (thread safe) on the fly while the simulation is running
    • Objects created are stored in memory as compiled Object3D for reference: Any object created in the future will be done by cloning this one and sharing compile data. Hence, a database of objects is kept on memory (is there any issue here?). This object database is preloaded at the begining alongside the textures.

    Observations:

    • When the simulation starts, while looking at the floor (simple textured horizontal plane), it will run at 60 fps (or more) until the camera looks at the widest plane that captures most of the world objects (open area), where it will slow down for 0.5/1 secs until it gets to 60 fps again.
    • First time an object is created (ie complex object, consisting of multiple ones, based on such "object database") it will slow down once more for about the same time.
    • Second time the same object is created no warm up happens.
    • First time a new object, that wasn't before mentioned, is created, therefore a new "warm up of roughly the same 0.5/1 secs happens.
    • and so on.
    • Objects with bigger or more textures have a longer warm up phase, but only once.
    • Objects with alpha channel have also a longer warm up phase
    • Using -server and/or -Xcompile only takes more to start up the application, but al those previous observations still apply.
    • Using Xmx and Xms of 3072, -XX:ConcGCThreads=4 and -XX:-UseConcMarkSweepGC still yield out the same results.

    so my conclusions are:
    - It isn't something from the JVM itself because the "warm-up" only happens when a new class or type is being instantiated for the first time, which is not the issue here, the Object3D is already being used and this is only a matter of different "shapes" or "attributes" of the same classes/objects already running, so I can only assume that this is some sort of buffer inscreasing in size hence the reason why it only happens once is due to the fact that it has already grow and now has the capacity to store it, can I say that the VisLists are here to blame?

    - Is there any buffer or object that needs to grow everytime an object is added to the world? But even if it is, this only happens when the camera is looking so it might have to do with the objects inside the frustum, which means that this phenomenon only happens on these conditions:


    • Freshly new object
    • Added to the world for the first time
    • inside the camera view area

    once these 3 requirements are met, this slow down effect will take place.

    I tried using different machines and the same effect apply, with more or less impact but it exists.
    Can you give any hint on where to look for?

    Regards