YesNoOk
avatar

Experimental "3D" backgrounds (Read 4034 times)

Started by Samson, February 07, 2014, 11:17:37 am
Share this topic:
Experimental "3D" backgrounds
#1  February 07, 2014, 11:17:37 am
  • avatar
This is from an idea I had earlier this year:

Please forgive the programmer art, this was mostly a quick thing so I can test how well it works without investing too much time.


This is the same thing in Blender.

There are basically three types of polygons that can be rendered in Mugen: Most obviously the polygons directly facing the camera, which simply translate into "normal" background items. Polygons horizontally tilted from the camera translate into "parallax" items. This is normally used for floors or ceilings, but the math actually works out for any angle. Finally polygons tilted vertically from the camera can be rendered with a "normal" item, but with scale when you move sideways.

If you want to try the test background:
stagetest.zip (tested with Mugen 1.1)

There are some obvious problems as well: If you jump you'll notice a crack opening in the top of the cube, which is because Mugen doesn't have vertical parallax. One way around that would be of course to stop vertical camera movement, or to stop vertical parallax. Another option would be to slice the sprite into vertical strips, so you can fake the parallax.
Another problem is of course that I don't have proper texture filtering in place, so you see some distortions and no antialiasing.

I'm not sure if it is worth developing it into a full tool, because if you really want 3D backgrounds it is much easier to use something like Unity3D. Maybe I'll just finish off what I have now and put it onto github. (Of course, who knows if someone else didn't have the same idea earlier.)
Re: Experimental "3D" backgrounds
#2  February 07, 2014, 03:11:53 pm
  • *****
  • Fuck you.
    • Philippines
    • Skype - Markpachi
    • mugenguild.com/forum/topics/-opensource-mps-psds-stages-and-resources-please-put-them-good-use-172321.0.html
What an interesting topic! I'll check out the test stage. I might learn something from it.

Rest in peace, Tamez. Thank you for everything.
Re: Experimental "3D" backgrounds
#3  February 08, 2014, 06:54:10 pm
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
Interesting topic you got here.

How much does your tool help or automate the process and help with calculations?
The test stage works pretty well. As you said, the obvious solution to avoid problems is not having any vertical camera move, which isn't too bad in most cases.

In one of his stages (Training Stage Alpha : http://www-personal.umich.edu/~tdkim/ziltama/stages.html), Ziltama also played with parallax on vertical walls, but that really feels like a bitch to code.

Hope to see more from you. :)
Re: Experimental "3D" backgrounds
#4  February 09, 2014, 11:10:04 am
  • avatar
You just export the model as a .obj from Blender, and then copy the camera and player positions into a setup file. The tool then does effectively what OpenGL or DirectX do to render the scene, except it renders each sprite into a separate bitmap and it works out the correct start, scale and delta values from the 3D coordinates. Then it writes a .def file for the stage and for the sprite maker.
I still have to work out a good workflow, though. For example you may want to bake lighting or shading in Blender, or use the Blender renderer for high quality renders of each sprite.