Monthly Archives: April 2013

2D Mobile Game in Works

As I tweeted earlier this week I took a couple of days off from my engine work and made a game in unity3d for mobile. Well game is almost done mainly artwork is remaining which is WIP, hoping to get it done in next 10 days or so.

Right now I can only say it’s another Tetris inspired game with some gameplay derived from bejeweled type games and few twists of my own.

I will start posting some screenshot and may even release a beta release as I get some art done.

Cheap Global Illumination – Half Lambert

Global Illumination is expensive if done in real-time and still no perfect solution exits, which lead us to use offline solutions using ray tracers ,etc. They take a lot of time to compute offline data to be used later during rendering.

If we don’t use any global illumination solution our scenes tend to become dark and many areas stay close to black. To solve the problem often people use Ambient Light which creates a Flat look and washes of the details of the mesh.


Read the rest of this entry

Direct3D 11 Progress – Loading Scenes 2

So I optimized the scene renderer next day of the last post only. My internet ( MTNL showing its true colors ) wasn’t working this whole week so couldn’t update the blog.
So I managed to get up to 1400 ( 3500 FPS taking advantage of fact its stationary ) fps in Low Poly version of Dust2.
But the real test was the map from HL2 trainstation2, that’s one huge map with approx. With around 550 – 600 different textures etc. But I managed to get 500-600 FPS in that too. Just to give an idea of how much impact textures changes have on the performance I can render the same map at 4000+ FPS on GTS 450 if I use single texture.
So far I have implemented only some low-level optimizations in the SceneRenderer Like batching, material sorting, careful pipeline management, etc. Scene level optimizations including frustum culling, spatial partitioning, etc. and some new ideas that I have will be done as engine grows.
But these results are taking advantage of fact that all objects are stationary. Also I am just using Unlit Textured material FPS will fall back rapidly as I start to implement some complex materials and bring in lights etc.


( and yes I implemented the stats GUI now using SpriteFont from DirectXTK )

To compare it with previous DX9 version I used to get around 400 FPS with Oct Tree and Hierarchical Frustum culling even with a Phong Shader with couple of Directional Lights.
I will try to maintain at least 100 FPS at least in all future tests / scenes and will implement more optimizations as needed.

As far as Spatial partitioning is concerned I am going to do it together with Collision/physics system as they are kind of related. Thinking to integrate PhysX SDK which will also save time on renderer as I can use collision code from PhysX rather than porting my Collision Code from previous version. Also having two separate AABB classes or two separate AABB collision test function implementations doesn’t make sense. So I will just make a wrapper of PhysX for these things which can be replaced by any other physics engine in future.

Direct3D 11 Progress – Loading Scenes

There’s been a lot of progress in last couple of weeks. Many resource managers are done, Scene graph is almost complete, some camera systems are there, also static model loading is there, etc. Couple of Camera controllers have been done too – CameraFREELOOK and CameraOrbit. Other types of camera will be implemented as needed but for now I need these two only. Also I am using open source asset import library for importing X files only for now as I have test scenes in X file from the artwork used in last version of the engine. Once I get things working I will mess around with other formats too. Also looks like it doesn’t support so might have to implement FBX loader myself using FBX SDK later.

I trying to make the engine component based this time and also there’s been significant architectural changes compared to old DX9 version of the engine. It’s going to take a while to make engine as capable as before in terms of features. But this time it will be much more programmer friendly, more optimized, more capable to support complex scene hierarchies, etc.

I am working on loading large scenes again in this new version. Today I tested the full map with all textures at 7-8 FPS, using simple textured shader for now. It’s still better than my first attempt using DX9 engine when I got 1-2 FPS 🙂 which later after optimizations went up to 1000 FPS approx. ( after spatial partitioning, frustum culling, batching etc. ) .

In this first attempt I just made things working and there’s a lot of things left in mesh grouping, scene render manager, batching, material management, etc. I am hoping to achieve at least same results ( at least 1000 FPS ) after some optimizations and finish some loose ends.

Here’s a quick screenshot –

( Just Realized I still have to implement FrameStats GUI )

Also I will be adding a dedicated page for new version of the engine which will have an update list of things and also a To-do list. But I want to finish this scene loading first which should be done by Friday.

Links :

ASSIMP ( An open source library to import many 3d file formats )