WebGL 3d usage for depth sorting 2d objects

前端 未结 2 783
名媛妹妹
名媛妹妹 2021-01-25 20:15

This question has a strong relation with my other question: Isometric rendering without tiles, is that goal reachable?

I want to depth sort objects in an isometric world

2条回答
  •  灰色年华
    2021-01-25 21:10

    You can do this with separate pre-rendered Depth-Maps for every object. With additional Normal-Maps you can simulate Deferred Lighting, too. But this technique requires 3D creation for every object to render diffuse, normal and depthmaps for correct intersecting objects.

    See the XNA-Demo at https://www.youtube.com/watch?v=-Q6ISVaM5Ww

    Every object in this demo is just a rendered sprite with diffuse, normal and depthmap.

    At the end of the video you see how it works. The author has an additional explanation & shader code-examples in his blog at https://infictitious.blogspot.de/2012/09/25d-xna-rpg-engine-some-technical.html

    I think the same is possible with WebGL, too.

提交回复
热议问题