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

Fogging problems

(1/6) > >>

Zyphuris55:
I think this is a bug because it happens without any apparent logic.
In the game play part of my game, I have the game objects rendered in one world and the hud objects rendered in another world (so they would stay static while the rest of the game move). The game objects have transparency, while the hud objects don't.

On the first render frame, it renders the scene for both worlds and then draws the worlds (game then hud), but it's not displaying the fog on the game play's world objects. When I disable the rendering/ drawing of the hud world, the first render has the fog enabled.
With the hud world enabled and the scene incorrectly displaying, after touching the screen, the fog re-enables.

I tried using the framebuffer's clearZBufferOnly() before the hud's render/ draw line, but that didn't do anything. Then I played with some code which would render/ draw the worlds twice on only the first render frame, but that also did nothing. I also tried to disable the fog in the HUD's world (not sure how that would be helped)....but it also didn't do anything. Lastly, I disabled all the lighting in the HUD's world, both ambient light and any other lights added to the world, but the only thing that did was make the hud objects black.

= Gameplay code

--- Code: ---boolean firstR = true;
public void Render(FrameBuffer fb)
{
/*
if(firstR)
{// attempted fix, which does nothing
world.renderScene(fb);
world.draw(fb);
fb.clearZBufferOnly();

hud.Render(fb);
}
*/

if((Touching || resetting) || firstR)
world.renderScene(fb);
firstR = false;

world.draw(fb);
//fb.clearZBufferOnly();
hud.Render(fb);
}

--- End code ---


= HUD render code

--- Code: ---private boolean render = true;
void Render(FrameBuffer fb)
{
if(render)
world.renderScene(fb);
render = false;

world.draw(fb);
}

--- End code ---



Note: the renderScenes are linked to bool requirements so the worlds won't be needlessly rendering every frame (it made my phone hot and the fps slow).


The HUD currently only has 1 thing, which is the bottom left

= Pre-touch


= Post-touch (ignore the half-lighted/half-darked block, the picture was taken between render frames)

EgonOlsen:
Which OpenGL version are you using? 1.x or 2.0?

EgonOlsen:
Have you tried to use another color than black as fog color?

And could you please set the log level in Logger to debug, set Config.glDebugLevel=1 and post the ouput for the first two frames (might be a bit large...)?

Zyphuris55:
I'm using OpenGL 2.0

...it was REALLY hard to get the logs, lol. I had to remove the 80,000 limit and be quick on the pause button. Even still, they are pretty lengthy.

Loga: Starts as soon as I clicked the button to go to the game play and paused after the first image was visible.
Logb: (cleared the first log first). Touched the screen which re-enabled the fogging, then paused it after the image what changed.

I haven't tried anything besides using "world.setFogParameters(20, 60, 0, 0, 0);". I didn't feel a fog of other than black would look good.

[attachment deleted by admin]

Zyphuris55:
I went through both logs now, looking for any differences...and I couldn't find any :-/. Does being an engine developer give you a more detailed eye than a normal coder would? lol

Anyway, if the log's aren't too helpful, I'd gladly send you the project for you to check out yourself.

Navigation

[0] Message Index

[#] Next page

Go to full version