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

Topics - raft

#21
Support / unloading texture
February 16, 2013, 05:21:38 AM
two things:

1. Desktop and AE behaves differently when unloading a texture.

TextureManager tm = TextureManager.getInstance();

tm.addTexture("box", new Texture("box.jpg"));
tm.unloadTexture(buffer, tm.getTexture("box"));
tm.addTexture("box", new Texture("box.jpg"));


this code creates an error on desktop, saying texture 'box' has been declared twice. it runs okey on AE

2. on Desktop, after removing/unloading and re-adding, we end up with a white texture

TextureManager tm = TextureManager.getInstance();

tm.addTexture("box", new Texture("box.jpg"));
tm.removeAndUnload("box", buffer);
tm.addTexture("box", new Texture("box.jpg"));



#22
Support / near plane setting changes blit location
February 15, 2013, 09:29:28 PM
for example the setting below causes blit locations expanded: a blit at 0,0 is displayed at -x,-y

Config.nearPlane = 0.9f;
Config.glIgnoreNearPlane = false;


indeed this was fixed before but somehow broken again. see this post

i'm using jpct 2.6 and lwjgl 2.8.5
#23
I'm creating an Object3D by supplying coordinates array:

new Object3D(coordinates[142509], uvs[95006], indices[480], TextureManager.TEXTURE_NOTFOUND);

numbers indicate the actual length of arrays. this code throws an java.lang.ArrayIndexOutOfBoundsException: 731. I dont know where that 731 comes from ::)

here is a test case:

public class MeshTest {

public static void main(String[] args) throws Exception {
String file = "C:/tmp/bones_tmp/test_mesh.ser";

            FileInputStream fis = new FileInputStream(file);
ObjectInputStream in = new ObjectInputStream(fis);

float[] coordinates = (float[]) in.readObject();
float[] uvs = (float[]) in.readObject();
int[] indices = (int[]) in.readObject();

fis.close();

new Object3D(coordinates, uvs, indices, TextureManager.TEXTURE_NOTFOUND);

}

}


and test data: http://aptalkarga.com/tmp/test_mesh.ser
#24
Support / blitting and GL color
April 08, 2012, 06:09:27 PM
I'm drawing some lines to screen via GL calls for debugging purposes. I set the color with the call

GL10.glColor4f(..);

this normally works fine. but if I do this after blitting text, with the call

FrameBuffer.blit(.. RGBColor addColor)

my glColor4f call does not work any more. instead all lines are drawn in the last color passed to FrameBuffer.blit.

any ideas what may cause this?
#25
Bugs / creating Object3D with no indices
December 28, 2011, 12:25:39 PM
this call
new Object3D(new float[12], null, null, -1);

throws a
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
at com.threed.jpct.Object3D.<init>(Unknown Source)


I guess this is a bug
#27
Support / FrameBuffer.getPixels()
September 21, 2011, 09:23:48 PM
Does FrameBuffer.getPixels() create a new pixel array all the time? If so, is it possible to add a variant which accepts an int array?
#28
Support / hw acceleration on emulator
May 18, 2011, 02:46:25 AM
seems as finally google started working on it and will be available soon ;D

for more information have a look at below video around 43rd minute:
http://androidappdocs.appspot.com/videos
#29
Feedback / imageshack images
February 27, 2011, 10:35:25 AM
i can't see most of the images hosted at imageshack.us, instead i see an image saying domain is not registered:



does anybody know what's going on?
#30
Support / unload and replace a texture
January 17, 2011, 04:21:45 AM
-in terms of memory usage- what's the best way of replacing a texture?

i sometimes got an OutOfMemoryError after replacing skybox textures, typically at prewarm stage. if i do removeAndUnload first instead of replacing i end up with white empty textures. i may be doing something wrong with removeAndUnload thing.
#31
Support / frustum culling
January 12, 2011, 01:32:02 AM
have a look at the image below. in the upper part, half of tile is invisible. it's cut. is there anything to prevent this? it also happens in desktop JPCT.

#32
Support / default object transparency
January 11, 2011, 07:37:49 PM
i set Config.glTransparencyMul to a low value (0.001) for finer control over transparency. but then some of my objects became invisible. seems as Loader.load3DS(InputStream, scale); sets transparency to 100 and in my case this makes my objects almost invisible.

it may make sense if Loader sets transparency to -1.
#33
Support / Texture.keepPixelData(..) working correct?
December 22, 2010, 06:00:43 PM
even if i call Texture.keepPixelData(false), after a GL context loss, all textures are in place. how is this happening?
#34
Support / texture recovery
December 21, 2010, 03:20:37 PM
after GL context is lost and recreated (for example after pressing home button and returning back to activity), textures are re-uploaded to gpu automatically when they are needed. this is great but has a side effect, we got a delay.

in my game, i use android widgets for in game gui (not for the overlays and in-game buttons but for paused menu etc). when user returns the activity, paused menu instantly appears (since it's android gui) with a black background, this lasts a few seconds (most textures are re-uploaded), then game is rendered in background, when user presses resume button, then another delay happens (this time overlay textures are re-uploaded, they werent rendered in paused state). not a nice experience for user. i'm not sure how to cope with this

* leave it as it's :)
* adding a method to TextureManager to manually force all textures re-upload may help.
#35
Support / Comfig.isIndoor
December 17, 2010, 06:26:52 PM
my skybox is a 6 side cube so it's always guaranteed the whole scene is filled. although skybox and game is rendered in different worlds, i guess i can safely use Config.isIndoor = true in this case?

but there is no such setting in AE version, intentional?
#36
Support / NPE, what is null here?
December 17, 2010, 03:44:15 AM
this sometimes happes when i press home button. not sure what is null here?

java.lang.NullPointerException
at com.threed.jpct.GLRenderer.blit(GLRenderer.java:1252)
at com.threed.jpct.GLRenderer.execute(GLRenderer.java:1668)
at com.threed.jpct.FrameBuffer.blit(FrameBuffer.java:594)
at raft.glgui.android.TexturePack.blit(TexturePack.java:259)
..
#37
Support / camera rotation
December 16, 2010, 08:31:06 PM
i've faced some strange behaviour: i rotate a default camera around X axis once, then rotate around Y axis in each iteration. i expected camera direction's Y value remain same, but it doesn't ??? am i missing something?

a simple test case:
Camera camera = new Camera();

camera.rotateCameraX(0.5f);
System.out.println(camera.getDirection());

for (int i = 0; i < 100; i++) {
camera.rotateCameraY(0.1f);
System.out.println(camera.getDirection());
}


genarates this output:
(0.0,0.47942555,0.87758255)
(0.09983342,0.47703043,0.87319833)
(0.19866934,0.46986896,0.86008936)
(0.2955202,0.4580127,0.83838665)
(0.3894183,0.44158012,0.80830705)
(0.47942552,0.42073545,0.77015114)
(0.5646425,0.39568692,0.7243002)
(0.64421767,0.36668482,0.6712122)
(0.7173561,0.33401895,0.6114177)
(0.78332686,0.29801565,0.5455141)
(0.84147096,0.2590347,0.4741599)
(0.89120734,0.21746553,0.39806813)
(0.9320391,0.17372355,0.31799892)
(0.96355814,0.12824576,0.23475236)
(0.98544973,0.08148658,0.14916027)
(0.997495,0.033913214,0.062077798)
(0.9995736,-0.013999004,-0.02562493)
(0.99166477,-0.06177134,-0.11307162)
(0.9738477,-0.10892649,-0.19938853)
(0.9463001,-0.15499327,-0.28371322)
(0.90929747,-0.19951141,-0.36520314)
(0.8632094,-0.2420361,-0.4430441)
(0.8084964,-0.28214246,-0.5164583)
(0.7457052,-0.31942976,-0.5847122)
(0.6754632,-0.35352537,-0.6471239)
(0.5984721,-0.38408872,-0.7030697)
(0.5155013,-0.41081437,-0.7519906)
(0.42737985,-0.43343526,-0.7933979)
(0.33498812,-0.45172545,-0.8268779)
(0.23924929,-0.4655021,-0.85209596)
(0.14111997,-0.47462767,-0.86880016)
(0.041580625,-0.47901088,-0.8768236)
(-0.05837419,-0.47860798,-0.8760861)
(-0.15774575,-0.473423,-0.86659503)
(-0.25554118,-0.46350774,-0.84844524)
(-0.35078332,-0.44896123,-0.821818)
(-0.44252056,-0.4299289,-0.7869795)
(-0.52983624,-0.40660077,-0.7442778)
(-0.61185795,-0.37921008,-0.6941395)
(-0.6877662,-0.34803045,-0.63706553)
(-0.7568025,-0.3133734,-0.5736263)
(-0.8182771,-0.2755852,-0.50445545)
(-0.87157583,-0.2350435,-0.43024442)
(-0.91616595,-0.19215329,-0.3517344)
(-0.95160204,-0.14734314,-0.26971)
(-0.9775301,-0.101060815,-0.18499076)
(-0.993691,-0.053768713,-0.09842313)
(-0.9999232,-0.0059393654,-0.010872105)
(-0.99616456,0.041949324,0.07678756)
(-0.9824526,0.08941887,0.16368)
(-0.95892423,0.13599499,0.248937)
(-0.9258147,0.18121228,0.3317067)
(-0.8834546,0.22461894,0.41116208)
(-0.83226746,0.26578128,0.48650926)
(-0.77276444,0.30428803,0.5569954)
(-0.7055403,0.33975443,0.6219163)
(-0.6312666,0.37182614,0.6806231)
(-0.55068547,0.40018266,0.73252946)
(-0.4646021,0.4245407,0.7771165)
(-0.3738766,0.44465685,0.8139389)
(-0.2794154,0.46033013,0.8426287)
(-0.18216243,0.47140402,0.8628993)
(-0.08308933,0.47776774,0.87454796)
(0.016813975,0.47935775,0.87745845)
(0.11654928,0.47615823,0.87160176)
(0.21512006,0.46820104,0.8570363)
(0.3115414,0.45556572,0.83390754)
(0.40484998,0.4383786,0.8024467)
(0.4941134,0.41681132,0.76296806)
(0.5784398,0.3910794,0.71586615)
(0.6569866,0.3614399,0.6616115)
(0.7289691,0.32818907,0.6007462)
(0.7936679,0.29165906,0.5338785)
(0.8504367,0.2522149,0.46167642)
(0.8987081,0.2102507,0.3848614)
(0.938,0.16618574,0.30420104)
(0.9679197,0.120460294,0.2205012)
(0.98816824,0.07353123,0.13459817)
(0.9985433,0.025867486,0.047350273)
(0.9989413,-0.022054719,-0.04037072)
(0.9893582,-0.06975656,-0.12768835)
(0.96988976,-0.116761416,-0.21373016)
(0.9407305,-0.16259962,-0.29763645)
(0.9021718,-0.20681317,-0.37856883)
(0.8545988,-0.24896036,-0.45571876)
(0.798487,-0.28862,-0.5283152)
(0.73439705,-0.32539585,-0.5956329)
(0.6629692,-0.35892045,-0.65699923)
(0.5849171,-0.38885882,-0.71180105)
(0.50102085,-0.4149119,-0.75949085)
(0.41211846,-0.43681926,-0.79959196)
(0.31909832,-0.45436206,-0.8317039)
(0.22288986,-0.46736506,-0.8555057)
(0.124454334,-0.4756983,-0.8707596)
(0.02477531,-0.4792785,-0.87731314)
(-0.075151265,-0.4780699,-0.8751008)
(-0.17432697,-0.4720846,-0.8641448)
(-0.27176085,-0.46138236,-0.84455454)
(-0.3664794,-0.44607013,-0.81652576)
(-0.45753616,-0.42630094,-0.7803385)
(-0.5440214,-0.40227225,-0.73635435)
#38
Support / memory and gc
December 13, 2010, 06:47:49 PM
this is a bit annoying: according to my tests, the less objects you create, the less frequently dalvik garbage collects. but when it does, it collects many objects at once and hence the delay gets larger. kind of dilemma :-\ my gl thread's priority was 8, i left as default (5) but that didnt help.

anyway, inspecting memory allocations i've spot some methods. it may be worth improving them:
* Camera.lookAt creates a new Matrix all the time. instead using an instance field may help
* Camera.getPosition() is used frequently, so it may be worth adding a Camera.getPosition(SimpleVector) method
#39
Feedback / technopolies.net malware ?
November 07, 2010, 10:26:51 PM
windows chrome just warned me about jPCT.net may contain malware content as it has a link to technopolies.net.

fyi
#40
Projects / Sky Maze 3D
October 20, 2010, 03:16:56 AM
as in game graphics are almost complete, it's time to go public :D

this is a simple ball control game, purpose is to reach exit tile. controlled by touching screen and requires multi touch. seems as an N1 or higher device will be necessary. i've found no direct way of forcing this, so i assume forcing high resolution will practically result in such devices.

this game is a port (with minor modifications) of a flash game with author's permission.

here are some shots, all taken from stock N1 running Android 2.1.

simple start level. background image and possibly clock will change. the debug string w:5 means there are 5 objects in the world


another level with simple turns. by collecting diamonds extra points can be earned


a jump high level. this kind of levels are most fun IMHO


a big level and demonstration of breakable tiles.


my test level. red tiles are lava, the downward moving circles represent magnet tile is on, on upper right teleport tile is visible:


same test level with a different angle. lava particles can be seen. i've cut down the number of lava particles for performance


cheers ;D
r a f t

edit: corrected the title