| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Sep 17, 2004, at 9:39 PM, Alex Eddy wrote:You don't necessarily need a Z buffer with 2D ortho content, if you just keep track of your draw order. You'll need it if you mix 2D and 3D.So just keep track of my own layering and then draw in the proper order - could this really be faster than using a z buffer?
I assume I still get "free" rotation and scaling this way?
That's a funny texture depth-- usually you want 15/1 or 24/8. You really must use a standard BGRA format for paging speed.It was a type-o. I was planning on using 15-bit textures with a 8-bit alpha.
The ideal for 15-bit textures instead of 24-bit was to keep down on the bandwidth of loading textures to the card (if / when paging does occur).
However since you say 24-bit is better on paging speed I suppose I should switch to that depth.
One idea for the backgrounds, to expand on John's suggestion, is to keep a render-to-texture texture for each scrolling layer. These live in VRAM and are the size of the viewport (or smaller, for layers in the distance-- since you can scale them up with filtering for that out-of-focus look.) Keep your huge artwork/blockset textures in AGP, and draw strips from them into the layer textures as needed whenever you are actually scrolling. That way the paging is limited, and your onscreen compositing happens quickly (if you need to reuse a layer texture multiple times per draw, for blur effects or whatever.) This approach also bypasses some filtering problems that can happen if you render multiple quads directly into the viewport and you need to rotate or scale.Sounds a lot like a wrapping blitter (such as the one used in SpriteWorld for those who are familiar with it).
So the basic idea is to only draw the area of the level which was just scrolled into view into it's appropriate part of a screen size texture, and then render the final texture and sprites to the screen. Makes for a very fast frame rate.
However when parallax scrolling comes in it is a bit less helpful. Since each frame the backgrounds would have to be offset differently - causing more or less the entire screen to be redrawn again.
Speaking of parallax scrolling what would be the best way to to create a tiled background using OpenGL? I don't think creating a quad the size of the level and just setting it's texture coords so that the texture repeats isn't the best way.
_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/mac-opengl/email@hidden
| References: | |
| >Re: 2D Games with OpenGL (From: Alex Eddy <email@hidden>) | |
| >Re: 2D Games with OpenGL (From: Lee Morgan <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.