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.


Topics - raft

Pages: 1 2 [3] 4 5 ... 8
31
Support / frustum culling
« on: 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
« on: 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?
« on: 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
« on: 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
« on: 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?
« on: December 17, 2010, 03:44:15 am »
this sometimes happes when i press home button. not sure what is null here?

Code: [Select]
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
« on: 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:
Code: [Select]
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:
Code: [Select]
(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
« on: 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 ?
« on: 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
« on: 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

41
Support / memory issues
« on: October 15, 2010, 02:52:55 pm »
as my game evolves, i begun to run into memory issues. game itself runs ok, fits the budget, but these things typically happens after pressing home and returning back. see the exception below.

i guess this happens when jPCT tries to restore textures after a GL surface lost. i dispose the FrameBuffer, null the reference and call MemoryHelper.compact() before creating a new one.

what else can i do?

Code: [Select]
E/dalvikvm-heap( 6803): 131072-byte external allocation too large for this process.
W/OSMemory( 6803): External allocation of 131072 bytes was rejected
W/dalvikvm( 6803): threadid=15: thread exiting with uncaught exception (group=0x4001b178)
E/AndroidRuntime( 6803): Uncaught handler: thread GLThread 8 exiting due to uncaught exception
E/AndroidRuntime( 6803): java.lang.OutOfMemoryError
E/AndroidRuntime( 6803): at org.apache.harmony.luni.platform.OSMemory.malloc(Native Method)
E/AndroidRuntime( 6803): at org.apache.harmony.luni.platform.PlatformAddressFactory.alloc(PlatformAddressFactory.java:145)
E/AndroidRuntime( 6803): at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:67)
E/AndroidRuntime( 6803): at java.nio.ReadWriteDirectByteBuffer.<init>(ReadWriteDirectByteBuffer.java:51)
E/AndroidRuntime( 6803): at java.nio.BufferFactory.newDirectByteBuffer(BufferFactory.java:95)
E/AndroidRuntime( 6803): at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:71)
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.convertTexture(GLRenderer.java:754)
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.blit(GLRenderer.java:1265)
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.execute(GLRenderer.java:1661)
E/AndroidRuntime( 6803): at com.threed.jpct.FrameBuffer.blit(FrameBuffer.java:591)
E/AndroidRuntime( 6803): at raft.glgui.android.TexturePack.blit(TexturePack.java:256)

42
Support / setting polygon texture
« on: October 14, 2010, 02:08:50 am »
I have a merged object which is serialized with desktop jPCT. i change textures of some polygons during the course of the game. this works fine in desktop jPCT. but in AE I got some strange behaviour:

* with one subobject to change texture this works fine
* with a couple subobjects, i only get a result by setting texture of first one and this operation sets textures of other subobjects too. setting texture on other subobjects has no effect

i suspect this thing requires, build(false) method. if this is the case, there is no such method in AE, how can i serialize such an object from desktop jPCT?

i've also tried calling compile(true) before serialization but didnt help.

43
Support / lighting mode and ambient light
« on: September 24, 2010, 08:39:55 pm »
i need to set ambient light to a high value to make details of textures visible. but in that case i cant properly set color of glow planes. -i guess- because of over lighting they seem white. and seems as calling

Code: [Select]
Object3D.setLighting(Object3D.LIGHTING_NO_LIGHTS);
has no effect with ambient light. so what can i do in this case except changing ambient light ?

44
Support / merging objects with transparency
« on: September 22, 2010, 07:37:57 pm »
seems as it has no effect merging objects with transparency. in the final merged object all transparency has gone. is this intentional ?

i've also tried setting one of object's transparency via PolygonManager, but in that case merging objects throws a NPE. ie. following code:

Code: [Select]
Object3D one = Primitives.getBox(1, 1);
//one.setTransparency(0);
for (int p = 0; p < one.getPolygonManager().getMaxPolygonID(); p++) {
one.getPolygonManager().setVertexAlpha(p, 0, 0f);
one.getPolygonManager().setVertexAlpha(p, 1, 0f);
one.getPolygonManager().setVertexAlpha(p, 2, 0f);
}

Object3D two = Primitives.getBox(1, 1);
two.translate(0, 3f, 0);
two.translateMesh();
two.getTranslationMatrix().setIdentity();

Object3D merged = Object3D.mergeObjects(one, two);

throws:
Code: [Select]
Exception in thread "main" java.lang.NullPointerException
at com.threed.jpct.Object3D.appendToObject(Unknown Source)
at com.threed.jpct.Object3D.mergeObjects(Unknown Source)
at tmp.MergeTransparent.main(MergeTransparent.java:34)

btw, i'm a bit unclear what PolygonManager().setVertexAlpha(..) does. in my tries i saw no effect of it.
we set alpha values of vertices not the polygon. how exactly does it work ?

45
Support / compile
« on: August 20, 2010, 07:23:41 am »
i know compile() method is removed because all objects are compiled in AE but it may still make sense to put it back. it's is useful as a preperation before game begins. if i dont miss something, at the moment we are forced to serialize even the simplest objects like particles. particles are typically cloned from a master and at each cloning a compile occurs

Pages: 1 2 [3] 4 5 ... 8