Vector graphics rendering: Best approach?

Post: #1
I'm currently doing some research for writing a simple 2D bomberman game. Although the game is 2D, I want to use 3D acceleration by using billboards and a fixed camera so it 'looks' 2D. The 3D acceleration might be overkill for a simple bomberman game, but it's a good learning point for future (more advanced) 2D or 3D games.

The bomberman field will be always be the same size (in tiles), no mather what the resolution is. So I want all the images, e.g. sprites, to scale so it fills the screen. On a higher resolution you get bigger images. This is where vector graphics come in handy.

I was thinking about prerendering the vector graphics to a raster image for the current resolution. When the user changes the resolution, the engine should prerender again with a different size. This way I can load the sprites into the texture memory of the graphics card and this would speed up the billboard rendering (I think?).

I might be overseeing something important here, so therefor my question what the best approach to Vector graphics rendering is?

Thanks in advance.
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
That's a reasonable approach.

These days you can use the fragment shader to render some vector graphics in real time, which might be fun, but certainly isn't necessary.
Quote this message in a reply
Post: #3
Thank you for the fragment shader suggestion. I quickly searched and found a nice article with a small code example.

I'll look into it when I get home.
Quote this message in a reply
Posts: 254
Joined: 2005.10
Post: #4
It sounds to me like you haven't done OpenGL before, so I would avoid programming the shaders. It's a bit more of an advanced topic.
Quote this message in a reply
Post: #5
I messed arround a bit with OpenGL before, but never came close to using shaders. I'm even new to Cocoa/Objective C (coming from Delphi/Win32). But you're right, shaders seem a bit too advanced for now.

I decided to go with my initial idea and prerender the vector graphics. It seems like I can use PDF (or EPS) as vector format and let Cocoa do all the prerendering, which really saves time (opposed to writing my own vector renderer). Though I might be misreading the text.

I have the book 'Cocoa Programming for Mac OS X' coming in this evening, so I'll start learning Cocoa/Objective C first.

Thank you all for the suggestions/comments.
Quote this message in a reply
Posts: 1,199
Joined: 2004.10
Post: #6
Letting Cocoa render PDFs to NSImage, and then upload them to GL is probably a great way to do this. Let Quartz to the hard work for you, plus you can use established graphics programs like illustrator to make your graphics.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Reflect a vector in relation to another vector ipeku 4 8,175 Dec 12, 2011 07:17 AM
Last Post: ipeku
  best approach for dj interface coolmrcroc 2 4,490 Oct 13, 2010 08:41 AM
Last Post: OneSadCookie
  New to obj-c and have no idea where to start: vector graphics billybob 1 3,826 May 27, 2009 11:17 AM
Last Post: billybob
  N-Body with GLSL and VBO's (how to approach)? mcMike 4 8,560 May 24, 2008 11:06 AM
Last Post: mcMike
  2d vector graphics game: GL or Flash? Krazygluon 1 4,247 Oct 30, 2006 09:57 PM
Last Post: maximile