Isometric 2.5D Engine Journey - Help needed :(
Isometric 2.5D Engine Journey - Help needed :(
Okay this might sound crazy, but I'm going to build a 2.5D isometric engine using Irrlicht. Or at least try.
The idea is this. I have ground tiles and environmental props rendered in 2D quads, while characters in 3D. The choice to use 3D for characters (e.g. Total Influence Online, FOnline, Temple of Elemental Evil, etc) is to reduce the sprite work which grows exponentially when you want to show equipped items on the character. Additionally, making it a 3D model would give me much more flexibility in adding more animations, as well as some time savers like animation retargeting and blending.
Next, I'd love to try my hands on per-pixel lighting in this scene. This is the general high-level idea:
1) Render all diffuse maps into a render targets
2) Render all normal maps in world space into another render target
3) Depth sort all pixels by height and write into depth buffer
4) Use a shader that samples all render targets to figure out light intensity
Basically, a deferred rendering technique without polygons. Or so I read.
Thing is, I have completely no idea on how to achieve this. Seriously. I know how to do a full 3D scene, and I've written my own top-down tiled 2D game too. I understand 2D isometric draw orders and such, but right now I'll be using Irrlicht to attempt this engine.
This thread will hold my journey of discovery as I stumble and fumble through the dark. I appreciate all help I can get from experienced members here.
Here's the mockups that I did in photoshop to illustrate my eventual goal:
Day Time
Night Time
The idea is this. I have ground tiles and environmental props rendered in 2D quads, while characters in 3D. The choice to use 3D for characters (e.g. Total Influence Online, FOnline, Temple of Elemental Evil, etc) is to reduce the sprite work which grows exponentially when you want to show equipped items on the character. Additionally, making it a 3D model would give me much more flexibility in adding more animations, as well as some time savers like animation retargeting and blending.
Next, I'd love to try my hands on per-pixel lighting in this scene. This is the general high-level idea:
1) Render all diffuse maps into a render targets
2) Render all normal maps in world space into another render target
3) Depth sort all pixels by height and write into depth buffer
4) Use a shader that samples all render targets to figure out light intensity
Basically, a deferred rendering technique without polygons. Or so I read.
Thing is, I have completely no idea on how to achieve this. Seriously. I know how to do a full 3D scene, and I've written my own top-down tiled 2D game too. I understand 2D isometric draw orders and such, but right now I'll be using Irrlicht to attempt this engine.
This thread will hold my journey of discovery as I stumble and fumble through the dark. I appreciate all help I can get from experienced members here.
Here's the mockups that I did in photoshop to illustrate my eventual goal:
Day Time
Night Time
Last edited by soggie on Wed Sep 29, 2010 2:18 pm, edited 1 time in total.
My Game Development Diary: Splintered Core CRPG Diary
Milestone 01
The first milestone would be to display a basic isometric scene with the correct camera setup, grid helper, texture splatting and shader-enabled texture blending modes.
Tasks:
The first milestone would be to display a basic isometric scene with the correct camera setup, grid helper, texture splatting and shader-enabled texture blending modes.
Tasks:
- Set up Irrlicht [done]
- Set up skeleton application framework
- Set up camera control, lock to X and Y axis
- Set up configuration file reader to control initial camera properties
- Set up material configuration file to prevent re-compiles when testing textures
- Set up isometric wireframe grid
- Set up grid-aligned textured isometric quads
- Set up support for multi-layered ground textures
- Set up texture splatting with alpha mask
Last edited by soggie on Wed Sep 29, 2010 4:48 am, edited 1 time in total.
My Game Development Diary: Splintered Core CRPG Diary
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Too bad I'm just a beginner here, and I think my discoveries would benefit beginners more than experienced developers.Lonesome Ducky wrote:I think this topic would get the attention it deserves in project announcements, rather than beginners help
My Game Development Diary: Splintered Core CRPG Diary
Beginners Help forum is more for Q&A. Your post deserved to be moved to Project Announcements as it fits the requirements.soggie wrote:Too bad I'm just a beginner here, and I think my discoveries would benefit beginners more than experienced developers.Lonesome Ducky wrote:I think this topic would get the attention it deserves in project announcements, rather than beginners help
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Posts: 27
- Joined: Mon Aug 14, 2006 12:36 pm
Right now I have a few ideas in mind. Not sure if they would work though. One of them involves a custom depth buffer...milkshakeman wrote:You say props are in 2D and chars in 3D. It will be interesting to see how you handle the fact that a char can be standing behind, in front or partially behind and in front of a prop
But I'll update this thread on my findings.
My Game Development Diary: Splintered Core CRPG Diary
Okay I was a little disappointed.
I tried this first method:
But got this results:
Compared to my mockup here:
There's a world's difference in the sharpness of the ground tiles. I used this code:
Even with anisotropic filtering on the textured ground, still it cannot match the sharpness of pure 2D tiling. This means that I need to change my rendering method to:
where I disable the z-buffer and sort the scene node's z-order using my own scene manager.
Any tips on improving the sharpness of the texture?
I tried this first method:
But got this results:
Compared to my mockup here:
There's a world's difference in the sharpness of the ground tiles. I used this code:
Code: Select all
void buildScene( IVideoDriver* driver, ISceneManager* sceneMan, IGUIEnvironment* guiEnv )
{
// Create a camera pointing down the Z-axis
ICameraSceneNode* camera = sceneMan->addCameraSceneNode(
0,
vector3df( 1.0f, 1.0f, 1.0f ),
vector3df( 0.0f, 0.0f, 0.0f )
);
// Get the scene's width and height
dimension2d<u32> size = driver->getScreenSize( );
matrix4 clipMatrix;
clipMatrix.buildProjectionMatrixOrthoLH( size.Width * 2.0f, size.Height * 2.0f, -1000.0f, 4000.0f );
camera->setProjectionMatrix( clipMatrix, true );
// Create a ground plane
IAnimatedMesh* terrain = sceneMan->addHillPlaneMesh(
"ground_plane",
dimension2d<f32>( 100.0f, 100.0f ), // tile size
dimension2d<u32>( 80, 80 ), // tile count
0,
0.0f,
dimension2d<f32>( 0.0f, 0.0f ),
dimension2d<f32>( 15.0f, 15.0f ) // texture repeats
);
// Prepare the multitextures
ITexture* alpha = driver->getTexture( "../media/alpha.tga" );
ITexture* texture1 = driver->getTexture( "../media/dirt-floor-moss1.png" );
ITexture* texture2 = driver->getTexture( "../media/grass_20_d.jpg" );
// Add it into the scene
IAnimatedMeshSceneNode* terrain_node = sceneMan->addAnimatedMeshSceneNode( terrain );
terrain_node->setPosition( vector3df( 0.0f, -90.1f, 0.0f ) );
terrain_node->setMaterialTexture( 0, texture1 );
terrain_node->setMaterialFlag( video::EMF_LIGHTING, false );
terrain_node->setMaterialFlag( video::EMF_ANISOTROPIC_FILTER, true );
// Create the hooman
IAnimatedMesh* mesh = sceneMan->getMesh( "../media/sydney.md2" );
IAnimatedMeshSceneNode* node = sceneMan->addAnimatedMeshSceneNode( mesh );
node->setScale( vector3df( 3.0f, 3.0f, 3.0f ) );
if ( node )
{
node->setMaterialFlag( EMF_LIGHTING, false );
node->setMaterialFlag( video::EMF_ANISOTROPIC_FILTER, true );
node->setMaterialFlag( video::EMF_TRILINEAR_FILTER, true );
node->setMaterialFlag( video::EMF_ANTI_ALIASING, true );
node->setMD2Animation( scene::EMAT_STAND );
node->setMaterialTexture( 0, driver->getTexture( "../media/sydney.bmp" ) );
}
}
where I disable the z-buffer and sort the scene node's z-order using my own scene manager.
Any tips on improving the sharpness of the texture?
My Game Development Diary: Splintered Core CRPG Diary
Well it did improved the sharpness of the ground textures, but at the cost of the model's texture. Is it possible to selectively enable mipmapping for specific scene nodes only?mandrav wrote:Try disabling filtering (bilinear/trilinear/anisotropic) and also mipmapsAny tips on improving the sharpness of the texture?
EDIT: Also, turning off mipmapping seemed to reduce the FPS from 800+ to 500+.
EDIT: Well I figured it out. The key is to make a bigger tile size. I kept anisotropic and trilinear turned on, and this is what I got:
It's a wrap for today!
My Game Development Diary: Splintered Core CRPG Diary