Main Menu
Menu

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.

Show posts Menu

Messages - grog

#1
Projects / Re: Slink & Shank
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.
#2
Projects / Re: Thinking about some RPG..Android version.
September 13, 2013, 06:17:42 AM
Looking awesome as always!
#3
Projects / Re: Slink & Shank
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!
#4
Projects / Re: Slink & Shank
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:

http://www.youtube.com/watch?v=WT7foYTcr3A
#5
Aah, right.  Thanks!
#6
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.

java.lang.ArrayIndexOutOfBoundsException: 1790
at com.threed.jpct.Object3D.copy(Object3D.java:914)
at com.threed.jpct.Object3D.<init>(Object3D.java:786)
at com.threed.jpct.Object3D.<init>(Object3D.java:763)

I uploaded the mesh that resulted in the above error here.
#7
Projects / Slink & Shank
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:
Aiming

Slashing throat

Enemies on alert

First-person view


Thanks for checking it out.  I welcome any feedback.
#8
Support / Re: Shader performance on Tegra 2
June 11, 2013, 09:23:36 PM
Bummer. Thanks, Thomas.
#9
Support / Shader performance on Tegra 2
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:

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(normal.xyz, 0.0));
   
    gl_Position = modelViewProjectionMatrix * position;
}


Fragment shader:

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)));
}
#10
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.
#11
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:
(-1.2741067,-0.29999998,-0.79161346)
(0.83904916,-0.29999998,-1.2433811)

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.
#12
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.
#13
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!
#14
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.
#15
Support / Re: Collision allocations
April 22, 2011, 01:47:54 AM
Thank you, Egon.  That's much better.