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

#1
Support / Clone and transform objects
May 14, 2015, 10:35:29 AM
Hello

I'm cloning an object, for sharing the mesh data, and I'm a bit confused.
I am trying to transform the mesh data at start-up by using rotateMesh() and translateMesh() after applying proper transformations (for aligning the objects properly).

I am wondering what is the better option (in terms of performance and memory consumption) - cloning the original object (with the original mesh data) and then applying rotateMesh/translateMesh OR first applying mesh transformations and then cloning? Is there a difference?
What happens to the mesh data after rotateMesh/translateMesh? Is it still being shared, so a transformation on one object affects the other?

Thanks
AP
#2
Yes.
That's a video "projected" on a plane.

At first I thought maybe it's aspect ratio issue - it wasn't.
Then I thought, maybe something to do with texture wrapping  or texture filtering - neither.
Tried on two devices with PowerVR GPU - same result. Another device with another GPU - worked perfectly.

#3
Support / Texture artifacts (green/purple/black)
May 10, 2015, 02:08:21 PM
Hello

I am trying to play a video on a 3D object.
I am streaming the video (with Android's MediaPlayer) into a texture (through SurfaceTexture and Surface), and then map this texture to a plane. It works, but I get weird artifacts on the borders (looks like a green and black checkerboard and sometimes it blinks green and purple).
It seems to be something with the GPU (PowerVR), but I guess there should be a way to solve this... I am still now sure what it is.

Anyone got that or have any idea how to solve a thing like that?

Thanks
AP
#4
That's exactly what I did eventually... it worked. I was hoping for a more elegant solution :)
#5
Support / Clear framebuffer and stop rendering
May 06, 2015, 09:11:01 AM
Hello

I'm trying to switch visibility of the OpenGL context quite fast, so in order to turn the visibility off I'm trying to clear the framebuffer and then stop rendering (so the onDrawFrame wouldn't be called and the result will be a fixed black screen, until resumed).
If I'm switching the visibility of the view, it destroys the OpenGL context, and I would like it to preserve if because pausing and resuming can occur really fast.

I noticed there isn't really a way to clear all buffers (due to triple-buffering on my mobile GPU, I need to call clear() on my framebuffer 3 times from onDrawFrame() before  the view is actually cleared).
I could clear the framebuffer in onDrawFrame() and then return (so nothing is drawn), but then the OpenGL thread still remains active and it isn't really necessary.

Is there a good way for doing something like that - clearing framebuffer and stop rendering?

Thanks
AP

#6
Support / Re: Texture wrapping problem
March 23, 2015, 11:06:34 AM
Thanks for your answer.
Any suggestions of other ways for doing something like that? (other than breaking the trail to many objects with "less" wrapping of textures...)
#7
Support / Texture wrapping problem
March 23, 2015, 08:58:39 AM
Hello

I'm generating a 3D object of a trail, manually generated from vertices and triangles (using the Object3D constructor using vertices array, indices array and uvs array).

The trail is something like a "thick" line (each segment is constructed from two triangles).
I'm trying to map a texture along the trail by something like this:

uvs[iv++] = tot_dist;    // u plus (right)
uvs[iv++] = 0;      // v plus (right)
uvs[iv++] = tot_dist;    // u minus (left)
uvs[iv++] = 1;      // v minus (left)

for each two points of a segment, where tot_dist is the total distance of the trail up to that point.

I am getting a weird result, where at the beginning of the trail, the texture looks great, and as I "walk" through the trail, the texture starts looking "noisy" and VERY "pixelated".
I tried variations of mipmap and filtering - on and off, with no help.

Any guess what might be the problem?

Thanks
AP
#8
Support / Re: Reloading textures to frame buffer
January 20, 2015, 02:29:11 PM
Thanks, I'l give that a try....
But, I am not sure there is no need to do that. After my app is paused and resumed, a new frame buffer is created and the textures are "gone". The TextureManager still holds the textures, but it seems like they are not automatically uploaded to the GPU..
#9
Support / mesh rotation and parent/child relationship
January 20, 2015, 02:24:25 PM
Hello

I am trying to load an object from file (loader returns array of Object3D) then use a dummy object as a base node (parent) for all objects (setting them each a parent), and then aligning the rotation of the mesh of each one of objects.
Does "rotateMesh" use the inherited transformations from the parent in order to rotate the mesh?

I am rotating the base node in order to set the right rotation, then call "rotateMesh" on all children, and then clearing the rotation from the parent.
I think this doesn't work as expected, am I missing something?

Thanks
A.P.
#10
Support / Re: Texture Animation
January 19, 2015, 11:13:37 AM
Thanks!
I'll give it a try.
#11
Support / Reloading textures to frame buffer
January 19, 2015, 11:12:29 AM
Hello

According to the examples, the textures are typically loaded within the surfaceChanged method of the "GLSurfaceView.Renderer" implementation.

My concern is when loading the textures takes a lot of time, and I want to do it only once when the application starts.

If I am trying to load the textures elsewhere, what happens is when pausing/resuming the app, the surfaceChanged is called, the frame buffer is disposed, and a new frame buffer is generated.
The textures are removed from the GPU once the frame buffer is disposed, although they remain within the TextureManager.

It is possible to "re-add" the textures by doing something like:

TextureManager tm = TextureManager.getInstance();
for (String s : myTextures)
{
   tm.replaceTexture(s, tm.getTexture(s));
}

Iterating through the textures I've previously added and replacing them with themselves, which causes reloading them to the GPU (I store the textures names in a list. Actually, the list of all textures can also be extracted from the TextureManager itself..).

This is a bit weird. Is this the best way to so? I guess not..

I am actually trying to "re-load" the textures which where already added to the TextureManager to the GPU again for proper rendering of my objects ....
What is the best approach to do so?

Thanks
A.P.

#12
Support / Texture Animation
January 19, 2015, 10:47:47 AM
Hello

I am trying to do some texture animation - using a large texture including a grid of frames, and changing cycling through the frames by changing the texture mapping to a 3D quad.

Something like these -
https://github.com/libgdx/libgdx/wiki/2D-Animation
https://www.udacity.com/course/viewer#!/c-cs291/l-124106599/m-175393409
http://stemkoski.github.io/Three.js/Texture-Animation.html

Is it possible doing it using JPCT-AE?

Thanks
A.P.