Page 1 of 1

Split-Screen

Posted: Sat Feb 20, 2010 7:09 pm
by Kjell
8)

Proper split-screen using opengl32 ( no shader tricks ). Two things to pay attention to ..

- Only clear the screen before the first pass.
- Adjust the Viewport Ratio each pass to match your view.

Example is build for 640x360 resolution.

K

Posted: Sat Feb 20, 2010 8:00 pm
by y offs et
Judging from your code, please confirm -

The default App.RenderPasses is obviously one (1), in the app component, and you have (3) specified. Yet you have
if(App.CurrentRenderPass)
if(App.CurrentRenderPass == 1)
if(App.CurrentRenderPass == 2)

This signifies the need to offset the index by -1? But then, that would imply the first if(...) has a value of 0. I admit I don't have a full understanding of the render passes.

Posted: Sat Feb 20, 2010 8:03 pm
by Kjell
:)

Correct, the first render pass is 0. Just like when you have a Array with a length of 1, you still need to access it by Array[0] = "Value";

All that renderpasses does / means is how many times the OnBeginRenderPass + OnRender events occur per frame.

+ Screenshot of the example

K

Posted: Sat Feb 20, 2010 8:21 pm
by y offs et
Oh, I think I get it now.
What the actual portion of the full screen to be cleared on each pass is determined by the elements of the array.
If that's true, then your first comment seems confusing.

Posted: Sat Feb 20, 2010 8:34 pm
by Kjell
:)

The ClearScreenMode flag clears the complete back-buffer regardless of the viewport settings. But I can understand your confusion .. these kind of things you just have to know I guess ( it's just the way OpenGL works ).

K

Posted: Sat Feb 20, 2010 9:01 pm
by y offs et
My fault! I forgot to read my own definition of App.ClearScreenMode .
I thought I was looking at a Bool.

Posted: Tue Oct 01, 2013 4:59 pm
by Ats
Hi everyone, I'm back for some new little games.
Today I was playing with the split-screen method described in this topic, but I have a little problem with your exemple, Kjell.

In the application properties I changed the number of RenderPasses to 4.

In the OnBeginRenderPass, I commented what comes after "Just some camera debugging" so the cameras won't move.

And I changed the Array View like that:

0,180,320,180
320,180,640,180
0,0,320,180
320,0,640,180

Now I have four split screens. The problem is that the ones one the right (P2 and P4) have a shift in their camera position. How can I fix that ?

I provided the modified zgeproj.

Thanks for your help.

Posted: Tue Oct 01, 2013 5:24 pm
by Kjell
Hi Ats,
Ats wrote:The problem is that the ones one the right (P2 and P4) have a shift in their camera position. How can I fix that ?
The values for each viewport are X, Y, Width, Height .. so the two times you used 640 should be 320 instead ( all viewports are 320x180 ) ;)

K

Posted: Wed Oct 02, 2013 2:41 pm
by Ats
Ooooh. I though it was the coordinates of the little viewports inside the big one :oops:
Thanks for your quick response !


-

Edit:

So this morning I started playing with ZGameEditor on Android. Thanks to ZGEAndroid-debug.apk it took mere seconds to watch my stuff working on my phone, then on my Ouya. Splendid!

But the splitscreen is not working at all... I do beleive it's because of opengl32?
Is there a way to bypass that, or is it a dead end?

Thanks ;)

Posted: Wed Oct 02, 2013 3:44 pm
by Kjell
Hi Ats,
Ats wrote:But the splitscreen is not working at all... I do believe it's because of opengl32?
Does your ZExternalLibrary component have the following in the BeforeInitExp property?

Code: Select all

if(ANDROID)
{
  this.ModuleName = "libGLESv1_CM.so";
}
K

Posted: Wed Oct 02, 2013 4:11 pm
by Ats
Sorry I'm quite a noob when it comes to that... So I've read through http://www.zgameeditor.org/index.php/Co ... nalLibrary

And added it like that:
http://tinypic.com/r/24gn77m/5

But the app keeps opening and closing.

Posted: Wed Oct 02, 2013 5:04 pm
by Kjell
Hmm,

Not exactly sure what's causing the problem, but attached is a demo / version that does work properly on Android ( using a Nexus 7 at least ).

K

Posted: Wed Oct 02, 2013 10:31 pm
by Ats
Ok... So after A LOT of tries, I finaly discovered that the dat file with a ZExternalLibrary can only be exported using Windows.

I was on linux, running ZGE with Wine. That method can compile exe file without problems, and exporting dat file too. But with the addition of ZExternalLibrary opengl32, the exported dat don't work at all.

Anyway, thanks for your help Kjell, I discovered new ways to add components by watching your example.

Edit: Now, no dat file exported from ZGE under linux/wine are working. Weird but never mind...

Edit 2: I was working with ZGE 3.1b but had ZGEAndroid-debug.apk 3.0 installed on my Android... Now everything is good.
Thanks Kjell !