I made a tile-based world, and sometimes you can look between some tiles and you see a vertical (or horizontal) gap between two columns of tiles. This gap is about 1 px wide and has the same color as the background, so I guess it really is a gap between the tiles, and not a real rendered "line".
This bug only occurs a very few times when moving the camera and then quickly disapears.
EDIT:
I wrote a small test program, with a black tiles and a moving camera, sometimes you can see the lines. Try it please.
Code: Select all
#define SCREEN_WIDTH 1024
#define SCREEN_HEIGHT 768
const float TILE_RATIO = 0.09f;
const float TILE_HEIGHT = 32 * TILE_RATIO;
const float TILE_WIDTH = 32 * TILE_RATIO;
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "Irrlicht.lib")
#endif
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace std;
class Tile
{
public:
Tile(IVideoDriver *driver, ISceneManager *smgr, int x, int y);
private:
ISceneManager *m_Smgr;
IVideoDriver *m_Driver;
IMeshSceneNode *m_Node;
int m_X, m_Y, m_Z;
vector3df m_Pos;
};
Tile::Tile(IVideoDriver *driver, ISceneManager *smgr, int x, int y) : m_Driver(driver), m_Smgr(smgr), m_X(x), m_Y(y)
{
float posX = m_X * TILE_WIDTH;
float posY = (m_Y *TILE_HEIGHT) + 32*TILE_RATIO/2;
m_Pos = vector3df(posX, posY, 0.0f);
IMesh* m = m_Smgr->getGeometryCreator()->createPlaneMesh(dimension2df(32*TILE_RATIO, 32*TILE_RATIO), dimension2d<u32>(1, 1), 0, dimension2df(1, 1));
m_Node = m_Smgr->addMeshSceneNode(m);
m_Node->setPosition(m_Pos);
m_Node->setRotation(vector3df(270,0,0));
m_Node->setAutomaticCulling(EAC_OFF);
m_Node->setMaterialFlag(EMF_BILINEAR_FILTER , true);
}
int main()
{
SIrrlichtCreationParameters param;
param.DriverType = video::EDT_DIRECT3D9;
param.WindowSize = irr::core::dimension2d<u32>(SCREEN_WIDTH, SCREEN_HEIGHT);
param.Bits = 32;
param.Fullscreen = false;
param.Stencilbuffer = false;
param.Vsync = true;
param.AntiAlias = false;
IrrlichtDevice* device = createDeviceEx(param);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
//#######CAMERA#########
scene::ICameraSceneNode* m_Camera = smgr->addCameraSceneNode();
m_Camera->setTarget(irr::core::vector3df(0.0f,0.0f,0.0f));
m_Camera->setPosition(irr::core::vector3df(0.0f, 0.0f, -500.0f));
irr::core::matrix4 projMat;
projMat.buildProjectionMatrixOrthoLH(SCREEN_WIDTH/11,SCREEN_HEIGHT/11,1,1000);
m_Camera->setProjectionMatrix(projMat);
//#######################
//#######TILES######### (DONT MIND THE MEMORY LEAKS. THIS IS JUST A TEST)
for(int x = -100; x < 100; x++)
{
for(int y = -20; y < 20; y++)
{
Tile* tile = new Tile(driver, smgr, x, y);
}
}
//#######################
int lastFPS = -1;
u32 then = device->getTimer()->getTime();
float movementSpeed = 70.0f;
while(device->run())
{
const u32 now = device->getTimer()->getTime();
const f32 frameDeltaTime = (f32)(now - then) / 1000.f;
then = now;
if(m_Camera->getPosition().X > 190)
movementSpeed = -movementSpeed;
if(m_Camera->getPosition().X < -190)
movementSpeed = -movementSpeed;
m_Camera->setPosition(irr::core::vector3df(m_Camera->getPosition().X+movementSpeed* frameDeltaTime, 0.0f, -500.0f));
m_Camera->setTarget(irr::core::vector3df(m_Camera->getPosition().X+movementSpeed*frameDeltaTime, 0.0f, 0.0f));
driver->beginScene(true, true, video::SColor(205,205,205,205));
smgr->drawAll();
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw tmp(L"tile test fps: ");
tmp += fps;
device->setWindowCaption(tmp.c_str());
lastFPS = fps;
}
}
device->drop();
return 0;
}
*EDIT*
I managed to capture a screenshot: