Jump to content

Problem with shadows in Unity


Recommended Posts

Help. (Again, I\'m sorry). Finally, I\'ve gotten the hang of texturing (albeit cumbersome, because blender insists on having retarded gradients on the UV map outlines). Now I\'ve finalised the model of my 1m tank and I\'m mostly fine with the texture. However...

I\'m using Unity now, simply because I don\'t have to combine all the objects\' UV maps into one texture file; it makes my life easier. But back on topic: My shadows are slanted, instead of being parallel to the ground (in reference to the SH; in the VAB it is also slanted).

Pictures:

This is in Unity; I had to shift my view around because it appears that when looking head-on, I cannot see the shadow. But you can see that the problem lies with Unity.

7356614938

This is in the Spaceplane Hanger; Clearly the shadow is not in line with the stock tank.

7356614814

This is in the VAB. The same effect as above is also observed.

7171400941

It doesn\'t happen when I use the old DAE importer method.

I can\'t trace the problem; I\'ve removed all the unnecessary objects from my scene. The Blender camera and lamp, and the Unity Main Camera and Light.

What?

Link to comment
Share on other sites

Whoops. Sorry, rightclick -> new tab. Flickr is like that.

Ok. Hmm. I\'m getting similar shading bugs like this as well. My parts usually end up way too shiny in the editor preview. Fine everywhere else though.

Link to comment
Share on other sites

Bump.

Here\'s a more detailed explanation of the problem:

With the stock tank, when I stack 2 of them, the shadow is always parallel to the tank; not the ground. When it\'s not lit, the light simply fades away.

However, with my tanks, the shadow is drawn at an angle; the light side is facing the sun, however it is offset by about 20 degrees. The biggest problem is that the shadows are drawn separately on 2 tanks; meaning the shadows don\'t form a line, which look really bad.

Now for the second, and worst problem by far:

MY PARTS EXPLODE ON THE LAUNCHPAD!!!11!!!!!!!111!!!1!11

Yea. All the parts, both tanks and my engine. I don\'t see why; I\'ve tried setting the crash resistance to 100000. I\'ve tried putting just a command pod above my parts. Nothing. They. Always. Explode.

All my parts have a node_collider; all those node_colliders have a Mesh Collider component assigned to them inside Unity. I\'ve even tried assigned individual objects their own colliders. (I don\'t join them)

Someone doesn\'t want me making parts for KSP.

Also the inside of my engine nozzle is transparent; I think a recalculate normals will fix it.

But the explosions. I have all 3 .blend files attached, as well as the unity scene.

Link to comment
Share on other sites

Bump.

Here\'s a more detailed explanation of the problem:

With the stock tank, when I stack 2 of them, the shadow is always parallel to the tank; not the ground. When it\'s not lit, the light simply fades away.

However, with my tanks, the shadow is drawn at an angle; the light side is facing the sun, however it is offset by about 20 degrees. The biggest problem is that the shadows are drawn separately on 2 tanks; meaning the shadows don\'t form a line, which look really bad.

Now for the second, and worst problem by far:

MY PARTS EXPLODE ON THE LAUNCHPAD!!!11!!!!!!!111!!!1!11

Yea. All the parts, both tanks and my engine. I don\'t see why; I\'ve tried setting the crash resistance to 100000. I\'ve tried putting just a command pod above my parts. Nothing. They. Always. Explode.

All my parts have a node_collider; all those node_colliders have a Mesh Collider component assigned to them inside Unity. I\'ve even tried assigned individual objects their own colliders. (I don\'t join them)

Someone doesn\'t want me making parts for KSP.

Also the inside of my engine nozzle is transparent; I think a recalculate normals will fix it.

But the explosions. I have all 3 .blend files attached, as well as the unity scene.

This is either a problem with your model, or the fact you have two node colliders. Make sure your engines and fuel tanks are centered. You don\'t want them below or above the grid. Also, with the new mesh colliders in unity, you don\'t need a node collider, so remove that and make a collider directly from the mesh. Hope I helped. I love your parts btw. :)

Link to comment
Share on other sites

Bump.

Here\'s a more detailed explanation of the problem:

With the stock tank, when I stack 2 of them, the shadow is always parallel to the tank; not the ground. When it\'s not lit, the light simply fades away.

However, with my tanks, the shadow is drawn at an angle; the light side is facing the sun, however it is offset by about 20 degrees. The biggest problem is that the shadows are drawn separately on 2 tanks; meaning the shadows don\'t form a line, which look really bad.

Do you mean the shadow of the tanks projected to the ground ? Could you post a picture? Your 'shadow problem' might simply be bad smoothing...

Maraz

Link to comment
Share on other sites

Yes, it is bad smoothing.

I don\'t know Blender, but there should be a split edge modifier somewhere.

Maraz

Damn it sure fixed the problem. Thanks so much. For some reason when Nut007 asked me to do that same thing, it didn\'t seem to have any effect. Maybe I did it wrong, but I dunno. Either way, thanks so much for your help, now to RULE THE WORLD!

Link to comment
Share on other sites

Dammit, I forgot what options I used. What are the options needed to get that model working properly?

I just select all, Modifiers > Edge Split > Apply.

I don\'t know which boxes to check; it worked for one of them but not for this one. I don\'t know what I did exactly...

Also those stupid UV maps. Why can\'t blender just export a damned SOLID LINE??? Cheetah3D can do it, just that it sucks. I don\'t understand the design decision to make the lines have retarded gradients.

Link to comment
Share on other sites

Fixed OP\'s images. Reposting.

Help. (Again, I\'m sorry). Finally, I\'ve gotten the hang of texturing (albeit cumbersome, because blender insists on having retarded gradients on the UV map outlines). Now I\'ve finalised the model of my 1m tank and I\'m mostly fine with the texture. However...

I\'m using Unity now, simply because I don\'t have to combine all the objects\' UV maps into one texture file; it makes my life easier. But back on topic: My shadows are slanted, instead of being parallel to the ground (in reference to the SH; in the VAB it is also slanted).

Pictures:

This is in Unity; I had to shift my view around because it appears that when looking head-on, I cannot see the shadow. But you can see that the problem lies with Unity.

7356614938_98b123d670.jpg

This is in the Spaceplane Hanger; Clearly the shadow is not in line with the stock tank.

7356614814_1a7ba7a78e_z.jpg

This is in the VAB. The same effect as above is also observed.

7171400941_fd85042187.jpg

It doesn\'t happen when I use the old DAE importer method.

I can\'t trace the problem; I\'ve removed all the unnecessary objects from my scene. The Blender camera and lamp, and the Unity Main Camera and Light.

What?

Link to comment
Share on other sites

  • 4 weeks later...
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...