Normalmaps look rubbish
Normalmaps look rubbish
Hi all,
I have used normalmaps with 3ds max, Unity, CryEngine, mudbox and marmoset so obviously I want to use them in my game.
However in irrlicht they look rubbish. They just look flat and don't seem to work. I am using an obj file that I created for another game.
Basically I haven't had time to make a dog, and car etc for my monopoly game and I am using a hand grenade as a temporary replacement.
My game pieces will need normalmaps to get the detail I need on a low poly model.
Bear in mind I have removed the diffuse map to show only the normalmap.
Is there anyway to enhance normalmaps in irrlicht.
The pictures attached. Left no normalmap in max, middle grenade with normalmap, and right normalmap added in irrlicht.
I have used normalmaps with 3ds max, Unity, CryEngine, mudbox and marmoset so obviously I want to use them in my game.
However in irrlicht they look rubbish. They just look flat and don't seem to work. I am using an obj file that I created for another game.
Basically I haven't had time to make a dog, and car etc for my monopoly game and I am using a hand grenade as a temporary replacement.
My game pieces will need normalmaps to get the detail I need on a low poly model.
Bear in mind I have removed the diffuse map to show only the normalmap.
Is there anyway to enhance normalmaps in irrlicht.
The pictures attached. Left no normalmap in max, middle grenade with normalmap, and right normalmap added in irrlicht.
Re: Normalmaps look rubbish
Does it look better if you move the camera closer to it? It might be mipmapping that's fading out the details of your normal map.
Re: Normalmaps look rubbish
Hi Juan,
Unfortunately the answer is no. I set up a 3rd camera just to see it close heh heh, and not it still looks utter rubbish.
Unfortunately the answer is no. I set up a 3rd camera just to see it close heh heh, and not it still looks utter rubbish.
Re: Normalmaps look rubbish
Maybe you could post the normal map?
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Normalmaps look rubbish
Are you using Irrlicht default materials?
I can honestly say Irrlicht did seem to have normal mapping issue's in the past but I believe they have been worked out, no to sure though.
Also is your grenade one mesh. For example the pin didn't get split into another mesh buffer and the grenade body it's own separate meh buffer?
I had issue's in the past were I was applying one normal map material to my objects thinking it was one whole mesh, turn's out it looked terrible because my model once in Irrlicht was
split unto 2 or even 3 mesh buffers.
I can honestly say Irrlicht did seem to have normal mapping issue's in the past but I believe they have been worked out, no to sure though.
Also is your grenade one mesh. For example the pin didn't get split into another mesh buffer and the grenade body it's own separate meh buffer?
I had issue's in the past were I was applying one normal map material to my objects thinking it was one whole mesh, turn's out it looked terrible because my model once in Irrlicht was
split unto 2 or even 3 mesh buffers.
Re: Normalmaps look rubbish
Actually, it looks as if the normal map is working, but your model is too big to notice it. Either scale your model dowm or increase the message type param.
Re: Normalmaps look rubbish
Hi mongoose,
I will post the normalmap when I get home, but the normalmap should not depend on the size of the model.
I have used normalmaps in many engines, and so far this is the first time I have had a problem with them.
I can see why you said that, as yes in the above picture it looks like the normalmap is working but at a very low setting.
In 3ds max all normalmaps are set at a height of 100, but I don't think there is a setting for this in irrlicht.
This grenade isn't actually going to be in this game actually, but I am using it to test the normalmaps in irrlicht, and obviously there is a problem somewhere heh heh.
I am not sure what the message type param is? Is this something in the mtl file?
I will post the normalmap when I get home, but the normalmap should not depend on the size of the model.
I have used normalmaps in many engines, and so far this is the first time I have had a problem with them.
I can see why you said that, as yes in the above picture it looks like the normalmap is working but at a very low setting.
In 3ds max all normalmaps are set at a height of 100, but I don't think there is a setting for this in irrlicht.
This grenade isn't actually going to be in this game actually, but I am using it to test the normalmaps in irrlicht, and obviously there is a problem somewhere heh heh.
I am not sure what the message type param is? Is this something in the mtl file?
Re: Normalmaps look rubbish
Look in Smaterial.h. So, you never had a problem in a modeller before, and now you are having trouble in a renderer. Looks like you have strayed in to the deep, dark woods.
Re: Normalmaps look rubbish
Hi mongoose,
Here is my normalmap. This one was baked in 3ds max, but sometimes I use mudbox for baking normalmaps also.
Sometimes you have to swap the red and green colours in the maps if you transfer from max to Maya, but that is the only trouble I have ever had.
http://www.asimoventerprises.co.uk/foru ... de_nrm.tga
Had to link this instead of showing it as an image, because for some reason it didn't show up.
Here is my normalmap. This one was baked in 3ds max, but sometimes I use mudbox for baking normalmaps also.
I have built 3d models and normalmaps for use in game engines such as Unity, CryEngine and a few others, but not had this much trouble getting a normalmap to view properly.So, you never had a problem in a modeller before, and now you are having trouble in a renderer. Looks like you have strayed in to the deep, dark woods.
Sometimes you have to swap the red and green colours in the maps if you transfer from max to Maya, but that is the only trouble I have ever had.
http://www.asimoventerprises.co.uk/foru ... de_nrm.tga
Had to link this instead of showing it as an image, because for some reason it didn't show up.
Re: Normalmaps look rubbish
Could you share the diffuse texture and code related to the grenade as well? The screenshot has several details that aren't defined in the normal map.
Re: Normalmaps look rubbish
Hi juanjpro,
I have purposely not put on the diffuse texture, so that you can just see the normalmap.
All the detail you see on the handgrenade is done by the normalmap.
I have a video of the wireframe that I made to show off the normalmap on vimeo ages ago.
http://vimeo.com/38296780
I have a meshloading class
and I call the code with
and here is the function in my class which loads the mesh, sets up the mesh node, and creates the camera node
Please ignore the camera code. That is there because I will be adding a camera to every piece so that when it is moving you will get a closeup of the piece in action.
I will use an array of the class later when I get all the pieces in the game.
I didn't think you wanted all my code, but this is the important code that loads my mesh.
I have purposely not put on the diffuse texture, so that you can just see the normalmap.
All the detail you see on the handgrenade is done by the normalmap.
I have a video of the wireframe that I made to show off the normalmap on vimeo ages ago.
http://vimeo.com/38296780
I have a meshloading class
and I call the code with
Code: Select all
LoadMesh grenade;
grenade.loadPiece(smgr,driver,L"data/grenade/grenade.obj");
grenade.nodePosition(0,79.3f,22);
Code: Select all
void LoadMesh::loadPiece(ISceneManager* smgr,IVideoDriver* driver,const wchar_t* modelname)
{
mesh = smgr->getMesh(modelname);
node = smgr->addMeshSceneNode(mesh);
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, true);
node->setPosition(core::vector3df(0,0,0));
node->addShadowVolumeSceneNode();
camera = smgr->addCameraSceneNode(node,vector3df(0, 10, 5));
camera->bindTargetAndRotation(true);
camera->setTarget(node->getPosition());
}
}
void LoadMesh::nodePosition(float x,float y,float z)
{
node->setPosition(vector3df(x,y,z));
}
I will use an array of the class later when I get all the pieces in the game.
I didn't think you wanted all my code, but this is the important code that loads my mesh.
Re: Normalmaps look rubbish
Nice normal map. However, Irrlicht is expecting a *bump* map, like it says in the MTL file. Do you have a bump map? (Or you could change the Irrlicht source so that makeNormalMap is not called.)
Re: Normalmaps look rubbish
Hi mongoose
Unfortunately a bumpmap will not cut it in todays games. Bumpmaps in games have not been used for years. However normapmaps have replaced them.
Bumpmaps are just a grey monochromatic grey scale which simulates light in one direction, however a normalmap simulates light in 3d space.
My model will look rubbish with a bumpmap applied, however a normalmap should look good and is used in all games now.
In Unity game engine they call normalmaps bumpmaps, but that is not really the case. As you cannot actually use a bumpmap in Unity game engine. The just called a normalmap a bumpmap.
The mtl file is auto generated by 3d max on export of the obj, so if it is wrong, then how do I change it so that it loads in the normalmap?
A game engine that does not use normalmaps would be prehistoric.
In 3ds max I exported the obj with a mesh, a diffuse map and a normalmap.Nice normal map. However, Irrlicht is expecting a *bump* map, like it says in the MTL file. Do you have a bump map? (Or you could change the Irrlicht source so that makeNormalMap is not called.)
Unfortunately a bumpmap will not cut it in todays games. Bumpmaps in games have not been used for years. However normapmaps have replaced them.
Bumpmaps are just a grey monochromatic grey scale which simulates light in one direction, however a normalmap simulates light in 3d space.
My model will look rubbish with a bumpmap applied, however a normalmap should look good and is used in all games now.
In Unity game engine they call normalmaps bumpmaps, but that is not really the case. As you cannot actually use a bumpmap in Unity game engine. The just called a normalmap a bumpmap.
The mtl file is auto generated by 3d max on export of the obj, so if it is wrong, then how do I change it so that it loads in the normalmap?
A game engine that does not use normalmaps would be prehistoric.
Re: Normalmaps look rubbish
So you don't load the normal map directly, instead it's referenced by the .obj file? Maybe the textures aren't ordered the way Irrlicht expects, try applying the textures manually:
Code: Select all
node->getMaterial(0).setTexture(0,diffuse); //give the model a diffuse texture, otherwise you'll see garbage
node->getMaterial(0).setTexture(1,normalmap); //normal map must be texture index 1
Last edited by juanjpro on Tue Jan 06, 2015 4:42 pm, edited 1 time in total.
Re: Normalmaps look rubbish
You need to get all the materials. The OBJ loader sets the 'Name' field in the material so you can find a specific material. Then you can set the normal map. Although, if you use the release version of Irrlicht, this will not work because the normal map has been modified. You will need to load the normal map under a different name. Or you can use the 'trunk' version from SVN. (I thought it was fixed here but I can't see it in the code, so maybe it isn't fixed.)