2D Culling

Share your ZGE-development tips and techniques here!

Moderator: Moderators

Post Reply
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

2D Culling

Post by Kjell »

:idea:

Cheap 2D culling base / approach for 3D games with Camera's that mainly rotate over 1 Axis and Levels that primarily extend over 2 Axes. Extend to your own needs ..

Control using Arrow Keys.

K
Attachments
Culling.zgeproj
(4.92 KiB) Downloaded 758 times
User avatar
diki
Posts: 140
Joined: Thu Sep 11, 2008 7:53 pm
Location: GMT+1
Contact:

Post by diki »

thanks! will try to get my head around it :)
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:!:

Made a small mistake in the provided example.

Code: Select all

if(Index >= 0 && Index < 0.25-Angle)Culling[1,0] = 1;
.. in Camera's OnUpdate ZExpression should be ..

Code: Select all

if(Index >= 0 && Index < Angle)Culling[1,0] = 1;
@diki: For your specific game I'd add add a rule that culls everything more then let's say 4 steps away, unless a block is within 2 steps away over the X axis of the camera when facing east / west .. and over the Y axis ( Z in your game ) when facing north / south.

K
Post Reply