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

Pages: 1 2 [3] 4
31
Support / Re: Viable engine?
« on: May 22, 2012, 10:10:39 am »
I see...you can derive the euler angles from the matrix and create a new matrix with only a sub-set, but i'm not sure if the results will be satisfying. The basic problem is that an unlimited number of cascaded transformations result in the same output. The derived angles are just one way to do it...anyway, here's some code: http://www.jpct.net/forum2/index.php/topic,1191.0.html
Thanks, that helped :-)

Also, I've noticed that if there is solid objects behind transparent objects, it will render the solid objects behind as transparent as well.
We had the same issue in the iPhone version, which was solved by setting a glColorMask after drawing transparent stuff (http://stackoverflow.com/questions/10450680/isgl3d-transparency-issues)
Is it possible to somehow implement this in your engine?

32
Support / Re: Viable engine?
« on: May 21, 2012, 01:42:02 pm »
Why don't you use the rotate?()-methods instead?
Because Im getting a rotation matrix from the phones sensors. I can only set the rotation, not get the current rotation of the car :-/

33
Support / Re: Viable engine?
« on: May 21, 2012, 11:32:55 am »
A totally different question: I use a rotation matrix to set the position of the car in 3D.
Is it possible to set the rotation around a specific axis to 0?
Lets say I only wanted the rotation matrix to rotate pitch and roll, not yaw, of the car.

EDIT: I was thinking it might be possible to pull just the two vectors out of three from the matrix, and applying them to the model, not completely sure how to do that though.

34
Support / Re: Viable engine?
« on: May 20, 2012, 05:54:48 pm »
The engine doesn't spawn any additional threads. When the methods in Loader return, the loading is done. The delay that you notice is caused by the engine compiling the mesh to be processed by the gpu in the most optimal way. This happens in two steps. The second one has to happen in the render thread, you can't get around that. However, the first step can be triggered from anywhere. To do this, add the objects to the world and call World.compileAllObjects. That should remove some load from the render thread.
Its not really the timing that matters. Its mostly so I can create a ProgressDialog and dismiss it when it is actually done.

EDIT: Is it possible to check when all the VBO's has been created for the object?

35
Support / Re: Viable engine?
« on: May 20, 2012, 04:07:51 pm »
Another thing. When loading via: model = Loader.loadSerializedObjectArray(getAssets().open("model.ser"));
Is it possible to somehow check when the loading is done? I need to load the car in the background, as it takes a lot of time.
but the .loadSerializedObjectArray() function starts a new thread in the background when run, which means I can't just wait for the function to finish.

EDIT: Looks like from the logs that its not loading the model itself thats the problem. But its adding it to the scene.
If I load it before entering the activity, it still takes a while to show up, a while after the onSurfaceChanged have run.

36
Support / Re: Viable engine?
« on: May 20, 2012, 02:30:07 pm »
It happens without the camera preview as well. And appears on the Galaxy SII as well as on my Galaxy Nexus.

If you want to see it in the app, I can send you the APK.

37
Support / Re: Viable engine?
« on: May 20, 2012, 01:58:09 pm »
I'm not sure what you mean. Maybe you can highlight it in the screen shot somehow.
Try looking at the right side door. Its full of small white lines/cracks

38
Support / Re: Viable engine?
« on: May 20, 2012, 12:05:48 pm »
Thanks! Works perfectly now ;-)

There seems to be a problem with parts of the model looking "cracked" from some angles.


Ive tried changing glDither and glTrilinear as that might have been the cause, but to no help :-/

39
Support / Re: Viable engine?
« on: May 20, 2012, 10:26:05 am »
Thanks! I really appreciate your help.

Although, there seems to be a problem with alpha in the shader. I've checked all the vec4's, and none of them has an alpha that would explain this :-/

40
Support / Re: Viable engine?
« on: May 18, 2012, 04:46:57 pm »
OpenGL ES misses a lot of stuff that the desktop version has. Maybe it helps to compare the glsl code of the parallax mapping shaders that are included as an example in both versions (HelloShader iirc) so see how the desktop stuff translates to mobile.
Okay, can't get the shader to work. I've searched the web for a simple reflection shader, but no luck.
Do you have any sources for a simple reflection shader?

41
Support / Re: Viable engine?
« on: May 18, 2012, 11:33:23 am »
The equivalent of gl_NormalMatrix is modelViewMatrix...well, not really but as long as you are only using uniform scaling (which you do, because jPCT doesn't allow for aynthing else), you can simply replace something like

Code: [Select]
vec3 n = normalize(gl_NormalMatrix * gl_Normal);

by

Code: [Select]
vec3 n = normalize(modelViewMatrix * vec4(normal,0.0)).xyz;

Thanks. Im 100% new to shaders. Theres a few more functions and variables It can't seem to find:

05-18 11:32:05.278: I/jPCT-AE(27583): ERROR: 0:9: 'ftransform' : no matching overloaded function found

42
Support / Re: Viable engine?
« on: May 18, 2012, 11:12:47 am »
Why shouldn't it compile? It's all the same GLSL based stuff...maybe the types don't match or something like that. You might have to convert them. Can you post the shader code that won't compile?
Well, right now Im trying to port this shader: http://www.davidcornette.com/glsl/glsl.html
It's simple, and should look fine. Although, I can't seem to fint the jPCT equivalent of gl_NormalMatrix

43
Support / Re: Viable engine?
« on: May 18, 2012, 11:04:27 am »
If you have the former shader available, you should be able to port it to be used by jPCT-AE. After all, it's all standard GLSL code. You will most likely have to make it use jPCT-AE's naming conventions for uniforms and attributes that can be found here: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/GLSLShader.html
Thanks. I used a default shader in JME, which I've tried porting already using jPCT naming conventions for shaders, but there's a lot of stuff that simply won't compile in it.

I just need a simple reflection shader for this project though.

44
Support / Re: Viable engine?
« on: May 18, 2012, 09:44:53 am »
Thaks a lot for the help. I got everything working great so far with a detailed model and transparency.
But I've run in to some problems with using shaders. On our old engine (jmonkeyengine) we used shaders for the model instead of textures. I can see that your engine supports shaders, but I have not been able to find a good example for a simple lighting shader. The only thing I really need is just to make the car "shine" more, like real car paint.

You can see below how it looks so far:


Pages: 1 2 [3] 4