Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by UltimateBrent

Not sure when this happened, but if you download the JumpNRun demo for iOSImpact, change nothing and compile, the background layer doesn't render. If you turn off prerendering in main.js, it shows up, but performance takes a noticeable hit (as you'd expect).

I changed the chunk size to all kinds of values, so I don't think this is a screen buffer issue.

I did notice this error in the XCode console though:
2012-02-11 16:59:09.283 iOSImpact[50147:707] Loading Script: lib/impact/map.js
warning: Unable to read symbols for /Users/ultimatebrent/Library/Developer/Xcode/iOS DeviceSupport/5.0.1 (9A405)/Symbols/System/Library/Extensions/IMGSGX535GLDriver.bundle/IMGSGX535GLDriver (file not found).
warning: No copy of IMGSGX535GLDriver.bundle/IMGSGX535GLDriver found locally, reading from memory on remote device.  This may slow down the debug session.

Any ideas?

1 decade ago by UltimateBrent

For reference, this happens on iPhone 4, iPad 1, and both simulators. I'm using Xcode 4.2 with the iOS 5.0 SDK.

1 decade ago by Arantor

I assume the chunk size was tried below 256 at some point?

1 decade ago by UltimateBrent

Yes, tried all powers of 2 up from 8-1024. I also changed the background tile size to a couple different variations, but no change.

1 decade ago by Jerczu

Similarly if you want parallax effect the chunks rendered don't appear fast enough so you end up wit some parts of background being solid colour. And show up when you reach a certain area. I can't see it happening in biolab disaster iOS

1 decade ago by dominic

Uh, wow. UltimateBrent, you mean the second background layer, right? I actually didn't notice it was missing! Here's what's happening:

The framebuffer in iOSImpact is only set up the first time you try to draw anything onto the screen canvas. Since the draw calls for the offscreen (pre-rendered) canvas for the rearmost background layer happens before the first draw call to the screen canvas, the framebuffer isn't set up completely and all draw calls to it fail. Took me quite a while to find this bug.

For now, here's a simple workaround: make sure you draw something onto the screen canvas before the background layers are pre-rendered. E.g.:

loadLevel: function( data ) {
	ig.system.context.fillRect( 0,0,0,0 ); // <- Add this!
	
	this.parent( data );	
	
	// Enable the pre-rendered mode for all background maps
	for( var i = 0; i < this.backgroundMaps.length; i++ ) {
		this.backgroundMaps[i].chunkSize = 256;
		this.backgroundMaps[i].preRender = true;
	}
},

The problem Jerczu addresses is a different one and is not exclusive to iOSImpact - it also happens in the browser: a pre-rendered BackgroundMap will draw at most 4 chunks at a time. For small, repeating BackgroundMaps this wont be enough to fill the whole srceen. I wont fix this, since having to draw a whole lot of chunks defeats the purpose of pre-rendering.

Make sure your repeating BackgroundMaps are at least as big as your screen and you wont have any problems. The Jump'n'Run exmaple's BackgroundMap actually is too small; I'll change that.

I know this is all quite esoteric. The next Impact version will probably throw an error when pre-rendering is enabled for a repeated BackgroundMap that is smaller than the screen, so you know what's going on.

1 decade ago by UltimateBrent

And this is why I use Impact. That totally worked Dominic, thanks! That was some herculean bug fixing. I never would've found that.

1 decade ago by Jerczu

Make sure your repeating BackgroundMaps are at least as big as your screen and you wont have any problems. The Jump'n'Run exmaple's BackgroundMap actually is too small; I'll change that.


Thanks I'll have a look into it...
Page 1 of 1
« first « previous next › last »