[no bug]DirectX model has empty first mesh buffer
[no bug]DirectX model has empty first mesh buffer
I'm having this weird problem where all my materials have a ridiculously high specular.
Here's an example of how my scene should look:
To get this, I had to set my light's SpecularColor to 0.
Here's how it actually looks.
The front left tire's specular has been set to 0, but it has no effect. Everything in the scene is still washed out with specular highlighting.
This is in Irrlicht 1.5 with the OpenGL driver. Irrlicht 1.5.1 has the same problem, and 1.5.1 also ignores my "setLightType (ELT_DIRECTIONAL)" for some reason.
The models were exported from Blender 2.48a as DirectX meshes. In Blender, the specular value is 0 and the specular color is black. :/
When I export as OBJ, the lighting seems to work fine, and I can set the specular from within Irrlicht.
Here's an example of how my scene should look:
To get this, I had to set my light's SpecularColor to 0.
Here's how it actually looks.
The front left tire's specular has been set to 0, but it has no effect. Everything in the scene is still washed out with specular highlighting.
This is in Irrlicht 1.5 with the OpenGL driver. Irrlicht 1.5.1 has the same problem, and 1.5.1 also ignores my "setLightType (ELT_DIRECTIONAL)" for some reason.
The models were exported from Blender 2.48a as DirectX meshes. In Blender, the specular value is 0 and the specular color is black. :/
When I export as OBJ, the lighting seems to work fine, and I can set the specular from within Irrlicht.
Re: Scene is washed out with specular lighting (DirectX mode
I suggest comparing the other material colours, like ambient and diffuselulzfish wrote:When I export as OBJ, the lighting seems to work fine, and I can set the specular from within Irrlicht.
You're doing something wrong, post some code and some models.lulzfish wrote:When using OBJ, I can set all of the colors fine.
When using X, I cannot set any of them.
I guess one of them was an oversight, and now it can't be changed because it will break everyone's code!Also, why do SColor and SColorf use different constructors? One is ARGB and one is RGBA.
Yeah, that's what I was afraid of.
I'm using this to change the ambient / specular / diffuse on my nodes:
Like I said, it only works on obj for some reason.
Here's the full main.cpp just for the hell of it:
http://pastebin.com/m50e7b50b
Here's the .blend for the tires, and the .x and .obj/.mtl I exported from Blender:
http://cid-1f464824e5c9e65e.skydrive.li ... =4&lc=1033[/code]
edit: I also added the 'truck' body just for completeness, and the textures. The program expects them to be in the "models" folder.
I'm using this to change the ambient / specular / diffuse on my nodes:
Code: Select all
leftBackTire->getMaterial (0).SpecularColor = SColor (255, 255, 0, 0);
leftBackTire->getMaterial (0).AmbientColor = SColor (255, 0, 255, 0);
leftBackTire->getMaterial (0).DiffuseColor = SColor (255, 0, 0, 255);
Here's the full main.cpp just for the hell of it:
http://pastebin.com/m50e7b50b
Here's the .blend for the tires, and the .x and .obj/.mtl I exported from Blender:
http://cid-1f464824e5c9e65e.skydrive.li ... =4&lc=1033[/code]
edit: I also added the 'truck' body just for completeness, and the textures. The program expects them to be in the "models" folder.
Perhaps when exported as .X it has more than one material?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Yep BlindSide is right, the X file has two materials.
edit: This is a bug in the X loader, the X file itself only contains one mesh buffer!
edit2: Retitled, moved to bug reports and bug added
ps) Excellent test case by the way, everything I needed to reproduce the bug. Only complaint is I had to download the models one by one, but I guess you can't have everything!
edit: This is a bug in the X loader, the X file itself only contains one mesh buffer!
edit2: Retitled, moved to bug reports and bug added
ps) Excellent test case by the way, everything I needed to reproduce the bug. Only complaint is I had to download the models one by one, but I guess you can't have everything!
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
The .x loader is correct. The tire has two materials defined, which requires the creation of two meshbuffers. You should simply not export the second material if you don't want it to be created. Since the assignment of meshbuffers and joints/weights is heavily related to the meshbuffer organisation it's not easy to check whether a meshbuffer can be skipped. Moreover, CSkinnedMesh does not allow to remove a meshbuffer, so there's also no way later on to fix this.
The truck has several parts, probably for joints. Each of these parts requires a material, which makes 7 all together. The 8th is once again a duplicated material, which is exported as is into the material list of the .x file. Blame the exporter or yourself (don't know really, as I'm not too much into Blender).
The shininess of the second material of the tire is set to 1, which enabled the effect as described. The only question is whether this value is correctly interpreted (does anyone know the range of shininess in .x files?). But it's definitely enabled.
The truck has several parts, probably for joints. Each of these parts requires a material, which makes 7 all together. The 8th is once again a duplicated material, which is exported as is into the material list of the .x file. Blame the exporter or yourself (don't know really, as I'm not too much into Blender).
The shininess of the second material of the tire is set to 1, which enabled the effect as described. The only question is whether this value is correctly interpreted (does anyone know the range of shininess in .x files?). But it's definitely enabled.
I'm going to blame Blender then, since I'm quite sure that both models have a single material and texture.
The truck has 7 different meshes, though there are no joints going on.
The truck .X has 8 materials, the first 7 are named Material (and all located near one of the meshes) and the last one is named Mat1 and has a high specular / shininess for whatever reason.
WTF.
edit: This was all of a hell of a lot of trouble, so I just found a B3D exporter for Blender, which seems to bridge Blender to Irrlicht MUCH more nicer than .X, and with smaller models.
The truck has 7 different meshes, though there are no joints going on.
The truck .X has 8 materials, the first 7 are named Material (and all located near one of the meshes) and the last one is named Mat1 and has a high specular / shininess for whatever reason.
WTF.
edit: This was all of a hell of a lot of trouble, so I just found a B3D exporter for Blender, which seems to bridge Blender to Irrlicht MUCH more nicer than .X, and with smaller models.