Hey.
I have a problem, because when i load my .x model with a texture, it's basically in black&white light only. I believe that the light's power is too big. The colors probably are 255,255,255 and only 0,0,0 when not in light. Basically, in light = RGB 255,255,255, not in light RGB = 0,0,0.
Well, here's a screen:
The whole model should be red.
Any way to make the lighting proper?
.x model lighting (Now it's shadows performance)
.x model lighting (Now it's shadows performance)
Last edited by Kamac on Sun Jan 15, 2012 7:18 pm, edited 1 time in total.
Re: .x model lighting
Whats the shininess of your model?
Code: Select all
node->getMaterial(0).Shininess = 1.0f;
Re: .x model lighting
Actually, i fixed it!
I had to:
A) Increase ambient color.
B)
But now i have another problem. I want to cast about 20 shadows with addShadowVolumeSceneNode. But it lags so much when i do that! I am not sure why. Is it Irrlicht's performance? I will add that the objects aren't too primitive (basic human mesh) and that the shadow is being casted on the water and terrain, which was made with height&detail map. I [basically] get around 6 FPS and huge lags when i do that.
Have a look:
It's creating 20 objects & their shadows.
I had to:
A) Increase ambient color.
B)
Code: Select all
anode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
But now i have another problem. I want to cast about 20 shadows with addShadowVolumeSceneNode. But it lags so much when i do that! I am not sure why. Is it Irrlicht's performance? I will add that the objects aren't too primitive (basic human mesh) and that the shadow is being casted on the water and terrain, which was made with height&detail map. I [basically] get around 6 FPS and huge lags when i do that.
Have a look:
Code: Select all
for(int n = 0; n<20; n++) {
node[n] = menage->addAnimatedMeshSceneNode( mesh );
if(node[n]) {
ay += 10;
node[n]->setMaterialFlag(EMF_LIGHTING, true);
//node->setMaterialTexture(0, video->getTexture("sydney.bmp"));
//node[n]->setLoopMode(false);
//node[n]->setFrameLoop(0,1);
node[n]->setMaterialFlag(video::EMF_FOG_ENABLE, true);
node[n]->setAutomaticCulling(scene::EAC_FRUSTUM_BOX);
node[n]->addShadowVolumeSceneNode(mesh,-1,true,10.0f);
node[n]->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
if(ay > 100)
{
ax += 10;
ay = 0;
}
node[n]->setPosition(vector3df(ax,0.0f,ay));
}
}
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: .x model lighting (Now it's shadows performance)
What is the poly count of the high detail things?
I am pretty sure this could be because of unoptimized models.
I'd ŕather do this:
Make a normal map from a high poly model,
reduce the poly count to the lowest possible amount where the model still keeps it's shape.
apply the normal map...
should increase preformance.
alternatively get a better computer (On that matter, what are the specs of your pc. It could just be horrifically bad hardware)
I am pretty sure this could be because of unoptimized models.
I'd ŕather do this:
Make a normal map from a high poly model,
reduce the poly count to the lowest possible amount where the model still keeps it's shape.
apply the normal map...
should increase preformance.
alternatively get a better computer (On that matter, what are the specs of your pc. It could just be horrifically bad hardware)
"this is not the bottleneck you are looking for"
Re: .x model lighting (Now it's shadows performance)
I believe my computer isn't that bad. It runs Crysis 2, Mafia II and so on.
The models doesn't seem to be that high poly too. One model is about 1500 polys. Through, 20*1500 = 30.000 polys to cast shadows on.
The models doesn't seem to be that high poly too. One model is about 1500 polys. Through, 20*1500 = 30.000 polys to cast shadows on.
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: .x model lighting (Now it's shadows performance)
that isn't to bad. then it is most likley your code....
ah well... so much for my idea :/
I got semi-optimized stuff that is @ around 30'000 polys per file (Optimized for making the normal map)
ah well
Hope you find a solution.
ah well... so much for my idea :/
I got semi-optimized stuff that is @ around 30'000 polys per file (Optimized for making the normal map)
ah well
Hope you find a solution.
"this is not the bottleneck you are looking for"