Author Topic: Question about background culling  (Read 13807 times)

namelivia

  • *
  • Posts: 6
    • View Profile
Question about background culling
« on: 2015-01-10 14:42:29 »
Hello everyone, I was attempting to load a Final Fantasy VII scene into webGL.
The thing is that I didn't want to load directly data extracted from the game because I wanted to find a method not to remake the game, I wanted also to make a way to extend it or create similar content using Blender, and the easiest way possible.

I've been able to recreate an scene out of a background picture,  as seen in my blog post:

http://namelivia.com/final-fantasy-vii-scene-reconstruction-using-blender/

And I was pretty optimistic. From a picture I got an automatic method to reconstruct the camera, and then creating the walkmesh it's pretty easy with a very basic Blender knowledge.
Then, I have been able to load and display the scene into a webpage, and also to display some models on top of it. Keyboard input and collision management is also successfully implemented.
http://namelivia.com/importing-the-reconstructed-final-fantasy-vii-scene-into-three-js/

Now I'm facing the problem of background culling, this is the problem of knowing when the character is in front or behind, for example a table that is placed in the background image. I've been reading a lot about, and in most of the articles it says that I need a depth map. But this means that I have to remodel the whole background and that was the point I was trying to avoid.

I wanted to ask here since you are more experienced in Final Fantasy VII tech issues like me, how to attack this problem and if there is a way to determine the depth of certain background parts without modelling the whole thing.

For now I will be trying this approach:
http://www.blenderguru.com/tutorials/camera-mapping-tutorial-v2/

Thank you!

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: Question about background culling
« Reply #1 on: 2015-01-10 17:53:07 »
Extract the backgrounds with Palmer . It will extract them as already cutted to the different layers.

Mayo Master

  • *
  • Posts: 650
    • View Profile
Re: Question about background culling
« Reply #2 on: 2015-01-11 05:50:22 »
Hello everyone, I was attempting to load a Final Fantasy VII scene into webGL.
The thing is that I didn't want to load directly data extracted from the game because I wanted to find a method not to remake the game, I wanted also to make a way to extend it or create similar content using Blender, and the easiest way possible.

I've been able to recreate an scene out of a background picture,  as seen in my blog post:

http://namelivia.com/final-fantasy-vii-scene-reconstruction-using-blender/

And I was pretty optimistic. From a picture I got an automatic method to reconstruct the camera, and then creating the walkmesh it's pretty easy with a very basic Blender knowledge.
Then, I have been able to load and display the scene into a webpage, and also to display some models on top of it. Keyboard input and collision management is also successfully implemented.
http://namelivia.com/importing-the-reconstructed-final-fantasy-vii-scene-into-three-js/

Now I'm facing the problem of background culling, this is the problem of knowing when the character is in front or behind, for example a table that is placed in the background image. I've been reading a lot about, and in most of the articles it says that I need a depth map. But this means that I have to remodel the whole background and that was the point I was trying to avoid.

I wanted to ask here since you are more experienced in Final Fantasy VII tech issues like me, how to attack this problem and if there is a way to determine the depth of certain background parts without modelling the whole thing.

For now I will be trying this approach:
http://www.blenderguru.com/tutorials/camera-mapping-tutorial-v2/

Thank you!


As a whole: please check the Team Avalanche subforum. That's what we've been doing for a few years, now! We also have the tools to retrieve the walkmesh and camera data. As Kaldarasha's mentioned, the making of layers is made via Palmer, we have a detailed tutorial about the process. I'd be happy to give you further details - you're welcome to post on Team Avalanche or just PM me.

namelivia

  • *
  • Posts: 6
    • View Profile
Re: Question about background culling
« Reply #3 on: 2015-01-11 12:50:47 »
Thanks everyone for the fast and precise answers.

Okay, so if I got it right, depth is treated using layers, so there are just a few layers with constant depth values like  for example.

layer 1 -> depth = 3
layer 2 -> depth = 6
layer 3 -> depth = 20

Right? And these layers and it's depth value can be extracted using Palmer.

Then I should import this into Blender and generate a depth map that I'll be importing into my engine (threejs+webgl).
But does Palmer get the depth value? How do I know that value for each layer?
I need those values to know in my engine if the character is in front or behind an object.

Mayo Master

  • *
  • Posts: 650
    • View Profile
Re: Question about background culling
« Reply #4 on: 2015-01-11 15:59:13 »
As far as I understand, the game handles depth as follows:
The scene is actually decomposed into several layers, which you can obtain with Palmer. Palmer allows you to import your own modified images , which can then be processed and tiled for them to be handled by the game engine - they are scrambled and look like this:



Now, in the game, the character walks on the walkmesh. Depending on which triangle of the walkmesh the character walks on, some tiles are displayed or remain hidden, and can be displayed over the character. Palmer does not give depth values, it rather gives "what object should be on what layer", and at the moment the way these layers are pre-cut and tiled is a constraint (we can't design layers the way we would like, so here's a strong limitation on how much you can create). If you're interested in the possibility of removing this constraint, I think our best lead is what the folks at the q-gears forum is doing (working on an alternate game engine, actually) - but I don't see that happening in the near future.

namelivia

  • *
  • Posts: 6
    • View Profile
Re: Question about background culling
« Reply #5 on: 2015-01-13 22:15:14 »
Thanks for your answer.
I've been thinking and playing around and got the conclussion that what I wanted to do is not possible.
I've split a scenario into layers but there is no easy way to arrange the layers using blender and fitting them in place (including depth).



This is what I got after a while.
I think I will have to discard the idea.

Mayo Master

  • *
  • Posts: 650
    • View Profile
Re: Question about background culling
« Reply #6 on: 2015-01-14 06:51:52 »
To be sincere, I'm not really sure what you wanted to test here. Could you please explain in detail what you were trying to do? I think I got a little confused. If you were trying to add extra layers of objects with complete freedom over what you can place in the foreground or not, indeed that's not possible. Or at least, not until we get another game engine.

namelivia

  • *
  • Posts: 6
    • View Profile
Re: Question about background culling
« Reply #7 on: 2015-01-14 06:57:34 »
Yes, I was trying to position the top layer's objects in Blender's 3D space to then export them to my game engine.
That way I could also add new objects or modify the scenes using Blender.

Mayo Master

  • *
  • Posts: 650
    • View Profile
Re: Question about background culling
« Reply #8 on: 2015-01-14 15:17:45 »
Note that as far as Blender 3D is concerned, you can place objects in the relevant layers and render them individually, accounting for the indirect light stemming from all the other objects in the scene, and you can also use objects as masks. So in a sense, if the game engine was not so limited because of the tiled reconstruction of the fields, Blender could allow you to do that.

namelivia

  • *
  • Posts: 6
    • View Profile
Re: Question about background culling
« Reply #9 on: 2015-12-09 20:17:47 »
Hey! I just wanted to inform that messing around with Blender I was able to do exactly what I wanted using Blender and nothing else.

They key was to set the background as a textured plane facing the camera, with an exact size, and then create every object that can occlude the character by duplicating the plane, moving it closer to the camera, scaling it and then cutting it out.




It's cool because one of my main goals was to recreate the 3d space using just the picture and no additional info. It requires doing it by hand but it works pretty well just by using the picture, nothing else.

One of the things that made my so worried about the fact of just using the picture was for being able to extend it to real life pictures or drawings. Using this method you can also make a FF like scene from a real life picture.



I wanted to find a method not only to recreate FF but to also create FF like stuff. And at least for the scene reconstruction this suit my needs.

The whole process is explained in detail on my blog: http://namelivia.com/final-fantasy-vii-scene-reconstruction-using-blender-part-2/. However I'm considering making a video tutorial, because maybe my english writing skills are not that good and something it's not clear.

Thanks for helping me! Hope someone likes this or find it useful!