[fixed] [patch] - EDS_NORMALS debug

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.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

A couple of minor changes and it's now in the 1.6 branch-

1) I made it check whether to normalize based on the NormalizeNormals parameter of the material, which will also help for debugging purposes.

2) I had to change all your tabs to spaces, which was mildly annoying!

Thanks for the patch :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Thank you.
bitplane wrote:2) I had to change all your tabs to spaces, which was mildly annoying
:oops: Sorry about that, I neglected to run the files through unexpand. It won't happen again.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Your patches and bug reports are a pleasure to deal with, I think I speak for everyone when I say we appreciate your contributions :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

The normals of the cylinder mesh look totally wrong to me (trunk, rev. 2696):

Image

Small test code

Code: Select all

#include <irrlicht.h>

int main()
{
	irr::IrrlichtDevice* device = irr::createDevice(irr::video::EDT_OPENGL);
	irr::scene::ISceneManager* smgr = device->getSceneManager();
	irr::video::IVideoDriver* driver = device->getVideoDriver();

	smgr->getParameters()->setAttribute(irr::scene::DEBUG_NORMAL_LENGTH, 0.5f);
	smgr->getParameters()->setAttribute(irr::scene::DEBUG_NORMAL_COLOR, irr::video::SColor(255, 255, 0, 0));

	irr::scene::IMesh* const cyl = smgr->getGeometryCreator()->createCylinderMesh(0.5f, 2.0f, 8);
	irr::scene::IMeshSceneNode* node = smgr->addMeshSceneNode(cyl);
	node->setDebugDataVisible(irr::scene::EDS_NORMALS);
	cyl->drop();

	irr::scene::ICameraSceneNode* camera = smgr->addCameraSceneNode();
	camera->setPosition(irr::core::vector3df(0.0f, 0.5f, -4.0f));

	while (device->run())
	{
		driver->beginScene(true, true, irr::video::SColor(255, 255, 255, 255));
		smgr->drawAll();
		driver->endScene();
	}

	device->drop();

	return 0;
}
"Whoops..."
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

This looks like a bug in how createCylinderMesh() is generating the normals, not with how they are being displayed.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, but that's also what the post wanted to tell us AFAIK. I guess it's a best shot for the number of vertices available, though. So we can either increase the number of vertices, or take slightly wrong lighting. I'm for both solutions, btw., because both could be useful. We need a proper geometry creator with properties for this first. So don' hold your breath for this bug being fixed...
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

hybrid wrote:Yes, but that's also what the post wanted to tell us AFAIK.
Yes. I realize that this has nothing to do with the original topic.
hybrid wrote:So don' hold your breath for this bug being fixed...
I won't. He will do.
Image
"Whoops..."
Post Reply