31
Support / Re: How to use the BloomGLProcessor
« on: February 27, 2011, 09:30:44 am »
Nice, thanks the lower values worked fine.
Now how do I get an object to glow?
Now how do I get an object to glow?
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.
public void Text2PosTexture( String texID, String text , int startx , int starty, int fontsize , int Rcol , int Gcol, int Bcol )
{
Log.d(TAG, "public void Text2PosTexture( String texID ,String text , int startx , int starty, int fontsize , int Rcol , int Gcol, int Bcol )" );
int[] letterpos = new int[1];
int spacing=0;
//Log.d(TAG, "text.length="+text.length());
int[] fontType = new int[512 * 512];
int[] blitletter = new int[32 * 32];
Bitmap immutable_thatfont = Bitmap.createBitmap( 1024, 1024, Bitmap.Config.ARGB_4444 );
font_table.fontTarget = immutable_thatfont.copy(Bitmap.Config.ARGB_4444, true);
//choose font size
switch( fontsize )
{
case 1:
//normal 16
//Log.d(TAG, "16pt");
fontType = font_table.pixles_16pt;
spacing = font_table.MEDIUM_FONT_SPACING;
break;
case 2:
//large 32
//Log.d(TAG, "32pt");
fontType = font_table.pixles_32pt;
spacing = font_table.LARGE_FONT_SPACING;
break;
default:
//small 14
//Log.d(TAG, "14pt");
fontType = font_table.pixles_14pt;
spacing = font_table.SMALL_FONT_SPACING;
break;
}
//choose color to change to. H W RGB
fontType = modBitmapColor( fontType, 512 , 512 , Rcol , Gcol , Bcol );
//this will convert every leter of the string to a position on the font
//table .
for (int n=0;n<text.length();n++)
{
letterpos = Letter2TexturePos( text.substring(n,n+1) );
//return a blitmap letter to post to blitarray
blitletter = getBlitLetter( fontType, 512 , letterpos[1] , letterpos[0] );
//all fonts are 32x32 chunks will copy to a 1024x1024(6) texture.
font_table.blitmapZ = blitIntArray( font_table.blitmapZ , 6, blitletter , startx + (n * spacing),starty, 32 , 32 );
}
// Int[] to Bitmap
font_table.fontTarget.setPixels( font_table.blitmapZ , 0, 1024 , 0, 0, 1024 , 1024 );
//place font into texture.
Texture allfonts = new Texture( font_table.fontTarget , true );
immutable_thatfont.recycle();
immutable_thatfont = null;
System.gc();
TextureManager.getInstance().unloadTexture( fb, TextureManager.getInstance().getTexture( texID ) );
TextureManager.getInstance().replaceTexture(texID, allfonts );
}
E/AndroidRuntime( 2692): FATAL EXCEPTION: GLThread 9
E/AndroidRuntime( 2692): java.lang.OutOfMemoryError
E/AndroidRuntime( 2692): at com.threed.jpct.Texture.loadTexture(Texture.java:742)
E/AndroidRuntime( 2692): at com.threed.jpct.Texture.<init>(Texture.java:192)
E/AndroidRuntime( 2692): at com.threed.jpct.molespect.MoleSpect.loadTextures(MoleSpect.java:1364)
E/AndroidRuntime( 2692): at com.threed.jpct.molespect.MoleSpect.Text2PosTexture(MoleSpect.java:2022)
E/AndroidRuntime( 2692): at com.threed.jpct.molespect.MoleSpect.TextFormatTexture(MoleSpect.java:1819)
E/AndroidRuntime( 2692): at com.threed.jpct.molespect.MoleSpect.showElementpage(MoleSpect.java:1673)
E/AndroidRuntime( 2692): at com.threed.jpct.molespect.MoleSpect$MyRenderer.onDrawFrame(MoleSpect.java:2364)
E/AndroidRuntime( 2692): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)
E/AndroidRuntime( 2692): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
cannot find symbol
[javac] symbol : method preWarm(com.threed.jpct.FrameBuffer)
[javac] location: class com.threed.jpct.TextureManager
[javac] TextureManager.getInstance().preWarm(fb);