Sphere Mapping looks really ugly :(

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Jedive
Posts: 146
Joined: Wed Apr 28, 2004 5:51 pm

Sphere Mapping looks really ugly :(

Post by Jedive »

In these two shots, you can compare a shot with Blitz3D using sphere mapping, and a shot with IrrLicht using sphere mapping... why does the IrrLicht version look that ugly?:

Image
Image
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

Why do people want to compare irrlicht to blitz basic all the time. Firstly Blitz basic is a commercial product with a paid development team. Secondly Irrlicht is only at version 0.6 so it shouldn't be all that suprising that some features don't work or need improvement.

Also please post the code you used for sphere mapping. It is possible that the problem is not in irrlicht but in your code. I haven't used sphere mapping before so i don't know if this problem is normal
Jedive
Posts: 146
Joined: Wed Apr 28, 2004 5:51 pm

Post by Jedive »

Here is the code:

Code: Select all

#include <irrlicht.h>
using namespace irr;
using namespace irr::core;
using namespace irr::video;
using namespace irr::scene;

int main(int argc, char* argv[])
{
    // Create Irrlicht Device
    IrrlichtDevice* device      = createDevice(EDT_DIRECTX8, dimension2d<s32>(640,480), 32, false, false);
    IVideoDriver*   driver      = device->getVideoDriver();
    ISceneManager*  sceneMgr    = device->getSceneManager();
    
    // Default engine config
    device->setWindowCaption(L"IrrLicht Sphere Mapping Example");
    driver->setTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY, true);
    
    // Main cam
    ICameraSceneNode* cam       = sceneMgr->addCameraSceneNodeFPS();
    
    // Main object
    IAnimatedMesh*  objMesh     = sceneMgr->getMesh("torus.3ds");
    ISceneNode*     obj         = sceneMgr->addMeshSceneNode( objMesh->getMesh(0) );
    obj->setMaterialTexture(0, driver->getTexture("autobahn.jpg"));
    obj->setMaterialFlag(EMF_LIGHTING, false);
    obj->setMaterialType(EMT_SPHERE_MAP);
    
    // Main loop
    while(device->run() && driver) {
        driver->beginScene(true, true, SColor(0, 150, 150, 150));
        sceneMgr->drawAll();
        driver->endScene();
    }

    // Destroy device
    device->drop();
    
    return 0;
}
I compare Blitz3D to IrrLicht for the obvious reason that i pretend to move my project from Blitz to IrrLicht, and if find something that seems a bug for me, i post it so it can be fixed and IrrLicht improved. The sphere mapping in that shot looks ugly, compared to Blitz or not. I simply posted the shot of Blitz because that was an example of how it should look.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Currently, the sphere mapping technique implemented in D3D really sucks. The OpenGL version is a little bit better. I don't know which one you used, but if it wasn't opengl, try this, maybe it's better.
Jedive
Posts: 146
Joined: Wed Apr 28, 2004 5:51 pm

Post by Jedive »

It's DX8, but OGL does not make a big difference.
Both DX and OGL can make sphere mapping by hardware... are you using your own maths to do the sphere mapping or what?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

In D3D currently yes, in OpenGL I'm using the built in Sphere-MApping-Support. As D3D9 also has this support, I'll add it soon.
Jedive
Posts: 146
Joined: Wed Apr 28, 2004 5:51 pm

Post by Jedive »

Using native sphere mapping in OGL? It looks very similar to the D3D one.
Post Reply