[SOLVED] broken lighting on models
[SOLVED] broken lighting on models
hey guys.
probably its not irrlicht related but i need your help.
I made a character, in the editor it had nice lighting on it, but in irrlicht the lights are kinda off.
probably its about the normals, but how can i achieve editor like lighting?
here two picture:
http://blud.freeiz.com/up/good.PNG
http://blud.freeiz.com/up/baad.PNG
if i have to change something in the model, then can u tell me what?
or if i need to use a shader then can u give me some example? (im not good with shaders, and i dont really have time for studying it atm)
this is probably because i have double sided triangles in my model. tried to remove, it looked better, but the performance drop (since i have to disable the backface culling) is not something what i like. and so, it wasnt smooth either
thanks~
probably its not irrlicht related but i need your help.
I made a character, in the editor it had nice lighting on it, but in irrlicht the lights are kinda off.
probably its about the normals, but how can i achieve editor like lighting?
here two picture:
http://blud.freeiz.com/up/good.PNG
http://blud.freeiz.com/up/baad.PNG
if i have to change something in the model, then can u tell me what?
or if i need to use a shader then can u give me some example? (im not good with shaders, and i dont really have time for studying it atm)
this is probably because i have double sided triangles in my model. tried to remove, it looked better, but the performance drop (since i have to disable the backface culling) is not something what i like. and so, it wasnt smooth either
thanks~
Last edited by B@z on Mon Jul 12, 2010 10:15 pm, edited 1 time in total.
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
If you`re scaling your model, did you tried normalizing the normals?
If not, check your model.
Code: Select all
node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Re: broken lighting on models
I have faced similar problem with my wizard, but fixed it. How you do the double sided triangles? I mean do you duplicate them or what? If You do duplicate them, make sure they're at least 0.1 blender unit off the original position, if you only want to make inside space not culled.B@z wrote:hey guys.
probably its not irrlicht related but i need your help.
I made a character, in the editor it had nice lighting on it, but in irrlicht the lights are kinda off.
probably its about the normals, but how can i achieve editor like lighting?
here two picture:
http://blud.freeiz.com/up/good.PNG
http://blud.freeiz.com/up/baad.PNG
if i have to change something in the model, then can u tell me what?
or if i need to use a shader then can u give me some example? (im not good with shaders, and i dont really have time for studying it atm)
this is probably because i have double sided triangles in my model. tried to remove, it looked better, but the performance drop (since i have to disable the backface culling) is not something what i like. and so, it wasnt smooth either
thanks~
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
-
- Posts: 226
- Joined: Fri Aug 22, 2008 8:50 pm
- Contact:
shadowslair: smoothing groups are fine. i never heard about stl check, but ill try to find something like that thanks
freetimecoder: in shaded mode, its similar to what i get in irrlicht, just more shaded, but same bad. recalculate normals simply killed my model, so didnt really work.
im using b3d, and tried triangulating, but the result is same
tried out something, whats said its similar to stl check. did not work
freetimecoder: in shaded mode, its similar to what i get in irrlicht, just more shaded, but same bad. recalculate normals simply killed my model, so didnt really work.
im using b3d, and tried triangulating, but the result is same
tried out something, whats said its similar to stl check. did not work
-
- Posts: 226
- Joined: Fri Aug 22, 2008 8:50 pm
- Contact:
The problem is with your mesh, not with irrlicht. Some normals are flipped inside instead of outside, that causes the errors.in shaded mode, its similar to what i get in irrlicht, just more shaded, but same bad
In editing mode you can display the normals via Mesh (F9) -> Mesh Tools More -> Draw Normals
They should be displayed as pointing outwards lines. Some will point inwards, you have to flip them (W->Flip Normals)
Usually Ctrl + N does that for you very reliable, what do you mean by "killed my model?"
Edit: hm at least that is what I think, but then again it should show holes in irrlicht, unless you disabled backface culling? Can you post a picture of your model in shading mode and edit mode with drawn normals?
greetings
no, u took me wrong. u think my model has a material setted to double sided. but no, i have double sided faces (probably it is just duplicated faces with different normals)
so i have both normals pointing outside and inside![Very Happy :D](./images/smilies/icon_biggrin.gif)
http://blud.freeiz.com/up/solid.PNG
http://blud.freeiz.com/up/normal-1.PNG
http://blud.freeiz.com/up/normal-2.PNG
so i have both normals pointing outside and inside
![Very Happy :D](./images/smilies/icon_biggrin.gif)
http://blud.freeiz.com/up/solid.PNG
http://blud.freeiz.com/up/normal-1.PNG
http://blud.freeiz.com/up/normal-2.PNG
-
- Posts: 226
- Joined: Fri Aug 22, 2008 8:50 pm
- Contact:
That explains alot
With that Recalculate Normals Outside cannot work.
If they are not necessary (e.g. for UV mapping) you should not use doublesided meshes like that (you encounterd one of the problems it brings already) You should remove the unecessary faces by selecting everything and use W -> Remove Doubles, and then recalculate the normals. In Irrlicht disable backface flipping for the mesh or the desired material.
If you do need a both side setup, first finish your model, and get rid of double sides as described above, then dublicate the faces and flip the dublicated's normals. You can attach the borders by using remove doubles but that would certainly result again in shading errors.
greetings
![Wink ;)](./images/smilies/icon_wink.gif)
If they are not necessary (e.g. for UV mapping) you should not use doublesided meshes like that (you encounterd one of the problems it brings already) You should remove the unecessary faces by selecting everything and use W -> Remove Doubles, and then recalculate the normals. In Irrlicht disable backface flipping for the mesh or the desired material.
If you do need a both side setup, first finish your model, and get rid of double sides as described above, then dublicate the faces and flip the dublicated's normals. You can attach the borders by using remove doubles but that would certainly result again in shading errors.
greetings
weell, just because the cloak double sided, i dont want my full model be double sided lol.
my full model poly count is 10550
if i turn off backface culling, then its same to 21100 poly. and that matters xD
but blender, and metasequoia too can handle it. i want to know how to handle it, maybe shaders could help?
my full model poly count is 10550
if i turn off backface culling, then its same to 21100 poly. and that matters xD
but blender, and metasequoia too can handle it. i want to know how to handle it, maybe shaders could help?
-
- Posts: 226
- Joined: Fri Aug 22, 2008 8:50 pm
- Contact:
Well, also, you can do the coat double siding my way:
1. Make the coat look good even in smooth shading.
2. Go to edit mode in blender(I assume it's a different meshbuffer(than body and so on))
3. CTRL+L to select the coat
4. SHIFT+D, left click, S 0.99 stay on it selected
5. CTRL+SHIFT+N
6. ???
7. profit
1. Make the coat look good even in smooth shading.
2. Go to edit mode in blender(I assume it's a different meshbuffer(than body and so on))
3. CTRL+L to select the coat
4. SHIFT+D, left click, S 0.99 stay on it selected
5. CTRL+SHIFT+N
6. ???
7. profit