Jump to content

Triangle Shadows Problem


Recommended Posts

UPDATED POST: CLICK HERE

I was looking at this thread since I think the problem is similar to mine, but couldn't quite understand the solution. My model has some lines that cast some bad looking shadows in Blender which look even worse when exported to Unity.

The album below shows the lines, which run parallel to the right of the red lines I marked (first pic has no red lines).

Is this an issue with mismatched planes in my mesh? I think I'm fine on that end, but it's all I can come up with. As a test I went to great lengths to fix and make sure the problem vertices in the Imgur album were all in the correct planes (they are easiest to see in pic #4, with all the tris sticking out of the border to the windows), but I was still getting bad shadow lines.

The bottom of my model was the easiest to test, as I just had to set all the edges there to the same Z height... but it didn't fix the problem (pics 8,9).

For those that need to know, I marked my sharp edges and used the Edge Split Modifier when smoothing the model, and exported as .FBX to Unity. But actually when I smoothed ALL edges, the shadow lines looked even darker and more easily noticeable!

Javascript is disabled. View full album
Edited by ev0
Link to comment
Share on other sites

Those shadows sometimes look exaggerated when brought into Unity. When its exported into the game its not as bad in some cases.

in the closeup of one window, it looks like you forgot to mark the window edge as sharp, so that might be one of the issues.

Also try selecting all object in edit mode, then remove doubles. there might be some rouge lines that need to be removed.

- - - Updated - - -

just thinking, but due to the windows being indented in the surface, it might be causing issues since the window only goes over 3 faces, which is pretty low for a smooth surface.

What you might need to do is select all your indented window sections and make move them onto a separate object using [P]. from here remove the sharps from around the windows on the main capsule body. Then go into edit mode for the new object that contains the windows, and make sure those have the sharps on the outer edges. another thing which I cant tell due to seams being show, do you have those triangle corners marked as sharps by the windows (picture 7/10)?

if you post your blend file I can take a look and try out some things.

Link to comment
Share on other sites

Those shadows sometimes look exaggerated when brought into Unity. When its exported into the game its not as bad in some cases.

in the closeup of one window, it looks like you forgot to mark the window edge as sharp, so that might be one of the issues.

Also try selecting all object in edit mode, then remove doubles. there might be some rouge lines that need to be removed.

- - - Updated - - -

just thinking, but due to the windows being indented in the surface, it might be causing issues since the window only goes over 3 faces, which is pretty low for a smooth surface.

What you might need to do is select all your indented window sections and make move them onto a separate object using [P]. from here remove the sharps from around the windows on the main capsule body. Then go into edit mode for the new object that contains the windows, and make sure those have the sharps on the outer edges. another thing which I cant tell due to seams being show, do you have those triangle corners marked as sharps by the windows (picture 7/10)?

if you post your blend file I can take a look and try out some things.

Thanks for the help. Here's my blender file.

Dropbox

I'm very new to Blender, so my model is probably super inefficient, especially when it came to the UV unwrap. I had to reposition ALL of those squares over each other manually to try to share texture.

I'll give separating the windows a try.

Doubles are gone. I've gotten into the habit of removing doubles and "delete loose" pretty often since I started Blender.

The diagonal outer edge of the triangle corner is marked sharp, but the the inner horizontal and vertical sides are not.

Edit:

The shadows are still bad in game too. (Using temporary textures)

qS3Ce6jl.png

2W8mfGDl.png

Edited by ev0
Game pics
Link to comment
Share on other sites

I'm very new to Blender, so my model is probably super inefficient, especially when it came to the UV unwrap. I had to reposition ALL of those squares over each other manually to try to share texture.

I'll give your file a look when i get home from work.

Probably too late for this tip, but one way to make the repeated texture easier for you next time around is to do the following:

-any section that you plan on repeating, delete all faces except for one instance. unwrap that and place it the way you want it on the texture map.

-Select the face(s) that will be repeated and type [sHIFT][D]. this will create a duplicate that you can place somewhere else. hit [ESC] right away to let it drop in the same location.

-use [G] or [R] to move or rotate it a certain distance or degree to go in a location that it will be repeated (if you are repeating 24 sided cylinder faces, you would just rotate the face 15 degrees).

-if you check the UV map, you'll see the faces are all overlapping on the same location. if you want a select few to have a different texture, select those faces in the edit window so they will be highlighted on the uv map. from there type [G] and shift it in the x and y directions to displace the selected faces on a different section of the map.

This might be better shown with pictures so I might post up an album later with how I did it for one of my models.

Link to comment
Share on other sites

I'm not sure if it will work in this instance, but you could try setting unity to recalculate the normals instead of importing from Blender. Select the FBX in your project window, and go to "Rig" in the inspector window. There should be normals options there.

Link to comment
Share on other sites

I'll give your file a look when i get home from work.

Probably too late for this tip, but one way to make the repeated texture easier for you next time around is to do the following:

-any section that you plan on repeating, delete all faces except for one instance. unwrap that and place it the way you want it on the texture map.

-Select the face(s) that will be repeated and type [sHIFT][D]. this will create a duplicate that you can place somewhere else. hit [ESC] right away to let it drop in the same location.

-use [G] or [R] to move or rotate it a certain distance or degree to go in a location that it will be repeated (if you are repeating 24 sided cylinder faces, you would just rotate the face 15 degrees).

-if you check the UV map, you'll see the faces are all overlapping on the same location. if you want a select few to have a different texture, select those faces in the edit window so they will be highlighted on the uv map. from there type [G] and shift it in the x and y directions to displace the selected faces on a different section of the map.

This might be better shown with pictures so I might post up an album later with how I did it for one of my models.

Yep, I heard about this method just the other day. I'll definitely use it next time!:D (Was thinking of deleting faces only, then using vertices snap instead of G and R?) An album would still be very welcome!

This is off topic from the main question, but I've actually be wondering about using that texture repeating method so I'll ask here: if I follow the steps you gave, but then need to unwrap the model again for whatever reason, will the duplicated faces still start overlapped on the UV unwrap or will I need to delete and duplicate all the faces from scratch again?

- - - Updated - - -

I'm not sure if it will work in this instance, but you could try setting unity to recalculate the normals instead of importing from Blender. Select the FBX in your project window, and go to "Rig" in the inspector window. There should be normals options there.

I had tried both importing and calculating with Unity. Both had the same results:confused:

Link to comment
Share on other sites

This is off topic from the main question, but I've actually be wondering about using that texture repeating method so I'll ask here: if I follow the steps you gave, but then need to unwrap the model again for whatever reason, will the duplicated faces still start overlapped on the UV unwrap or will I need to delete and duplicate all the faces from scratch again?

You'll need to duplicate it over again. BUT, you dont have to if you just dont select those faces when you do the unwrap a second time.

One trick I use on occasion since it can be a pain to de-select faces constantly when doing unwrapping is to break up the mesh into several objects based on my unwrapping plan. that way you can select an object, hit tab to go into edit mod, hit [A] to select all, and then unwrap. when I'm happy with my UV map, i then select all the object, and then rejoin them (except any specific meshes that will need a different material, that will stay as separate meshes, or if i want certain things to remain their own objects.

Link to comment
Share on other sites

The strange shading is being caused by poor mesh topology. The edges of the model need to flow throughout the model and Ideally remain evenly spaced in order to avoid the pinching you see on the model.

Don't make T-vertices (around the heat tiles), they cause lighting errors (in the form of abrupt cutoffs).

Avoid making N-gons (more than 5 sided planes) (around the windows)

Try to keep everything in quads, this makes editing the model a whole lot easier and prevents the bulk of lighting issues that you are seeing.

Anywhom, I worked on the model, cleaning it up by quite a bit, this should show you what I mean:

http://www./download/qo25440ydz9a4an/mk4-16_v2_026_047.blend

Link to comment
Share on other sites

Thanks Ven! I threw it into KSP real quick to check out the model (untextured), but there's still quite a few artifacts.

6j9ddSnh.png

I avoided N-gons, and modeled in quads and tris, but as a final step right before I started the UV unwrap I merged all faces that were in the same plane, which is probably where the T-vertices came from. So there's no double edges or anything, (even though I "merge" with F, it seems to be just visual as it doesn't create new edges) and I figured that Blender and Unity would triangulate them automatically. Is this bad practice?

This was to make things visually easier to separate for texturing. I also planned to use all those red-seamed squares on the bottom, top, front middle, and on the window borders to split my texture, since they would share the same textures:confused: More shared textures equals higher quality textures, yes?:wink: But this would leave A LOT of polygons if I don't merge faces like I originally did... anyway, that was my thought process.

Mirroring is something that I should have done from the start, but I'm learning as I'm going.

- - - Updated - - -

By the way! How did you get the axis to line up with the normal? I've googled that question every day but never found an answer.

vHM1Pz3l.png

Edited by ev0
Link to comment
Share on other sites

Thanks Ven! I threw it into KSP real quick to check out the model (untextured), but there's still quite a few artifacts.

http://i.imgur.com/6j9ddSnh.png

I avoided N-gons, and modeled in quads and tris, but as a final step right before I started the UV unwrap I merged all faces that were in the same plane, which is probably where the T-vertices came from. So there's no double edges or anything, (even though I "merge" with F, it seems to be just visual as it doesn't create new edges) and I figured that Blender and Unity would triangulate them automatically. Is this bad practice?

Oh, ok. Letting blender/unity converting N-gons to tris is a messy process and honestly, I don't trust either with anything more than a quad.

I put this together in the editor with the shiniest texture I could find:

Javascript is disabled. View full album

This was to make things visually easier to separate for texturing. I also planned to use all those red-seamed squares on the bottom, top, front middle, and on the window borders to split my texture, since they would share the same textures:confused: More shared textures equals higher quality textures, yes?:wink: But this would leave A LOT of polygons if I don't merge faces like I originally did... anyway, that was my thought process.

Mirroring is something that I should have done from the start, but I'm learning as I'm going.

- - - Updated - - -

By the way! How did you get the axis to line up with the normal? I've googled that question every day but never found an answer.

http://i.imgur.com/vHM1Pz3l.png

I'd suggest that instead of having a single heat-tile, you make a quad heat-tile square for the base, then you can have a bit more variety in tiles, and you avoid messing with the mesh too much.

I tried unwrapping your model myself and got a fairly good resolution on the mesh:

http://www./download/qo25440ydz9a4an/mk4-16_v2_026_047.blend

Oh! and you select Normal inside Transformation Orientation (its in the same bar where you select global or local transform/Edit mode/Viewport shading).

Link to comment
Share on other sites

  • 2 weeks later...

I've finally worked on the model some, and there are far fewer problems (separating as many parts as possible helps a lot), but my shadows are still messed up. This is best seen in the album below starting from image #5. You can open up the album and read the descriptions to see which problems I'm talking about.

How do I fix this? It seems to be a problem with smoothing edges in Blender. Importing or directly calculating in Unity doesn't change the problem.

Here's the Blender file below. If you want to play around with it and import to Unity, first join all the parts under Mk4-16 (ctrl-J), apply the mirror modifier, then remove doubles. Don't forget to NOT include the "port" part in your export.

Blender file

Javascript is disabled. View full album
Edited by ev0
Link to comment
Share on other sites

I have a theory that if you make a detailed texture with a specular map and less shininess in the material, you won't see your artifacts anymore.

When there's not much detail about shadows in the texture, the game tries to calculate them on its own from the model.

Link to comment
Share on other sites

I'll try to explain why this is happening with a picture:

I2izGEK.jpg

As for your pod, the only way I was able to somewhat solve this was to go high-poly:

qBX2ztv.jpg

Sorry to be the bearer of bad news, but there simply isn't a good way of solving this in low poly modelling.

Cutouts on flat surfaces are no problem, but on curved surfaces they are very difficult, and you should simply avoid them.

I suggest that you simply dont model those details and instead add them on the Texture. Afterall those are just 2cm indents, just add them on a normal map on a clean pod surface and the difference will be negligible.

Edited by Porkjet
Link to comment
Share on other sites

I'll try to explain why this is happening with a picture:

https://photos-4.dropbox.com/t/2/AAA3ferRbq_58kZChxs6xTuf4vce325sZ4YMDaW7SDh7NA/12/258438936/jpeg/32x32/1/_/1/2/Shading.jpg/EI2_se8BGOBDIAcoBw/T2ksWFJCHXuB5VxcvkJRPHQcB9E6B0eosk5bJRQ7Byw?size=1280x960&size_mode=2

As for your pod, the only way I was able to somewhat solve this was to go high-poly:

https://photos-5.dropbox.com/t/2/AABNOPir4qi38WzUsNQ1x29I261UMLRjwDB_mb_HLt2Qsg/12/258438936/jpeg/32x32/1/_/1/2/Pod.jpg/EI2_se8BGN9DIAcoBw/Lg9DZd448ekVN6f3YEiHLKqGGaLPEFrEbxzYavOyYGU?size=1280x960&size_mode=2

Sorry to be the bearer of bad news, but there simply isn't a good way of solving this in low poly modelling.

Cutouts on flat surfaces are no problem, but on curved surfaces they are very difficult, and you should simply avoid them.

I suggest that you simply dont model those details and instead add them on the Texture. Afterall those are just 2cm indents, just add them on a normal map on a clean pod surface and the difference will be negligible.

Yeah, I was afraid of that. Thanks for the help!! I'll try the specular map and normal map methods.

Although even depending on how you triangulate your flat surface, I've noticed that the reflectiveness/shadows seem to slightly change too. You can kind of see this around the bottom of the pod, where a few faces have an extra vertex that I plan to use to help create my texture layout.

By the way, I can't see the two images you posted. The links say they're from dropbox, are their share permissions possibly not set?

Link to comment
Share on other sites

I see, those pictures make sense. In addition, from what I've seen that it doesn't matter if there's a cutout or not, if there's a vertex or edge even on the same plane then it messes up the shading. It'd be nice if you could define which edges are part of the smoothing calculations, and which are just "along from the line".

UcUBWsel.png

LBnpmhPl.png

And when I extend the edge along the whole vertical it creates some sharp edges that stand out too much compared to the other faces. Yours looks much nicer, but maybe it's just the angle of the picture? I guess if I have to go high poly, I might have to make the whole model high poly;.;

NgMuaQ3l.png

Link to comment
Share on other sites

The shading issue on this image (http://i.imgur.com/LBnpmhPl.png) can be toned down a bit by triangulating the 5-edged polygons that where created by inserting the additional vertices. (green arrows)

You can further enhance the shading by pulling the vertices aling their normals (red arrow) so that the cross-shape of the cylinder is circular again. (red crescend)

untitled-29hu3a.png

If the vertices are on the same plane as the big face spanned by the 4 neigboring vertices you tell the shading that you *want* this vertice to be below the perfect circular surface the shading tries to emulate, so it will be not as rounded as it otherwise would be. As said, slightly pulling the vertices out a bit, should help.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...