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

Pages: 1 ... 3 4 [5] 6 7 ... 16
Support / Re: getSphere high RAM usage
« on: September 27, 2012, 12:21:41 pm »
Ok will do thanks Egon.

Support / getSphere high RAM usage
« on: September 27, 2012, 10:10:15 am »
I have about 32-50 textured spheres in my scene, they are fairly simple, no shaders (using default jPCT shaders), 256x256 texture sizes (total 5 textures shared).

For some reason when I increase the face count from 16 to 32, RAM usage almost doubles:

no spheres = 26MB/48MB
16 faces = 27MB/48MB
24 faces = 33MB/48MB
32 faces = 41MB/48MB

Surely adding an additional 16 faces per globe (800 extra in total) wouldn't cause such a huge spike?

obj3DMain = Primitives.getSphere(32, fScale); // 16 // 24

jPCT 1.26 beta
Galaxy Note / Intel Emulator+HAX (same outcome on both)

Support / Re: Version updates!
« on: September 26, 2012, 03:15:43 pm »
Below is the vertex shader, the three attributes are 1000 in length stored in an array of floats uploaded to the shader as an array with pointers pointing to each of the three attributes... at least that's what I understand. If you open the java link it has the shader program and array code near the top.

Code: [Select]
uniform float u_time;
uniform vec3 u_centerPosition;

attribute float a_lifetime;                         
attribute vec3 a_startPosition;                     
attribute vec3 a_endPosition;                       

varying float v_lifetime; 

void main()                                         
  if ( u_time <= a_lifetime )
  { = a_startPosition + (u_time * a_endPosition);
                       += u_centerPosition;             
    gl_Position.w = 1.0;                             
    gl_Position = vec4( -1000, -1000, 0, 0 );       
v_lifetime = 1.0 - ( u_time / a_lifetime );       
v_lifetime = clamp ( v_lifetime, 0.0, 1.0 );       
gl_PointSize = ( v_lifetime * v_lifetime ) * 40.0;

Support / Re: Version updates!
« on: September 26, 2012, 01:32:26 am »
The GLSL Docs mention 'Note: Because jPCT-AE doesn't support vertex attributes for external usage ATM, there are no setters for these. If you need additional data of that kind, consider baking it into a texture instead'

If it's not a hassle Attribute support would be great. I would like to use a shader that uses a large array in java code, unless there is a way to add a float[1000] into the shader program itself?

Here is the shader I would like to use:

Support / Re: Shaders and SetTransparency
« on: September 25, 2012, 03:30:27 pm »
I see a lot of "Loading default shaders (...)" in the logs so I assume calling setTexture() with no call to setShader on objects will use a default shader.

I am using jPCT in a Live Wallpaper so perhaps that has something to do with it. The code logic looks fine to me but I'll persist and look into making a test case as an App.

Appreciate the help.

Support / Re: Version updates!
« on: September 25, 2012, 03:19:56 pm »
Any progress on implementing Shader Attributes? i.e. use of functions GLES20.glVertexAttribPointer and GLES20.glEnableVertexAttribArray

No rush, just wandering :)

Support / Re: Shaders and SetTransparency
« on: September 25, 2012, 01:51:47 pm »
I'm very new to ES2.0, how do I set it to a default shader?

shader = new GLSLShader("defaultVertexShader.src","defaultFragmentShader.src");
.. throws an exception.

If I set a normal texture to the Object3D, wouldn't that use the default shader? If yes, the globe on the left has a normal texture.

It's happening on both the phone and emulator by the way. Both are Jellybean (4.1.x)

Support / Re: Shaders and SetTransparency
« on: September 25, 2012, 01:40:14 pm »
Left image is before, right is after.

The globe on the left is a normal texture with transparency. Globe on the right has the shader.

Notice the first image is missing transparency of the normal texture, and heavy shadows on the shaded globe.

[attachment deleted by admin]

Support / Re: Shaders and SetTransparency
« on: September 25, 2012, 01:35:03 pm »
Yes, 1.25 and 1.26 beta.

I'll post up a screenshot of before and after in a moment.

Support / Re: OpenGL ES 2.0 support (including shaders)
« on: September 25, 2012, 09:56:21 am »
Sorry to dig up an old thread but I noticed a few 'WTF' comments in the default jPCT shaders, perhaps this info can help;

Varyings are used for passing data from a vertex shader to a fragment shader. Varyings are (perspective correct) interpolated across the primitive. Varyings are read-only in fragment shader but are read- and writeable in vertex shader (but be careful, reading a varying type before writing to it will return an undefined value). If you want to use varyings you have to declare the same varying in your vertex shader and in your fragment shader.

All uniform, attribute and varying types HAVE to be global. You are not allowed to specify a uniform/attribute/varying type in a function or a void.


Support / Re: Shaders and SetTransparency
« on: September 25, 2012, 05:15:39 am »
For some reason the shaded textures are very dark and appear to be heavily shadowed when the app is launched. If I jump into another app then back into my app, the scene is reloaded and the shaded textures become bright and normal.

I'm creating the ambient light and sun light _before_ creating and setting the shader, am I supposed to load things in a particular order to get the lighting working properly?

Support / Re: Shaders and SetTransparency
« on: September 25, 2012, 02:10:19 am »
I see, thanks Thomas.

My main goal is to implement Volumetric Clouds and Mega Particles to my app using Shaders but not sure how to proceed. Time for some research..

Support / Re: GLES 2.0 and the emulator
« on: September 24, 2012, 04:25:10 pm »
Yeah there is probably some heavy emulation happening in the background causing excessive performance issues. Worse yet, the emulation may be done within the Android VM CPU (linux display driver) rather than the Desktop CPU... who knows. Hopefully they will improve things at a later stage. GPU acceleration is experimental after all.

Either way, my apps perform fine (probably due to the minimal shader usage). For me it's a breath of fresh air testing my apps in the emulator rather than on the cumbersome phone.

Support / Shaders and SetTransparency
« on: September 24, 2012, 04:12:57 pm »
I've just started learning ES2.0 using the included HelloShader example as a base, I'm trying to make the shaded face texture transparent using the usual Object3D.SetTransparency but it doesn't work at all. SetAdditionalColor also doesn't work.

Do these functions only work with standard non-shaded textures?

I'm guessing you would need to add these functions as code in the shader program.

Support / Re: GLES 2.0 and the emulator
« on: September 24, 2012, 04:18:35 am »
I tried it myself after remembering that i got this fatal crash with my old Radeon 5870. Now with the GTX 680, it works. I got the same memory error and fixed it in the same way...strange. The rendered image looked good, but performance is p*** poor. From a Core i7 @ 4Ghz, 16GB, GTX 680 setup, i would expect a little more than max. 7 fps in my RPG thingy @  800*480. In the dungeons, it slowed down to 4 fps...maybe because of the parallax mapping shader that i'm using. So while it worked technically, it's far too slow IMHO. At least when using OpenGL 2.0. It might be better with 1.x.

I have a very similar PC setup so you should be getting much better performance than that. I'm seeing 60FPS with some OpenGL 1.0 apps at 1280x800 in Tablet mode using the Intel Android image ( the ARM7 image is still sloowwww )

Are you sure GPU acceleration is enabled? The GPU option was missing in the AVD Manager so I had to use the "-gpu on" command line option. Enter the command line at the bottom of the dialog in Eclipse->Select your project->Run Menu->Run configurations->Target.

Or send me the APK and I'll give it a test.

Pages: 1 ... 3 4 [5] 6 7 ... 16