jPCT-AE - a 3d engine for Android > Support

blitting and GL color

(1/5) > >>

raft:
I'm drawing some lines to screen via GL calls for debugging purposes. I set the color with the call


--- Code: ---GL10.glColor4f(..);
--- End code ---

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


--- Code: ---FrameBuffer.blit(.. RGBColor addColor)
--- End code ---

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?

EgonOlsen:
I'm not sure...calling blit(...) actually doesn't execute the blit but it stores it and sets the renderer into blitting mode. The blits are executed later when some other command comes along so that the renderer has to  leave blitting mode again. That way, blits will be aggregated, which makes them much faster. Maybe that causes this behaviour...unfortunately, you can't trigger this yourself...unless you revert to a hack. Try to create an empty world instance in addition and put a render/draw-sequence for that empty world between your blit(...) call and the glColor-call. That should force the blits to be executed before your direct gl-call. I'm not sure if this will fix the problem though...

raft:
no it didnt help unfortunately. I had added the following code between last blit and my GL code. after that buffer.display() is called


--- Code: ---tmpWorld.renderScene(buffer);
tmpWorld.draw(buffer);

--- End code ---

btw, strange things happen depending on position of my GL code :o

this works ok

--- Code: ---render world
some blit
GL code
some other blit
buffer.display()

--- End code ---

this draws lines in last blit's color. furthermore some of blits are missing

--- Code: ---render world
some blit
some other blit
GL code
buffer.display()

--- End code ---


this draws lines in last blit's color

--- Code: ---render world
some blit
some other blit
buffer.display()
GL code

--- End code ---

EgonOlsen:
You can try to set Config.glDebugLevel to 1. That should print out all the engine does. Maybe that's helps to finden out in which state you are when calling your gl functions.

raft:
I was trying that but I had hit an obstacle. I was using jpct-ae 1.23 beta (i had named it ..beta-unload.jar, so possibly it was the version Config.unloadImmediately was intoroduced). It was working ok. I had upgraded to 1.24 and got an exception


--- Code: ---java.lang.RuntimeException: [ 1333923087639 ] - ERROR: java.lang.NullPointerException
  at com.threed.jpct.Object3D.transformVertices(Object3D.java:6316)
  at com.threed.jpct.World.renderScene(World.java:1105)
...
--- End code ---

and this is the log before that exception:

--- Code: ---I/jPCT-AE (18536): [ 1333923087636 ] - WARNING: There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of jPCT objects on a thread different from the rendering thread!

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version