Page 3 of 6

Posted: Wed Aug 08, 2007 5:26 pm
by hybrid
Do you have source code and the mesh publically available? Because I don't believe you. Either the mesh has no smoothing normals and you generate them in Ogre (also possible in Irrlicht) or you use different meshes.

Posted: Wed Aug 08, 2007 5:37 pm
by vermeer
heh

*.3ds I'm a 2d/3d artist .Avoid that format.
what Hybrid says is correct, that format is terrible for smoothing. Even more, by how it is, it cannot have a 3d vertex with two UV coordinates. It simply break the mesh there when you save as 3ds. And if you saved before, doesn't matter now is converted to obj. It was already broken. So, when it finds an vertex with two uv pairs (every time an uv island ends... sooo often) it breaks as needs a new 3d vertex. there's now double vertice there (problems with weighting in many 3d tools, and probs in engines/formats) , and as there's a mesh break, the smoothing break is forced.Only way to fix is apply some forced code, or weld m esh very carefully (to not weld other vertex too near somewhere else) and reapply normals.

An obj if was born from an already exported as 3ds file from your Max or a sample wich was in 3ds format, man, it's broken already. Youc an fix it in another different art package.There's a load supporting OBJ better than max, and available free.

In your first ogre shot, looks like you have a diffferent screen ratio or fov, dunno.

in your latest OBJ screenshot, there's actually a cut, dunno if is mesh cut (could be easily) , or if simply you asigned an autosmooth value with a tool or code: that is usually depending on the angle it finds betwen every pair of faces...if it's sharper that certain angle threshold, it produces an smothing crease there, wether or not there was there a mesh break.

I very well know irrlicht supports vertex normals: Murphy and I produced MIM test levels with all normals well applied and well preserved from my : Wings, Milkshape, XSI, Giles, Blender.

Is a matter on your knowledge on the art side, sorry, and probably on the coding side, too. ;) But don't you worry, we all learn things every day :)

seems like ogre applies normals by default even if it hasnt em, which is quite newbie friendly, but imo, not an engine advantage or issue, when a good artist plays with an engine, must pass you correct meshes, and hopefully in a not so faulty, ancient format. Md2, and md3 suffer from that and worse probs, and is for the age they show. Go use a better format like OBj from start, or ms3d, collada, b3d...

I agree with you the fps is not a valuable dat with a cube loaded, probably ogre loads in memory a load of things to have them available, dunno.

i gess that obj has some mesh problem, as I say..

Posted: Wed Aug 08, 2007 5:41 pm
by vermeer
yep , a zip with both code and meshes should be needed, otherwise, there are many things in that which are not easy to believe...


also, you said you did not add any uv or texture, and I think depending on th eformat loader, could create probs in the engine...unsure, tho, in that point.

Posted: Wed Aug 08, 2007 5:44 pm
by agi_shi
Ok, I'll post the source and the models and everything... let me wrap it up.

In the meantime, though - I exported the .obj not from the .3ds, but from blender. And I ticked "vertex normals" to "on".

Irrlicht code:

Code: Select all

#include <irrlicht.h>


using namespace irr;


using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;


int main(int argc, char** argv)
{


	IrrlichtDevice *device =
		createDevice(EDT_OPENGL, dimension2d<s32>(1024, 768), 32,
			false, false, false, 0);

	device->setWindowCaption(L"Disorder Engine");


	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	IGUIEnvironment* guienv = device->getGUIEnvironment();


	/*IAnimatedMesh*/IMesh* mesh = smgr->getMesh(/*"sydney.md2"*/"cube.obj")->getMesh(0);
	/*IAnimatedMeshSceneNode*/IMeshSceneNode* node = smgr->addMeshSceneNode(mesh);//addAnimatedMeshSceneNode( mesh );
node->setScale(vector3df(10, 10, 10));

	if (node)
	{
		node->setMaterialFlag(EMF_LIGHTING, true);
		//node->setFrameLoop(0, 310);
		//node->setMaterialTexture( 0, driver->getTexture("sydney.bmp") );
	}


	ICameraSceneNode *camera = smgr->addCameraSceneNode(0, vector3df(150,150,-150), vector3df(0,0,0));
	camera->setAspectRatio(1024.0 / 768.0);
	smgr->addLightSceneNode(0, vector3df(150, 150, 150), SColorf(0.2, 0.9, 0.2), 100);


	while(device->run())
	{

		driver->beginScene(true, true, SColor(0,51,51,51));

		smgr->drawAll();
		//guienv->drawAll();

		driver->endScene();
	}


	device->drop();

	return 0;
}
It's just the Code::Blocks starting file with all of the comments and stuff removed, and some simple added stuff.

Ogre:

Code: Select all

#include <iostream>

#include <ogre.h>

#include "lua_utils/d_script_state.hpp"

#include "ogre_utils/d_root.hpp"
#include "ogre_utils/d_api.hpp"

int main(int, char**) {
    Disorder::OgreUtils::RootManager rMgr;
    rMgr.createWindow();

    // resource config
    Disorder::LuaUtils::ScriptState ss;

    ss.registerAPI<Disorder::OgreUtils::OgreLuaAPI>();
    // Disorder::OgreUtils::OgreLuaAPI::_register(ss);

    ss.loadScript(Disorder::OgreUtils::DATA_DIR + "scripts/res_cfg.lua");
    ss.setLFunc("main");
    ss.callLFunc(0);

    Ogre::SceneManager *sceneMgr = rMgr.gSceneMgr();
    Ogre::Entity *ent = sceneMgr->createEntity("ent", "cube.mesh");
    //ent->setMaterialName("simple");
    Ogre::SceneNode *node = sceneMgr->getRootSceneNode()->createChildSceneNode("node");
    node->attachObject(ent);

    sceneMgr->setAmbientLight(Ogre::ColourValue(0, 0, 0));

    Ogre::Camera *camera = rMgr.gCamera();
    camera->moveRelative(Ogre::Vector3(0, 0, 100));
    camera->setPosition(Ogre::Vector3(150, 150, 150));
    camera->lookAt(Ogre::Vector3(0, 0, 0));

    // one simple point light
    Ogre::Light *light = sceneMgr->createLight("light");
    light->setDiffuseColour(Ogre::ColourValue(0.2, 0.9, 0.2));
    light->setSpecularColour(Ogre::ColourValue(0.2, 0.9, 0.2));
    light->setPosition(Ogre::Vector3(150, 150, -150));

    while(true) {
        rMgr.beginFrame();

        rMgr.renderFrame();

        rMgr.endFrame();
    }

    return 0;
}
rMgr beginFrame() does a message pump, and renderFrame() draws the scene (endFrame() is emtpy for now). You can ignore the lua stuff, and the rest is self explanatory.

I'm going to zip up the meshes and materials in a second or two.

EDIT:
Download zipped data (.material file is the file I assigned to the Ogre entity, but since it has no UVs it wasn't every useful):
http://www.wikiupload.com/download_page.php?id=194422
or
http://d01.megashares.com/?d01=f6846b9

EDIT2: It said "sydney.mesh". That's wrong, it's from when I tried to export sydney.

Posted: Wed Aug 08, 2007 7:26 pm
by vermeer
can be that in the obj export something weird occurred...try with this obj, is your file exported from Wings, I asigned normals to it..

About the code, is not my field...

http://www.filesend.net/download.php?f= ... 67ff8f480a

Posted: Wed Aug 08, 2007 7:44 pm
by agi_shi
vermeer wrote:can be that in the obj export something weird occurred...try with this obj, is your file exported from Wings, I asigned normals to it..

About the code, is not my field...

http://www.filesend.net/download.php?f= ... 67ff8f480a
Worse:
Image

Seems like your normals are more fucked then mine :P. And no, it's not from wings3d, it's from blender (like I just said in my other post).

Anyways, I don't really care. I use Ogre ;) And from what I can see, while taking a bit more time to init (now taking only 1 function due to my engine and how it reads settings from lua), it looks a lot better in Ogre (not to mention easier to get into ogre without problems).

Posted: Wed Aug 08, 2007 7:53 pm
by Wyszo
Seems like multiplying each normal by -1 would solve the last issue.

Posted: Wed Aug 08, 2007 7:55 pm
by agi_shi
Wyszo wrote:Seems like multiplying each normal by -1 would solve the last issue.
That's what I'm saying. They're fucked ;). We're supposed to compare exactly the same scenes, not flip the normals for Irrlicht, make sure not to use this for Irrlicht, this is not good for Irrlicht, you need to do that for Irrlicht...

Posted: Wed Aug 08, 2007 8:56 pm
by hybrid
Why didn't you use the Ogre mesh? It's working flawlessly. Smooth normals, correct shading, etc. And please don't blame Irrlicht for problems with your mesh exports.

Posted: Wed Aug 08, 2007 9:03 pm
by Wyszo
agi_shi

O_o

Man, if flipping normals manually (1 line of code) is a huge inconvenience for you, than you are seeking a trouble, where there aren't any.

Posted: Wed Aug 08, 2007 9:11 pm
by rooly
and i've been staunchly set in deleting these two threads for HOW long now?

Posted: Wed Aug 08, 2007 9:14 pm
by agi_shi
hybrid wrote:Why didn't you use the Ogre mesh? It's working flawlessly. Smooth normals, correct shading, etc. And please don't blame Irrlicht for problems with your mesh exports.
My exports aren't the problems. Why? Because the Ogre mesh is an export of THOSE exports, in fact, it's a direct .3ds -> .mesh conversion.

@ Wyszo: It's not that it's inconvenient, it's that we're changing the original intention - the exact SAME model, in the exact SAME scene, in DIFFERENT engines.

Posted: Wed Aug 08, 2007 9:46 pm
by rooly
but then again, agi_shi, lets also remember, this is YOUR engine, optimized for YOUR tastes. To benchmark engines, you must compare them in similar, yet optimized ways for each seperately. I don't personally know if ogre comes with defaults or not, for the usage your attempting to put it thru.

Simply put, you've stated multiple times that you use ogre. We get it. We don't use ogre. Can you put that thru your thick foul-mouthed 14-y/o skull?

Now, give it a rest. You've proven to every last person who's read either of the two threads that Ogre is the choice for you. You've definitely convinced me that your a sniveling little brat who refuses to take "I have a different opinion" for an answer. Now would you PLEASE give it a rest? I honestly don't see how your attempts at comparing ogre to irrlicht show anyone anything. They are two entirely different engines, meant for two entirely different crowds. Irrlicht is for beginners, hobbyists, and people who just plain like its straight-forward nature. Ogre is for professionals with money being spent on them, and people who cut themselves at night...

Its time to put these topics down. I'll politely ask the rest of the Irrlicht community to stop posting in these threads and related ones, unless it is a prospective user asking our opinion on which might fit their needs.

I love you New York, i'll be here all week!

Posted: Wed Aug 08, 2007 10:25 pm
by agi_shi
rooly wrote:but then again, agi_shi, lets also remember, this is YOUR engine, optimized for YOUR tastes. To benchmark engines, you must compare them in similar, yet optimized ways for each seperately. I don't personally know if ogre comes with defaults or not, for the usage your attempting to put it thru.

Simply put, you've stated multiple times that you use ogre. We get it. We don't use ogre. Can you put that thru your thick foul-mouthed 14-y/o skull?

Now, give it a rest. You've proven to every last person who's read either of the two threads that Ogre is the choice for you. You've definitely convinced me that your a sniveling little brat who refuses to take "I have a different opinion" for an answer. Now would you PLEASE give it a rest? I honestly don't see how your attempts at comparing ogre to irrlicht show anyone anything. They are two entirely different engines, meant for two entirely different crowds. Irrlicht is for beginners, hobbyists, and people who just plain like its straight-forward nature. Ogre is for professionals with money being spent on them, and people who cut themselves at night...

Its time to put these topics down. I'll politely ask the rest of the Irrlicht community to stop posting in these threads and related ones, unless it is a prospective user asking our opinion on which might fit their needs.

I love you New York, i'll be here all week!
If you read my source (scroll up), you'll notice that I only initialize the RootManager. Since you probably don't know this, the RootManager simple initialize Ogre and it's window based on a lua script. There is nothing else that is just "my" engine in there being done.

Why do I post here? Because of <snip> people like you:
Ogre is for professionals with money being spent on them, and people who cut themselves at night...
Wrong. Very wrong. I suggest you research Ogre a bit before you mention something as stupid and uneducated as that.

And no, the "snip" wasn't added by a moderator. I'm try to keep my "foul, bratty" side out of this "good, clean" thread.

Posted: Thu Aug 09, 2007 5:18 am
by Virion
Please stop comparing. Each engine has its own pros and cons. I am both Ogre and Irrlicht user. I use different engines for different projects. IMO both engines are great.
Different people has different perspective. If you think that Ogre suits your project most then just move on and use it! Don't waste your time arguing which engine is better, which engine has been used in commercial projects, etc.

Please be wise, thanks. 8)