2d parallax scrolling

Member
Posts: 194
Joined: 2009.02
Post: #1
I'm working on a completely 2d opengl isometric game very similar to diablo II. The one thing about the diablo II engine I can't figure out is how they achieved the parallax scrolling effect which adds a kind of pseudo 3d perspective(I believe that Diablo II, like my game, uses textures quads as sprites and no 3d geometry). Might anyone have any insight into just how they pulled this off?
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #2
Code:
zfactor=(z-near)/far
screenpos={x*zfactor,y*zfactor}
This is what Opengl does in hardware anyway.
This results in further points moving slower.
Scale an image by the zfactor to get it scaled to perspective.
Quote this message in a reply
Member
Posts: 194
Joined: 2009.02
Post: #3
The only problem with that is that you can't scale 2d isometric tile sprites, they become misaligned.
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #4
I think they might have done some sort of render to a texture effect in diablo II.

Although here some other guy has a different idea:
http://www.gamedev.net/community/forums/..._id=532278

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #5
I never really played Diablo much, but I do remember seeing the effect you are talking about. I seem to recall thinking that they probably just rendered the scene actually in 3D using a pseudo-perspective transformation. You certainly can't get the effect just by adjusting offsets of your tiles.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 194
Joined: 2009.02
Post: #6
Skorche Wrote:I never really played Diablo much, but I do remember seeing the effect you are talking about. I seem to recall thinking that they probably just rendered the scene actually in 3D using a pseudo-perspective transformation. You certainly can't get the effect just by adjusting offsets of your tiles.

What exactly is a "pseudo-perspective transformation"? Also when you say 3d do you mean sprites or billboards rendered in 3d space?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #7
I mean that it didn't quite look like a normal perspective transform to me, but I don't really remember why.

Sprites and upright scenery would be drawn as billboards, but you would have to give everything a z-coordinate. The ground would have to be drawn as a quad for each tile placed flat horizontally to the camera so that it would get the perspective distortion effect.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Parallax Layers KiroNeem 1 2,144 Jun 6, 2005 04:11 PM
Last Post: reubert