Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Seabolt

Member Since 26 May 2010
Offline Last Active Apr 17 2013 01:28 PM

Topics I've Started

Javah problems with class that extends Activity

07 April 2013 - 05:11 PM

Hey guys, I'm currently trying to write hello-jni but in my own code and projects to get an idea of the flow of getting an android app working.

I've setup my make file, my source file, got it all compiling. But I get an unsatisfied link error when I try to run the app. So I take a look around and see that I need to run the javah to create a .h file that will forward declare my function and avoid name mangling.

So I setup an external tool in Eclipse using this guide, and it seems to work fine, except I get an error saying

"Error: cannot access android.app.Activity

  class file for android.app.Activity not found"

From what searching I've done it's because it can't find the android.jar in the sdk directory, but how to I provide it properly? Or is that what is actually being looked for? 

I'm so close to getting this to work haha.

Android Hello-JNI Build Help

03 April 2013 - 05:17 PM

Hey guys,

I've started development on Android, and currently it is handing me my butt. 

Let me give you a little timeline so far and make sure that I haven't screwed anything up:

I applied to the nVidia Tegra3 Developers group which they approved me for.
I "installed" android NDK using their installer. It supposedly installs everything needed to develop android. 

I do indeed have the Android SDK, NDK, Eclipse and Ant installed. A cursory look at my environment variables looks like the setup enough for me.

So then I bumble around Eclipse, (I've been a spoiled developer too long working in VS), and import the hello-jni project.

I run the build, it says I'm missing an environment variable for my project. Easy enough, setup an env var called NDK_PROJECT_PATH going to the root directory for the project.

I run the build again, and I get a bunch of warnings and the make command fails. 
Here are the warnings I get:

C:\NVPACK\android-ndk-r8d>ndk-build
C:/NVPACK/android-ndk-r8d/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-8 is larger than android:minSdkVersion 3 in C:\NVPACK\android-ndk-r8d\samples\hello-jni/AndroidManifest.xml
C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:167: warning: overriding commands for target `C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:150: warning: ignoring old commands for target `C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:439: warning: overriding commands for target `C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:167: warning: ignoring old commands for target `C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:357: warning: overriding commands for target `C:\NVPACK\android-ndk-r8d\samples\hello-jni/obj/local/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:357: warning: ignoring old commands for target `C:\NVPACK\android-ndk-r8d\samples\hello-jni/obj/local/armeabi'
The process cannot access the file because it is being used by another process.
Gdbserver      : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
The system cannot find the path specified.
make: *** [C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi/gdbserver] Error 1
Press any key to continue . . .

 

Now I'm looking for some general help on what seems to be a very newby question:

How can I get Hello World to compile?

I see that it can't find a path specified. But I have no idea what path they're talking about. Also I see an error regarding accessing a file that's in use, but I don't have much of anything running.

I'm working on a Windows 7 machine, and while I'm an experienced programmer, this is my first time venturing outside of Visual Studios at all, so please don't assume much knowledge from me :)

Thanks!


How feasible is using the NDK?

06 March 2013 - 10:14 AM

Hey, sorry to piggy back on this thread, but I'm also just doing an introductory look into android, but I'm looking to use the NDK. How feasible is using the NDK? How easy is it to integrate an already made C++ engine to work with Android? I know there is some unavoidable Java code that I'll have to write to query platform features and such, but how intrusive is that code?

I'm an experienced C++ programmer and would really like to target the platform if it doesn't require a whole rewrite of my engine.


Stabilizing Shadow Map Edges

06 March 2013 - 09:42 AM

Hey guys, I've implemented shadow maps in my current project, but the edges are shimmering like crazy. I've read that the solution is the reduce shadow map movement to texel sized increments. I've tried a lot of different ways of doing this but can't seem to get it right. 

Here is my stabilization code:

 

	if( mSnapCamera )
	{
		WMatrix shadowMatrix;
		WMatrixMult( &mLightViewMatrix, &mLightProjMatrix, &shadowMatrix );

		float shadowMapWidth = (float)mMapWidth;
		float shadowMapHeight = (float)mMapHeight;

		WVector shadowOrigin = { 0.0f, 0.0f, 0.0f };
		WMatrixTransformPoint( &shadowMatrix, &shadowOrigin );
		
		shadowOrigin.x *= (shadowMapWidth / 2.0f);
		shadowOrigin.z *= (shadowMapHeight / 2.0f);

		float roundedX = ROUND( shadowOrigin.x );
		float roundedZ = ROUND( shadowOrigin.z );

		float dX = roundedX - shadowOrigin.x;
		float dZ = roundedZ - shadowOrigin.z;

		dX /= (shadowMapWidth / 2.0f);
		dZ /= (shadowMapHeight / 2.0f);

		mStabilizers.set( dX, 0.0f, dZ );
	}

 

 A couple of things to note: The coordinate system I'm working in is Z-up. This is only a single orthographic projection shadow map from a directional light.

Another thing I'm not sure about is if I'm calculating my bounding sphere around a frustum correctly. Do you guys see any issues with this?

 

//
// WShadowMap::GetBoundingSphereForFrustum
// Inputs:
//		WVector* points: The frustum points
//		WVector* outCenter: The vector that will be the center of the sphere
//		float* outRadius: The out radius for the sphere
// Outputs:
//		WVector* outCenter: The sphere center
//		float* outRadius: The sphere radius
// Description:
//		Will generate a bounding sphere based on a series of frustum points
//

void	
WShadowMap::GetBoundingSphereForFrustum( WVector* points, WVector* outCenter, float* outRadius )
{
	if( outCenter == NULL || outRadius == NULL )
		return;

	//
	// Determine min/max of the points
	//

	WVector min = { FLT_MAX, FLT_MAX, FLT_MAX };
	WVector	max = { -FLT_MAX, -FLT_MAX, -FLT_MAX };
	
	for( int currentPoint = 0; currentPoint < 8; ++currentPoint )
	{
		min.x = MIN( min.x, points[ currentPoint ].x );
		min.y = MIN( min.y, points[ currentPoint ].y );
		min.z = MIN( min.z, points[ currentPoint ].z );

		max.x = MAX( max.x, points[ currentPoint ].x );
		max.y = MAX( max.y, points[ currentPoint ].y );
		max.z = MAX( max.z, points[ currentPoint ].z );
	}

	//
	// Now determine the center
	//

	outCenter->x = 0.5f * (min.x + max.x);
	outCenter->y = 0.5f * (min.y + max.y);
	outCenter->z = 0.5f * (min.z + max.z);

	//
	// Now determine the radius
	//

	float diameter = max.x - min.x;
	diameter = MAX( diameter, max.y - min.y );
	diameter = MAX( diameter, max.z - min.z );

	*outRadius = diameter / 2.0f;
}

 

Sorry for the code dump, I'm just on a tight deadline and I've already spent almost a whole day on this. 

Thanks for any help, guys!


Is anyone else's Pix for Windows crashing since the latest windows update?

28 February 2013 - 08:44 AM

Hey guys,


Last night I left work while working with PIX, and when I came back to work this morning, my computer had updated. Now Pix crashes everytime I try to start a new experiment. Is anyone else getting this? I tried a re-install and it didn't seem to work.


PARTNERS