Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411275 Posts in 69323 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 05:30:37 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)2D graphics: vector styles
Pages: 1 [2]
Print
Author Topic: 2D graphics: vector styles  (Read 7188 times)
increpare
Guest
« Reply #20 on: May 07, 2008, 08:09:04 AM »

I just meant that, compared to a simpler sprite-based system (where you're just dealing with the position/orientation/scale of quads) there is more "engineering" involved.
Smiley
Logged
ichi
Level 0
**


View Profile
« Reply #21 on: May 07, 2008, 07:18:04 PM »

I'm making all the graphics for my current game in Illustator, but alas, I can't show it off just yet.

What file format do you use for import into the game?

I'm an experienced Illustrator user (as an art tool) but it would never have occurred to me that I could import Illustrator artwork into a game directly.

Illustrator is way more powerful than Flash (though it too is quite expensive), but there's no way I'm going to write a PostScript parser for my games!

I use .PNG with transparent background.
Scaling and rotating looks just as smooth as actual vectors Smiley
Logged
jjs
Level 0
***


Lean like a Chozo!


View Profile
« Reply #22 on: May 07, 2008, 10:55:44 PM »

If you just want to draw and load vector graphics into OpenGL textures, Cairo will do.

Two gotchas:

1) Cairo's pixel buffers use premultiplied alpha, so for each RGB value on each pixel, you will have to "unpremultiply" the alpha values.   [e.g. red = (unsigned char)(red * (255.0 / double(alpha)) ].

2) Cairo's pixel buffers internally use BGRA, so you will have to use the appropriate GL_RGBA and GL_BGRA arguments to your glTexImage2D() call.

You can also write routines to draw fun vector shapes out of OpenGL lines and polygons, though if you want to load SVG images, you'd be stuck writing your own SVG engine.  Undecided
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic