Sign in to follow this  

2D raster vs 2D vector vs 3D

This topic is 4559 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm in the planning stages of making a game, and an important problem came to light when I started thinking about what the game would actually look like. Originally, I wanted to use traditional 2D pixel art for the sprites and all the graphics, but then I thought of things like dynamic lighting and shadows. For example, what if I wanted Mario's fireballs to actually make light in a dark room? It would be hell to make all he individual sprites with which the fireballs could project light onto. So of course, dynamic lighting as seen in 3D games would need to be involved. Problem is, I don't recall ever seeing that in a 2D game before (either on the SNES or GBA) in which the pixel art style was used. So then I thought, perhaps I could use vector art and get the results I want? It wouldn't be the style I was originally hoping for, but I could live with it. But the question still lurks: Can I make a game using vector art and also have this dynamic lighting I am speaking of? BTW, the reasons why I wanted to use pixel art were 1) style. I like the style; and 2) people with even low computer specs would be able to play it, thereby giving my game a wider potential audience. Modern 3D games require modern or near-modern graphics cards to work well and still look decent. When you're the guy that can't play any modern games due to system specs, you become more sensitized to this dilemma :(

Share this post


Link to post
Share on other sites
It should be possible to do this entirely with sprite-based graphics, but you'll probably want to at least take advantage of hardware acceleration for things like alpha blending. One trick you could do is have a "lighting" sprite attached to light sources (fireballs, lanterns, street lamps, etc.). The sprite is basically just an alpha map. Anchor the lighting sprite to the actual sprite, and alpha-blend the lighting layer on top of the scene after the sprites are all drawn. For best results you may consider rendering all of the lighting data in a scene into a special buffer and then clamping the alpha values in the buffer to prevent oversaturation.

Another thing to try would be to have negative-illumination; for instance, if you have a bright red light in an otherwise dark room, everything is going to look red. Colors with no red in them (e.g. solid blue) will tend to look black or brown. You can accomplish this by having a filter color attached to each light source, such as RGB(1.0, 0.0, 0.0). Multiply this filter by the color of each pixel to simulate the effect of colored lighting. With some cleverness you should be able to implement this as alpha blending as well - maybe even by compressing the filter color and brightness data into a single alpha sprite.


Anyways, I think it should be totally possible to do interesting lighting effects (and maybe even shadows, but that would be more tricky) in a purely pixel-art, sprite-based game. It will take some ingenuity, and you will certainly get a lot of help from even very old hardware accelerators, but it can be done.

Share this post


Link to post
Share on other sites
Another thing that comes to mind is bump maps. Make bump map versions of all your graphics, and then render a 'lighting image', doing one pass per light and adding up the values. Then as you render the normal graphics, multiply each color by the corresponding color in the light image.

Share this post


Link to post
Share on other sites
This is excellent! I'm not a programmer (yet), but I'm definitely going to be taking Software Engineering/CompSci classes in college. It's good to know that I can have my cake and eat it too :)

It's curious then that I haven't seen a game implement this (well, maybe C&C TS and RA2, but they used voxels). Why is it that we don't see this used more often? It seems like something that would definitely add to pixel-art games in many ways--that's why I want to do it. Or am I confused and have just not been playing the right games?

Share this post


Link to post
Share on other sites
It seems that the modern trend for large-scale games is to obsess over fancy 3D graphics and such things. The marketroids of the industry perceive pixel art as outdated, unfashionable, and useless - at least as far as mainstream PC games go. There seems to be a pretty heavy return to pixel art in mobile gaming, but there are signs that the same 3D craze is trying to take over that realm as well.

The problem is that the business people and the gamers have different perceptions of where gaming should be going. Personally, I'd love to see more sprite-graphics games. Some of the best games I've ever played didn't care about 3D graphics or network multiplayer modes. Within the indie game development world, this approach seems a lot more popular - but I wouldn't count on seeing a AAA title on the shelf any time soon that was straight pixel art.

Anyways, more power to you - I'd love to see more of that kind of material out there.

Share this post


Link to post
Share on other sites
That's interesting to hear. I'm thankful for the encouragement! Sprite-based games are certainly my preferred style. All they really [seemed] to lack was some of the more advanced effects that are most common in 3D games, like this dynamic lighting issue. There are some games out there that certainly lend themselves to 3D technology (FPS), but there are others that can certainly do without (RPGs, especially turn-based). I'm definitely not against 3D games, but my perferred style is sprite-based for this game of mine.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This is an example (by Anthony Flack) of what I think you're trying to do, particularly the shot at the bottom-left:

http://www.blitzbasic.com/gallery/view_pic.php?id=161&gallery=hr&page=1

Although it looks 3D, it's actually a bunch of sprites grabbed from real-world clay models and then rendered using hardware-accelerated sprites.

Share this post


Link to post
Share on other sites
Ya, something like that. The bottom-right one shows shadows as well. That's an interesting style.

The sort of lighting style I'm going for is the same as in LoZ:WW

http://www.zeldanederland.nl/images/10_tww/screens/10.jpg
http://pub.tv2.no/multimedia/TV2/archive/00126/Zelda_180_126768a.jpg

Those two illustrate what I mean. I'm not so interested in making realistic as I am in making cartoonish sort of light and shadows. It fits with the pixel-art style more. For instance, gradients and fading of any kind don't fit in well with pixel-art. Pixel-art light and shadows tend to be much more defined, in that it is obvious where the light and shadows end.

Ironically enough, LoZ:MC demonstrates what I don't want.

http://www.zeldadungeon.net/gallery/gallery.php?dir=Screenshots/Zelda%20Minish%20Cap

Top-left screenshot has fire, but no light coming from the fire. Top-second-from-the-right screenshot has fire, but it doesn't project light onto Link, just the walls (which were drawn individually to have the illusion of a light source).

What I wouldn't want is for the fire to project light up at the player, such as in http://www.blitzbasic.com/gallery/view_pic.php?id=161&gallery=hr&page=1 , or at least not to that extent.

I hope I've been able to help you understand what I mean.

Share this post


Link to post
Share on other sites

This topic is 4559 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this