Jump to content

First Part, Halp with weird shading.


Recommended Posts

So I have been learning blender and after so much learning I wanted to try DOING!

After about 15 minutes I had my part made and through some trial and error I eventually got everything to work right!

Unfortunately I have a weird shading issue.

nJgaAqJ.png

MZNOCMO.jpg

Any idea what might be causing that dark shadow?

Not that I do not like shadows but that seems like a bit much.

Link to comment
Share on other sites

Alright, what you'll need to do first of all is get Unity from here, as well as the part tools I linked previously.

Once that's done, import the pieces of your part into Unity. Drag and drop the .dae and whatever texture files you need across into the open Unity window. Now we build our part!

  1. Create an empty GameObject
    l6zn8Ru.png
  2. Ensure the GameObject is centered on zero in all three axis, you can find the Transform settings on the right-hand side of the Unity window.
    1tQGClj.png
  3. Add the KSP Part tools component to this GameObject from the components menu. This can be found as a drop down menu at the top of the window or beneath any existing components on the right hand side.
    I5ibK3L.png
  4. Now you'll want to fill in the details of your part for the exporter. These parts will then be placed inside wherever you selected Unity to use for asset storage when you first opened it. You can name the part and select what texture type you want to use.
    upGOV95.png
  5. Now drag and drop the model for your part from Assets inside the Unity window, and place them in the GameObject.
    Jdz7lZb.png
  6. Your model should have been automatically rotated in .dae export to fit "Y+ is up" layout of Unity, so you'll probably now see a -90 or 270 degree rotation in your part. This is normal. You'll also notice that your shader is likely a default Unity one.
    Vmh6nKh.png
  7. Click on the shader option, and open the KSP option. Then select the shader you wish to use, for now Diffuse is perfectly fine. Drag and drop your texture into the box, or onto the model name in the hierarchy.
    0i42OZA.png
  8. Now you'll need to add collision. Open the component menu again, and go to Physics. For a simple and small part, a box collider is okay. For now go with Mesh collider.
    zYkNxMg.png
  9. When using the mesh collider, it is very important that you set the mesh to convex. You should see the green highlight that denotes a collision mesh pop up around your model after that.
    7FMm2Zl.png
  10. Now the part is ready! Reselect your GameObject under the hierarchy and click Write on the KSP Part Tools window on the right hand side. Unity should then do something, if you get any error messages pop up just click retry on them. Go find where you told Unity to place its Assets, and within those folders should be one called Parts, and inside that should be your part, all wrapped up nicely waiting to be used. Copy them into your KSP install, add your .cfg and you should be ready to go.

There is an alternative method to generating a collision mesh for more complex parts that I've gone over here.

Link to comment
Share on other sites

Why do I have to switch and learn unity to fix a shadow problem.

My model works, it has fuel, it has collisions, it has attachments in the right places and side attaches well.

I just think the shadow is off on it.

And I am asking for advice on how to tweak it.

I am working with blender to further my goals and unity / javascript / c# is not a part of those goals.

Edited by Spider0804
Link to comment
Share on other sites

If you look at stages 6 and 7, if you just directly add the .dae and texture folders to KSP, it will automatically default the shadows to Unity defaults. KSP uses slightly different shading that you need to set up in Unity. If you want to set up anything more advanced using textures, those will also need to be done through Unity. That includes normal mapped shading, emissive textures and translucent textures.

If you want to do almost anything more advanced than resource stores you will also need to add those in Unity. Things like engines, lights, jet intakes, wheels, docking ports, airlocks and solar panels are some examples.

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...