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.


Topics - Jakes

Pages: [1]
1
Support / Issue with Texture.overrideTexelData
« on: January 19, 2021, 02:43:01 am »
Hello,

I'm using the method Texture.overrideTexelData, but it seems that its data is not being used correctly in the texture.
my example below shows the problem with it.

Im using this simples code to change texture data on the fly:

Code: [Select]
public void update() {
BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_4BYTE_ABGR);
int size = w * h * 4;
ByteBuffer buffer = ByteBuffer.allocateDirect(size);
buffer.order(ByteOrder.LITTLE_ENDIAN);

<Draw on Image> -> img.getGraphics().drawImage(spr, 0, 0, null);

DataBuffer dataBuffer = img.getRaster().getDataBuffer();
byte[] pixelData = ((DataBufferByte) dataBuffer).getData();
buffer.put(pixelData);
tex.overrideTexelData(buffer);
}

Results:

Original Image:


Drawn Image:


so, it sems that the color params are being swapped when uploading them to the buffer somewhere

2
Support / Object/Sprite Batching
« on: December 28, 2020, 07:36:57 pm »
Hello,

I was wondering if there is a prebuilt method for batching up sprites to the GPU instead of sending multiple objects individualy, as it increases a lot the performance when using particle systems or packs of elements sharing same mesh,

thanks,
Jakes

3
Support / Transparent Object and ZBuffer
« on: October 21, 2020, 01:53:23 pm »
Hello,

I've been working with transparent objects (in this case, sprites with transparent cutout, like leaves and branches), and knowing that transparency doesnt write to zbuffer, I was expecting to experience some known cases, but instead I'm experiencing different results, as you can see below:

Expected results:

Right: Good Result.
Left:   it is known that this scenario could happen when the red circle in the back is drawn last, so the area of the blue circle will then occlude the red circle due to the zbuffer.

Experienced results:

Right: Good Result.
Left: This wasn't what I was expecting, mainly because the red circle in the back should be depth tested and therefore be drawin behind the blue circle, even when using transparency, the only artifcat I should expect would be clipping and not overlapping. Is there any ZbufferCheck not being made when using transparent objects?

Regards,
Jakes

4
Support / Retrieve objet's mesh data
« on: August 25, 2020, 08:15:13 pm »
Hello once more,

Is there any way to retrieve an object's mesh data, like the polygon list, or vertices?

I want to do some calculations using the object's mesh structure, and need to have the vertex info at least, I've read about the mesh object, but it seems there's no way of getting this.

Regards,
Jakes

5
Support / World calMinDistance Issue
« on: August 25, 2020, 07:03:10 pm »
Hello,

I've been trying out the World.calcMinDistance method but nothing was returned (the value COLLISION_NONE), and when trying the same method from on object from that world, it yields out a distance. Shouldn't the first one work when the object returns a value?

Regards,
Jakes

6
Support / Polylines transparency issue
« on: January 31, 2020, 10:17:47 am »
Hello, I've been working around with Polylines and it seems that the method Polyline.setPercentage(float) is not working properly or might be something I am missing. For any value other than 1 the line turns fully invisible.

Is this an issue?

7
Support / How can we overcome the GC pauses?
« on: January 25, 2020, 06:15:27 am »
I know this might not be the best place to start this but, as this is something that requires a top performance execution, it could have something to do.

After some digging, tuning and playing around with the GC arguments to try to get some good configurations I ended up not having any success at solving its execution pauses.

We all know that the "Stop-the-world" issue while garbage collecting is real, but is there any way to overcome it in an elegant way? I mean, how do anyone here sets up their specs in order to have a nice experience without any lag or freezing every once in a while?

currently, this is what I'm using:

-XX:MaxGCPauseMillis=10 -XX:ParallelGCThreads=4 -Xmx1072M -Xms1072M -XX:+UseParallelGC -XX:NewRatio=4

but, even this, it will fill up the heap memory in a matter of minutes, and once its there, there will be a major sweep that will be noticeable to the simulation and the player.

Any tips or hints will be highly appreciated

8
Support / Loading performance - Cotninuation
« on: January 19, 2020, 09:43:10 pm »
Hello,

after the recent topic "Low performance when using uncompiled objects", the mais issue seemed to be the preWarming of textures, which seems to be solved.

Altought, when using a huge cluster of objects of the same type, there seems to happen a loading of some sort, while the console is outputting these:

Not a triangle strip at position 1!
Remapping 2022 vertex indices!
Creating vertex cache (48528 bytes)!
Vertex indices will be mapped!
Subobject of object 0/object2 compiled to indexed data using 4932/4932 vertices in 20ms!
Checking for triangle strip...
Compiling source object...
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 68 vertex indices!
Creating vertex cache (1632 bytes)!
Vertex indices will be mapped!
Subobject of object 2/object4 compiled to indexed data using 102/102 vertices in 2ms!
Object 2/object4 compiled to 1 subobjects in 2ms!
Object 5233/object5235 precompiled!
Compiling source object...
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 162 vertex indices!
Creating vertex cache (3888 bytes)!
Vertex indices will be accessed directly!
Subobject of object 6/object8 compiled to indexed data using 960/960 vertices in 5ms!
Object 6/object8 compiled to 1 subobjects in 6ms!
Object 5234/object5236 precompiled!
Object 5235/object5237 precompiled!
Delayed pre-warming done!
VBO created for object 'object5226'
VBO created for object 'object5220'
Compiled 2 VBO!
Object 'object3482' shares compiled data with object 'object11'
Object 'object4333' shares compiled data with object 'object11'
Object 'object3152' shares compiled data with object 'object11'
Object 'object4338' shares compiled data with object 'object11'
Object 'object2954' shares compiled data with object 'object11'
[x 1000 more]
...

Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 5239/object5241 compiled to indexed data using 24/9 vertices in 1ms!
Object 5239/object5241 compiled to 1 subobjects in 1ms!
Object 5242/object5244 precompiled!
Object 5243/object5245 precompiled!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 5246/object5248 compiled to indexed data using 24/9 vertices in 0ms!
Object 5246/object5248 compiled to 1 subobjects in 1ms!
Object 5249/object5251 precompiled!
Object 5250/object5252 precompiled!
Checking for triangle strip...
Not a triangle strip at position 1!
[x 1000 more]
...

Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 5785/object5787 compiled to indexed data using 24/9 vertices in 0ms!
Object 5785/object5787 compiled to 1 subobjects in 1ms!
Object 5788/object5790 precompiled!
Object 5789/object5791 precompiled!
VBO created for object 'object5451'
VBO created for object 'object5409'
VBO created for object 'object5570'
VBO created for object 'object5598'
VBO created for object 'object5591'
VBO created for object 'object5731
VBO created for object 'object5444'
VBO created for object 'object5514'
VBO created for object 'object5647'
VBO created for object 'object5255'
VBO created for object 'object5696'
VBO created for object 'object5633'
VBO created for object 'object5521'
VBO created for object 'object5353'
VBO created for object 'object5773'
VBO created for object 'object5640'
VBO created for object 'object5549'
VBO created for object 'object5542'
VBO created for object 'object5710'
VBO created for object 'object5724'
VBO created for object 'object5479'
VBO created for object 'object5605'
VBO created for object 'object5689'
VBO created for object 'object5752'
VBO created for object 'object5703'
VBO created for object 'object5668'
VBO created for object 'object5654'
VBO created for object 'object5766'
VBO created for object 'object5759'
VBO created for object 'object5437'
VBO created for object 'object5528'
VBO created for object 'object5619'
VBO created for object 'object5500'
VBO created for object 'object5262'
VBO created for object 'object5311'
VBO created for object 'object5745'
VBO created for object 'object5465'
VBO created for object 'object5388'
Compiled 79 VBO!
Object 'object5301' shares compiled data with object 'object4'
Object 'object5623' shares compiled data with object 'object4'
Object 'object5595' shares compiled data with object 'object4'
Object 'object5588' shares compiled data with object 'object4'
Object 'object5448' shares compiled data with object 'object4'
Object 'object5462' shares compiled data with object 'object4'
Object 'object5315' shares compiled data with object 'object4'
Object 'object5700' shares compiled data with object 'object4'
Object 'object5567' shares compiled data with object 'object4'


during this period, a huge freeze starts and only stops after these have stop writing to the console.

The last JAR that was made to solve the preWarm issue, seems to lack the "World.compileAllObjects(FrameBuffer)" which I think could solve this loading process?

can you please add both changes to one last jar, if it's not too much trouble?

So my question is:
Could this be the cause?
If not, is there anything I can do before starting the scene to avoid this altogether?


I've even removed all the textures from my scene in order to dismiss this possibility, and it still happens, and the more objects I add onto the scene, the more this "loading period" takes. It's a bit nerve wracking because the number of objects is not that great and I'm not even in the middle of the development.

PS: I tried to use the "Config.glVerbose = false" to hide the previous log text, but it seems that some text is always being output, is it possible to reduce these info lines with an option? (any log describing the compilation process at runtime)

many thanks,

Jakes

9
Support / Animation Interpolation Between Sequences
« on: November 06, 2019, 08:12:20 pm »
Just as the topic subject says, is it possible to add this in a near future? or is there a way to do it currently?

Regards

10
Support / Acessing vertex color throught GLSL
« on: October 28, 2019, 01:06:57 pm »
Hello,

I'm just wondering, when I set the Object3D.setAdditionalColor(), will it affect the gl_Color or any other variable in the Fragment shader?

If not, how can I access this color on the shader side?

Thanks

11
Support / Little help with GLSL shaders
« on: October 13, 2019, 06:45:43 pm »
Hello,

I dunno if this is the correct forum for it, but if its not, can someone please point me out a good place?
I'm trying to write a shader that could simply render a scene, with multiple lights, texture, and fog.

I only want to override the factory shader that comes by default, because it only supports 8 lights, and I need a bit more, so while trying to write a shader I came across a lot of issues such as problems while using multiples light sources, fragment program with texture coord.

Can anyone help me out?

Many thanks,
Jakes

12
Support / Low performance when using uncompiled objects
« on: October 13, 2019, 06:40:54 pm »
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

Pages: [1]