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

Pages: 1 ... 6 7 [8] 9 10 ... 822
106
Support / Re: Vertices only visible in certain camera angles
« on: May 31, 2021, 04:59:59 pm »
You might want to try to apply the controller just once, remove it and call build afterwards. Just to see if that changes something. It shouldn't, but just to rule that out...

107
Support / Re: Vertices only visible in certain camera angles
« on: May 31, 2021, 03:58:19 pm »
What performance difference are we talking about here? How much faster/slower is one solution than the other?

108
Support / Re: Vertices only visible in certain camera angles
« on: May 31, 2021, 02:47:31 pm »
That the amount of work done in fillAttributes increases when you are using vertex attributes is to be expected. I'm more confused about the fact that there seems to be significant work done in the other case as well. Are you, even in case of using the vertex attributes, still assigning the vertex controller? Or do you have some explicit calls to compile(...) or maybe build(false)?

109
Support / Re: Vertices only visible in certain camera angles
« on: May 29, 2021, 09:40:53 am »
Hard to tell. It depends on the application, I guess. It might feel smoother to have several smaller hick-ups than one larger one. In terms of the rendering itself, it doesn't matter.

110
Support / Re: Vertices only visible in certain camera angles
« on: May 27, 2021, 08:51:33 am »
The actual rendering will take the same amount of time, no matter now much of the object has been modified. If you are using a vertex controller, it requires a transfer of data from main to GPU memory that takes additional time. Your shader based solution should avoid that. Have you profiled your code to see exactly where the time is being spent? Also, you large is the object in question?

111
Projects / Re: Physics example
« on: May 27, 2021, 08:48:11 am »
...makes a change in the object from the value (0) of the variable to "private" once and does not work anymore.
I don't understand what you mean by that!? Are you calling applyVertexController() on the mesh that it has been assigned to? Also, you have to make sure that the object gets recognized as "dynamic", which usually happens automatically, but it might fail if you assign the controller after the first use of the object. In that case, try to explicitly call Object3D.compile(true) on the Object3D in question and see if that helps.

112
Projects / Re: Physics example
« on: May 22, 2021, 12:52:29 pm »
I see. There's no functionality that does this automatically. You have to model it that or come up with some algorithm to do it (which won't be trivial...).

113
Projects / Re: Physics example
« on: May 21, 2021, 02:55:12 pm »
I'm not sure what you mean by "cover with clothing"!?

114
Support / Re: Vertices only visible in certain camera angles
« on: May 18, 2021, 11:56:45 am »
You mean the matrix that transforms from world into camera space? No, that's not present by default but you can add a uniform to your shader and inject it yourself. Something like this should work:

Code: [Select]
SimpleVector pos = camera.getPosition();
pos.scalarMul(-1f);
Matrix mat = new Matrix();
mat.translate(pos);
mat.matMul(camera.getBack());
...
shader.getUniform("viewMatrix", mat);

115
Support / Re: Vertices only visible in certain camera angles
« on: May 17, 2021, 04:59:24 pm »
I'm inserting the world space position of the vertices as the position attribute and multiplying with modelViewProjectionMatrix.. maybe that's what's wrong?
Yes, looks like it. Please have a look at the docs for the GLSLShader class here: https://www.jpct.net/jpct-ae/doc/com/threed/jpct/GLSLShader.html. It mentions various matrices that will be automatically injected into your shader if the matching uniforms are present. I think that you want uniform mat4 projectionMatrix in your case instead of the modelViewProjectionMatrix.

116
Projects / Re: Physics example
« on: May 01, 2021, 01:08:13 pm »
The "old" purpose of multiple threads is indeed to do slow IO operations in the background. But nowadays, given that all processors have multiple cores/threads (the machine I'm writing this on can handle 24 threads in parallel, for example), it also very common to use multiple threads for calculations.
That said, it's not easy to use multiple threads for physics, because the result of one thread's calculation can have an impact on the other. Imagine 8 boxes colliding with each other. If you calculate each box in it's own thread, the outcome of one would depend on the collisions of all the others, which is almost impossible to synchronize properly.
jPCT(-AE) itself isn't thread safe (but you could do calculations on independant objects or tasks in multiple threads) and neither is OpenGL(ES). If you want to use multi-threading in one way or the other, you have to make sure that the tasks that are processed by the different threads are independant (for example: One thread for physics, one for sound, one for path finding...).

117
News / Forum upgraded to 2.0.18
« on: April 26, 2021, 02:32:12 pm »
Because I could.

118
Projects / Re: Physics example
« on: April 26, 2021, 01:57:47 pm »
This should be the code Thomas. released back then: https://jpct.de/download/example/PhysicsTest.zip

Please note: I've just zipped my project directory. It might contain a lot of unneeded stuff and was created for an Android-SDK from ages ago. That said, it still compiled, uploaded and worked fine for me.

119
Support / Re: Cpct?
« on: April 23, 2021, 09:18:32 am »
I see...it shouldn't matter much though, because it's only used for projective texturing, which in most cases, you don't need unless you are using shadow mapping and, well, projective textures.

120
Support / Re: Cpct?
« on: April 23, 2021, 07:25:39 am »
I'm not sure what you mean, because there is ARBMultitexture-stuff in your code anyway. However, it might be worth a try and see if your constants are the same as they are in normal OpenGL. These should just be integers and if your toolkit isn't doing something really strange with them, something like PrimitiveType.Triangles should have the same value as OpenGL's GL_TRIANGLES.

Pages: 1 ... 6 7 [8] 9 10 ... 822