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

Pages: 1 2 [3] 4
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?

32
Support / Re: How to use the BloomGLProcessor
« on: February 27, 2011, 08:38:20 am »
Yes, neither end of the spectrum 10 or 500 or other will produce
 any amount of transparency.

33
Support / Re: How to use the BloomGLProcessor
« on: February 27, 2011, 12:55:00 am »
I have this in the config section

Config.glTransparencyMul = 0.1f;
Config.glTransparencyOffset = 0.1f;

And this is the line I add to my Object3D.

atom[n].setTransparency(500);

All I get is a solid, absolutely no transparency.


34
Support / Re: How to use the BloomGLProcessor
« on: February 27, 2011, 12:26:21 am »
The Molecule Viewer I am working on does not need it, OpenGL 1.1 will be ok , but was wanting to try it since the shaders looked really cool.

Can JPCT work with standard GL ES 1.1 to make items glow or use transparency?
Would like to have an option to look in side each atom shell (JPCT primitive sphere using transparency) in the molecule and have each electron glow inside the atom?




35
Support / Re: 3D demos
« on: February 26, 2011, 11:39:18 pm »
Yes i did, says no phones are associated wit this account. Which would be correct since I don't have any Android phone. But, do have a Android 2.2 device.

36
Support / Re: 3D demos
« on: February 26, 2011, 11:21:05 pm »
How do I get this for my tablet, Android app store wants my cell phone number of which my gtablet is no phone, do you have a direct link to the demo app? Would like to see this.

37
Support / Re: How to use the BloomGLProcessor
« on: February 26, 2011, 11:12:15 pm »
What kind of Shaders does the  AE version of JPCT have. Also, what about OpenGL es 2.0 , Would like to take advantage of this as well. Any examples?

38
Support / How to use the BloomGLProcessor
« on: February 26, 2011, 09:43:24 pm »
I tried to add the header imports

import com.threed.jpct.IRenderer;
and
import com.threed.jpct.procs.BloomGLProcessor;
When i try to compile with these added to the file I get

 package com.threed.jpct.procs does not exist
    [javac] import com.threed.jpct.procs.BloomGLProcessor;

Am I missing some pre process to get these to be recognized by the lib?
Or is this done in a different way now?

39
Support / Re: Out of memory
« on: February 25, 2011, 11:00:42 pm »
Add both lines to my app and it works like a charm, thanks.

added header

import com.threed.jpct.Config;

in oncreate

Config.unloadImmediately=true;






40
Support / Re: Out of memory
« on: February 25, 2011, 06:57:40 pm »
I have tried different methods of clearing the data from nulls recycles and garbage collection calls still to no avail. when I try  the removeAndUnload or Unload methods it just make the problem worse or die faster (i.e. the mem usage grows even faster). I have tried the preWarm method does not work at all for my situation.

Code: [Select]
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 );
}


If i comment out the last two lines everything works fine , but it will only  show the background with no text and the memory stays in the safe zone. if I start replacing the texture with the image of my background and text ,it just goes up and up and up until it crashes.

Which would lead me to believe it is the replacement method and not anything else although I now have really cleaned up the mem usage overall, just not the leak.

41
Support / Re: Out of memory
« on: February 25, 2011, 09:53:10 am »
I was going to enter a new topic but saw this one on the same issue I am having.

Code: [Select]
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)


I tried the preWarm() option but when I compile it says:
 
Code: [Select]
cannot find symbol
    [javac] symbol  : method preWarm(com.threed.jpct.FrameBuffer)
    [javac] location: class com.threed.jpct.TextureManager
    [javac]          TextureManager.getInstance().preWarm(fb);

While I use "fb" as a global for blitting my text which works fine. It is created like this
in my global section.

private FrameBuffer fb = null;

I use "fb" in multiple functions and works in the rest of the program.


Also, on the memory issue I run a memory checker and i tried:

replacing the texture --- memory usage still grows with each use.
unload and remove the texture then load news ones back in -- memory usage still grows with each use.
flush and reload all textures then add my new texture - memory still grows with each use.
Comment out the replacement of the new texture -- works fine memory stays in green, over and over just fine. Just does not add my modification texture. :(

No success with any of these options will keep trying to figure out why preWarm() is not working.








42
Projects / Re: Projects anyone?
« on: February 14, 2011, 12:47:55 am »
I am working on a simple PDB(protein database) molecular stick and ball viewer, will make a web page for it once I get the basics worked out.

The initial goal will be:
*understand molecular bonds
*understand atomic structures.
*levels of materials makeup - molecules - elements - atoms.(maybe electrons/protons)
*Elements and their relationships with each other.
*build a really cool 3D database to view many molecules using jpct. :)


Current issues:
*Getting text page to formatted 2D graphic document.     
  - Getting 2D page setup to blit to it and page up or down. 
*Loading DNA sized files of a few hundred atoms or more.
  - have memory checks in place now , have not tried this in a while.
*Touch sensitivity for zoom and double touch.
  - loose but works.
*Cannot handle PDB files without stick info (CONECT entries)
  - just need to check if it has them or not, if not bypass that section.
File format support for:
ATOM     - what is the name of and where are they located.
CONECT  - which atoms are bonded
HETATM  -treats it as a ATOM entry
http://www.wwpdb.org/documentation/format32/v3.2.html



43
Support / Re: Texture 1024^2 vs 512^2
« on: February 13, 2011, 11:17:00 pm »
Yes, it gets overwritten by by the immutable image to make a mutable one, which that seems to work. Just the size part I having problems with.

44
Support / Re: Texture 1024^2 vs 512^2
« on: February 13, 2011, 09:46:54 pm »
Will try that when I get a chance, I have bitmap fonts in a 512^2 image and they work fine, but I use a totally different method of loading them since I modify each pixel, but this image goes directly to the framebuffer.  Will post further if I gleen any more info from the problem.

45
Support / Texture 1024^2 vs 512^2
« on: February 13, 2011, 09:22:13 pm »
I had a problem with a 512^2 Texture and loading it to the frame buffer. It would draw the image skinny and twice or repeat Xx2 and Yx1.

I fixed it by making the image 1024^2 and scaling it down to the frame buffer how I wanted. but was wondering what the quirk was of this if any, will just use the 1024^2 image since it will do all I want, just wanted to post this in case it is a bug with Textures.

               Bitmap image = Bitmap.createBitmap( 512, 512, Bitmap.Config.ARGB_4444 );


....

               Bitmap immutable_imagebg = BitmapFactory.decodeResource(getResources(), R.drawable.elements_background );
               image = immutable_imagebg.copy(Bitmap.Config.ARGB_4444, true);
               Texture backpage = new Texture( image, true  );
               TextureManager.getInstance().addTexture("ElementBackground", backpage );


....

fb.blit( TextureManager.getInstance().getTexture( "ElementBackground"),
           0 , 0,
           0 , 0 ,
                          512 , 512,
           FrameBuffer.TRANSPARENT_BLITTING);


NOTE:createBitmap remained 512 while loading of the 512 or 1024 image , but the 1024 image works while the 512 does not.

Pages: 1 2 [3] 4