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

Pages: 1 2 3 [4] 5 6 ... 12
46
Is using an shader for an Overlay-Object3D here better than using a blitshader?
I think effectively you can reach the same goals..? But what would be faster here?
It shouldn't really matter. Which one is better is merely a matter of taste. Blitting into render targets can require some coordinate adjustments, so using an Overlay might be more intuitive for some though.
And performance-wise?

47
Is using an shader for an Overlay-Object3D here better than using a blitshader?
I think effectively you can reach the same goals..? But what would be faster here?

48
Support / Re: Could not link shader program error
« on: May 01, 2017, 02:19:48 pm »
http://stackoverflow.com/questions/22646581/compiling-linking-shaders-on-vivante-gc1000-gpu-galaxy-tab-3
I did some googling around... And I guess I found the issue...
I'll have to solve this myself I guess

Edit: Nevermind... I'm actually pretty sure I'm using over 8 varying variables...
I guess I'll try combining floats, vec2 and vec3's to vec4's to see if it helps :)
I'll report the results back here :)

PS: Could jPCT throw a warning or something when the varying limit is exceeded by a custom shader? So developers aren't puzzled when the GPU doesn't output anything... I'm sure there are a lot of other limits that are GPU specific (max texture size, max texture stages, max varying variables), it would be nice to have a warning by jPCT-AE when the maximum values are exceeded)... I know developers can test this themselves too but it would be nice to have added in case developers do get puzzled when the GPU doesn't report anything like in my case... It doesn't really come to my mind to check the amount of varying variables...

PS2: Some unrelated question, but why are 16384 resolution textures not 'officially' supported by jPCT-AE while some OpenGL2 devices might support it... (Can't this 8192 resolution limit by jPCT-AE be worked around using NPOTexture anyway..? Not sure...). I know this texture size is huge and eats a lot of RAM/VRAM but Android devices are getting more and more powerful...

49
Support / Re: Could not link shader program error
« on: May 01, 2017, 02:18:02 pm »
Actually, there should be some driver output in the log as well (as long as it produces some...).
There doesn't seem to be any driver output.
The GPU is a Vivante GC1000
I'll try to give logs of the OpenGL traces...

50
Support / Could not link shader program error
« on: April 30, 2017, 02:35:00 pm »
Hello,

I have a weird crash that I can't really explain since the logs don't give me enough information nor does the error stacktrace...
Stacktrace:
Code: [Select]
java.lang.RuntimeException: [ 1493390702610 ] - ERROR: Could not link shader program:
at com.threed.jpct.Logger.log(Logger.java:206)
at com.threed.jpct.GLSLShader.createProgram(GLSLShader.java:1131)
at com.threed.jpct.GLSLShader.loadProgram(GLSLShader.java:1113)
at com.threed.jpct.GLSLShader.preInit(GLSLShader.java:301)
at com.threed.jpct.GL20.setShader(GL20.java:388)
at com.threed.jpct.GLRenderer.setShader(GLRenderer.java:567)
at com.threed.jpct.CompiledInstance.render(CompiledInstance.java:191)
at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2472)
at com.threed.jpct.World.draw(World.java:1426)
at com.threed.jpct.World.draw(World.java:1109)
at com.aeroshark333.artofearthify.lw.LiveWallpaperRenderer.onDrawFrame(LiveWallpaperRenderer.java:1188)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1524)
at android.opengl.
I am using custom shaders and they do seem to work fine on most devices...
The only device that gave me this error happens to be my brother's phone (Samsung Galaxy S3 mini).
It works fine on my phone and enough other phones, however...

Thanks in advance :)

51
Support / Re: Model is not rendered correctly in Android using jpct-ae
« on: April 11, 2017, 08:50:24 pm »
Maybe you could try to increase the amount of maximum polygons visible...

Change this:

Code: [Select]
if (frameBuffer != null) {
      frameBuffer.dispose();
}

into:

Code: [Select]
if (frameBuffer != null) {
      frameBuffer.dispose();
}
Config.maxPolysVisible = 2*Config.maxPolysVisible;

And maybe it has some effects :)

(in case I do correctly see that some polygons are missing..)

52
I think pretty much everything in jpct works with radians rather than degrees... :P

53
Support / Re: How to place object at specific location of world?
« on: April 01, 2017, 12:46:32 am »
Uhm... I don't quite understand what you mean... Sorry

54
Support / Re: How to place object at specific location of world?
« on: March 31, 2017, 03:18:54 pm »
Hmmm you could add some scalar to the translation...
model.getRoot().translate(
      -1.5f * targetPosition.x -model.getRoot().getTransformedCenter().x,
      -1.5f * targetPosition.y -model.getRoot().getTransformedCenter().y,
      0);

With 1.5f being your scalar... Which could be any value up to you :)

55
Support / Re: How to place object at specific location of world?
« on: March 31, 2017, 11:18:20 am »
Oh my bad...

model.getRoot().translate(
      -targetPosition.x -model.getRoot().getTransformedCenter().x,
      -targetPosition.y -model.getRoot().getTransformedCenter().y,
      0);

I hope this will work...

56
Support / Re: How to place object at specific location of world?
« on: March 31, 2017, 08:57:06 am »
Oh hmmm, well you could try to swap this:
model.getRoot().translate(
      targetPosition.x -model.getRoot().getTransformedCenter().x,
      targetPosition.y -model.getRoot().getTransformedCenter().y,
      0);

To:
model.getRoot().translate(
      -targetPosition.x +model.getRoot().getTransformedCenter().x,
      -targetPosition.y +model.getRoot().getTransformedCenter().y,
      0);

Which should swap the translation direction into the opposite X and Y direction.

57
Support / Re: How to place object at specific location of world?
« on: March 30, 2017, 11:37:19 pm »
I guess it's best to do the translation when initializing your objects. (So it's just executed once rather than nonstop)
If you really need to do absolute translation during draw calls I guess this could work:

Private variable somewhere in your renderer class:
private SimpleVector absCoords = new SimpleVector (3.3f,3.3f,3.3f);

In your OnDraw loop:
yourObject.translate(absCoords.x -yourObject.getTransformedCenter().x,
absCoords.y -yourObject.getTransformedCenter().y,
absCoords.z -yourObject.getTransformedCenter().z);

This should pretty much keep your Object3D at the absCoords location. Even when you change absCoords during runtime it should still work :)

58
Support / Re: Make the camera follow an object3d
« on: February 07, 2017, 01:07:42 am »
the camera took the spaceships centerposition so it put itself on the spaceship so I cant see him :P. Here is my code https://1drv.ms/u/s!AvWnW88CHl4QhQ3HZryfAKLpa139
That was kind of the idea of the code I gave you...
But try messing a bit more with the second line.
The first line puts the camera at the center of the spaceship and the second line should move the camera 'backwards' with a certain distance.
Try increasing the value of this distance (I'd say somewhere between 3f and 21f...? But it depends how big your spaceship object is too...)

camera.setPosition(spaceship.getTransformedCenter());
camera.moveCamera(Camera.CAMERA_MOVEOUT, someDistance);



but im using the jcpt-ae. How can I load a texture into the Texture?
Eh... I suppose you're making an Android app... right?
You can use load images from drawables in Android and turn it into a Bitmap and then turn it into a Texture
http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Texture.html
http://www.jpct.net/jpct-ae/doc/com/threed/jpct/util/BitmapHelper.html
Tip: since OpenGL prefers textures with sides that are a power of 2... I recommend you to place the images in a 'drawable-nodpi' folder so Android won't resize these...

59
Support / Re: Make the camera follow an object3d
« on: February 05, 2017, 02:09:45 pm »
Hmmm, I see...

What about:
camera.setPosition(spaceship.getTransformedCenter());
camera.moveCamera(Camera.CAMERA_MOVEOUT, someDistance);

someDistance is a float value that would be totally up to you :)

60
Support / Re: Make the camera follow an object3d
« on: February 05, 2017, 11:07:22 am »
camera.lookAt(spaceship.getTransformedCenter());
Something like that?

Pages: 1 2 3 [4] 5 6 ... 12