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

Pages: [1] 2
Projects / Re: Slink & Shank
« on: September 13, 2013, 09:49:28 pm »
Thanks, Thomas!  Replied.  For anyone else interested in beta testing, you can send a request to join one of the following:
Google Group
Google+ Community
I'll approve you, and then you can follow the link to the opt-in. The link is posted on both the group and the community.

Projects / Re: Thinking about some RPG..Android version.
« on: September 13, 2013, 06:17:42 am »
Looking awesome as always!

Projects / Re: Slink & Shank
« on: September 13, 2013, 06:16:26 am »
Thanks, guys!  Looks like betas in Google Play can only be distributed to members of a Google Group or Google+ Community.  If anybody is interested in getting the published beta, I can link to the Google Group.  Otherwise, I guess we'll have to wait for the main release!

Projects / Re: Slink & Shank
« on: September 12, 2013, 05:58:59 am »
Oops, missed your reply earlier.  Thanks!  Might be you're thinking of Metal Gear Solid?  It was a heavy inspiration (right down to the PSX graphics).  I actually cut up a gameplay video shortly after my original post:

Support / Re: ArrayIndexOutOfBoundsException on Object3D.copy()
« on: September 09, 2013, 07:57:12 am »
Aah, right.  Thanks!

Support / ArrayIndexOutOfBoundsException on Object3D.copy()
« on: September 09, 2013, 04:31:17 am »
I am trying to port my Android project to PC and getting an exception during Object3D.copy() when invoking the Object3d(Object3D) constructor and Object3D.cloneObject().  Everything is working fine on the Android version.  Seems to happen on all of my objects (which are serialized MD2s), although with a different array index of course.  Using the latest version from the Download page.
Code: [Select]
java.lang.ArrayIndexOutOfBoundsException: 1790
at com.threed.jpct.Object3D.copy(
at com.threed.jpct.Object3D.<init>(
at com.threed.jpct.Object3D.<init>(
I uploaded the mesh that resulted in the above error here.

Projects / Slink & Shank
« on: August 31, 2013, 06:52:06 am »
I've been working on this project, on-and-off for about 2 years.  It's a stealth action game where you try to sneak by enemies, cameras, and gun turrets undetected.  I have a mostly complete beta, and planning to release sometime in the next month or so. 

Most of the game is played in third-person, but you can look and shoot from first-person view, as well as stick to walls and peek around corners.  The focus is on sneaking, but you can fire assault rifles, shotguns, pistols, throw grenades, and slash throats too. 

Some screenshots from the latest beta:

Slashing throat

Enemies on alert

First-person view

Thanks for checking it out.  I welcome any feedback.

Support / Re: Shader performance on Tegra 2
« on: June 11, 2013, 09:23:36 pm »
Bummer. Thanks, Thomas.

Support / Shader performance on Tegra 2
« on: June 11, 2013, 06:14:29 am »
I'm wondering if anyone has managed to get decent shader performance on Tegra devices.  My shader uses all 8 lights provided by jPCT and calculates per-pixel lighting on textured geometry in the fragment shader.  It does nothing else and has no conditional statements.  On a Galaxy S4, my game (including all game logic etc) gets 50-60fps. No surprises there. Even on my old HTC Evo I get an acceptable framerate (20-30fps).  On a Motorola Xoom, it's down to an unplayable 1-3fps.

I tried the default shaders and it runs at a solid 60fps.  I tried using a stripped-down version of my shader with just one light and the framerate dropped immediately to 20fps.  Am I doing something inefficient? Is per-pixel lighting just a no-go for Tegra 2?  My stripped-down 1 light shaders are below:

Vertex shader:
Code: [Select]
uniform mat4 modelViewMatrix;
uniform mat4 modelViewProjectionMatrix;
uniform mat4 textureMatrix;

attribute vec4 position;
attribute vec3 normal;
attribute vec2 texture0;

varying vec2 texCoord;
varying vec3 vNormal, vPosition;

void main()
    texCoord = (textureMatrix * vec4(texture0, 0, 1)).xy;
    // Transform the vertex into eye space.
    vPosition = vec3(modelViewMatrix * position);
    // Transform the normal's orientation into eye space.
    vNormal = vec3(modelViewMatrix * vec4(, 0.0));
    gl_Position = modelViewProjectionMatrix * position;

Fragment shader:
Code: [Select]
precision mediump float;

varying vec2 texCoord;
varying vec3 vNormal, vPosition;

uniform vec4 ambientColor;
uniform sampler2D textureUnit0;
uniform float shininess;
uniform vec3 lightPositions[8];
uniform vec3 diffuseColors[8];
uniform vec3 specularColors[8];
uniform float attenuation[8];

void main()
    float diffuse0 = 0.0;
    vec3 diffColor0 = vec3(0.0,0.0,0.0);
    // For attenuation
    float quadratic = 0.01;
    float distance = length(lightPositions[0] - vPosition);
    // Get a lighting direction vector from the light
    vec3 lightVector = normalize(lightPositions[0] - vPosition);
    // Calculate the dot product of the light vector and vertex normal.
    diffuse0 = max(dot(vNormal, lightVector), 0.1);
    // Add attenuation
    float att = 1.0 / (1.0 + (attenuation[0] * distance) + (quadratic * distance * distance));
    diffuse0 = att * diffuse0;
    diffColor0 = (diffuseColors[0] * diffuse0) + (att * specularColors[0] * shininess);
    vec4 base = texture2D(textureUnit0, texCoord);
    gl_FragColor = (base) * (ambientColor + (vec4(diffColor0, 1.0)));

Support / Multitexture and multiple lights (shader)
« on: May 03, 2013, 02:47:48 am »
Is it the case that only one light is passed to the shader when you use multitexturing?  Seems like my multitextured faces are only affected by one of the lights in my world.

Edit: OK, by manually assigning the shader to my Object3D instead of just overriding the default shaders, all lights seem to be affecting it,but my shader is also behaving differently in general.  The light attenuation seems to be much greater after assigning manually such that the lights affect a much smaller area than they did before and the scene looks way darker overall.  I am a shader novice, so I don't really know what to make of this.  Would appreciate any help.

Edit2: I think I was just confused about which default shaders I had actually overridden. Everything seems to be in order, so this thread may be disregarded.

Support / Re: checkForCollisionSpherical for small sphere
« on: April 10, 2013, 10:08:09 pm »
I just tried an older version of my code when I used the ellipsoid method to see if I could pull a specific movement vector when the collision didn't register.  My ellipsoid was a SimpleVector of (0.5, 0.5, 0.5), and the translation vector was (0.222294,-0.29999998,-1.4834371).  With these values, the grenade passed through a plane undetected.

Also failed for translations:

Hope that is at all useful.  I can't really see any consistency between when it works and when it doesn't on my end.  Getting those values just consisted of randomly throwing grenades at different spots until one went through a wall, although once I found a spot all subsequent grenades do pass through undetected as well.

Support / Re: checkForCollisionSpherical for small sphere
« on: April 09, 2013, 09:16:16 pm »
Ok, so I adjusted my method to subdivide the translation vector based on the radius of the sphere and make successive calls to checkForCollisionSpherical() until the entire desired movement length is reached.  So far, everything seems to be working perfectly.

Support / Re: checkForCollisionSpherical for small sphere
« on: April 09, 2013, 08:39:22 am »
Ahh, that's good to know about the spherical algorithm. Makes sense now why it's not quite working for me.  Hmm, I might have to take another look at ellipsoid, or maybe I can subdivide the translation like you say.  Thanks much!

Support / checkForCollisionSpherical for small sphere
« on: April 08, 2013, 11:26:33 pm »
I have a large mesh that I use for a level and multiple smaller meshes representing players that reside within it.  The players collide with each other and the map without issue, using a mix of ellipsoid and spherical checks.  I also have even smaller meshes that I was using for grenades, but the spherical collision detection is not working consistently for these unless I use a radius that is way too large.  Basically, using checkForCollisionSpherical with radius 0.5, sometimes the grenades collide with the walls/floor correctly, but other times they pass straight through without registering a collision.  The same things happens with ellipsoid collision at the same size. If I up the radius to 1, every collision is detected, but the result looks bad because the grenade reacts before it visually hits the wall and floats above the floor due to the too-large sphere. If I decrease the radius (say 0.3), no collisions are detected.

I tried checking the docs for some config settings that might help, but I don't see anything that obviously relates to this.  Playing with Config.collideOffset didn't seem to make a difference. I would appreciate any help/ideas.

Support / Re: Collision allocations
« on: April 22, 2011, 01:47:54 am »
Thank you, Egon.  That's much better.

Pages: [1] 2