• Advertisement
Sign in to follow this  

2d parallax scrolling a la diablo II

This topic is 3221 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 working on a 2d isometric engine and am currently attempting to implement the type of parallax scrolling found in diablo II. I began experimenting with scaling just the bottom layer of ground tiles and quickly realized that it seems almost impossible to scale them individually without messing up all of their offsets. This leads me to believed that the bottom layer is rendered normally and then the image of the finished tile layer is manipulated(stretching the bottom and condensing the top) and so on and so fourth for every proceeding layer. I'm hoping someone on here as had experience with such and old and obscure technique and could provide me with some info on how this is to be achieved.

Share this post


Link to post
Share on other sites
Advertisement
I'm not entirely certain what you are trying to achieve.

However, a suggestion, perhaps usefull, perhaps not:
Render tiles to a texture.
Have a screen sized layer and map texture on this.

You can stretch the texture any way you want to archive different techniques.

Share this post


Link to post
Share on other sites
Don't use opengl myself, but a quick search found:
http://ogltotd.blogspot.com/2006/12/render-to-texture.html

Share this post


Link to post
Share on other sites
Thanks for the tip about rendering to a texture, I'm still trying to work that out. Meantime, I'm still wondering if anyone has any experience or knowledge with regards to the specific type of parallax scrolling used in Diablo II.

Share this post


Link to post
Share on other sites
Diablo 2's parallax mode was actually done with 3D hardware- they added a bit of actual 3D perspective to the renderer to get it to do what you see.

Essentially, the tiles were rendered in the ground plane, while the sprites and columns and walls were rendered upright (in full 3D space). When rendered orthographically (i.e. in non-perspective mode), it all looks like a standard, 2D isometric view.

When they'd apply a bit of perspective to it (and it was a subtle bit of perspective - too much and it would look TOO 3D), the foreground would pan a bit more than the background.

Share this post


Link to post
Share on other sites
Drilian, could I trouble you to be a but more specific with regards to this? I have very very limited experience with 3d stuff in opengl. Do you mean to say that the ground plane is rendered in 2d ortho and that the upright tiles, such as walls, are rendered in 3d as textured quads or as actual 3d geometry?

Share this post


Link to post
Share on other sites
(I assume Y-axis is up)

If I understand this correctly then you set up a projection matrix with a fov close to 0. (the higher the fov, the more perspective you gain)

Then you render the tiles on the ground plane, the ground plane and therefore all tiles have a normal point up [0,1,0].

The scenery is rendered over this, either as billboards(sprites) or full 3D.

Share this post


Link to post
Share on other sites
But how is this possible if everyone of my ground tiles, wall tiles, and characters are all 2d textured quads(just sprites)?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement