Jump to content

[WIP] [HELP] Mk2 Cockpit Internals with insane lighting problem


Sam Hall

Recommended Posts

I've run into an extremely bizarre problem with a cockpit I've been building. Briefly: sunlight and shadow are not being projected in the correct direction in the IVA view. Here are some screenshots which illustrate the problem.

Here, the sun is visible straight ahead, yet the shadows on the floor indicate that the light source is straight up.

Vz6LJqdm.jpg

Here, the sun is visible straight up, yet the shadows on Bill's face indicate that the light source is straight ahead.

RirtQ64m.png

Here, the sun is visible out the right window, yet the shadows on the canopy indicate that the light source is shining in through the left window.

fjAKOtgm.jpg

The sunlight is being projected as though the orientation of the whole scene has been rotated weirdly. Like the Z and Y axes have been swapped, and the X axis flipped. Obviously something is extremely wrong, but looking through my project I'll be damned if I can figure out what. All transformations were zeroed out before exporting. Nothing in the scene hierarchy is set to a negative scale. Everything that needs to be visible or clickable is on layer 16. What the hell gives?

8H7zMTom.jpg

The only clue I have to go on at this point is this line from http://forum.kerbalspaceprogram.com/showthread.php/27068?p=330439&viewfull=1#post330439 :

+z is the direction of travel, +x is right, +y is the direction that's left (up in the SPH, 'back' in the VAB).

The part tools may ignore any orientation data on the object they're attached to, so ensure that is 0,0,0 and you only rotate child objects.

That's talking about external parts though. Wings, engines, fuel tanks. In my experience, IVA stuff needs to be oriented +z BACKWARD, +x LEFT and +y up. Trying to arrange the scene with +z forward just ends up with both pilot and cockpit facing the rear of the ship. Is it just supposed to be different for IVA scenery?

From tjitte's tutorial:

now add the interior models in the interion object and the exterior models in the exterior. select the interior and the exterior and add the part tools componet to them. now orientate the models corectly, with the exterior facing up, and the interior on the z axis. like so: (no image)

So KSP requires that IVA geometry be oriented "on the z axis" (global z axis? local z axis? plus z or minus z?), and external geometry with +y forward? Maybe? Guys, help. I used to think I understood to make KSP parts but this is starting to corrode my ability to think rationally. I looked at a bunch of other mod IVAs to see if they suffer from this problem and it seems like most people deal with it by just turning "cast and receive shadows" off on all geometry. I think the stock Mk1 cockpit might have its lighting misaligned too, but it's hard to tell since its window's shadow is just kind of a big indistinct rectangle.

Link to comment
Share on other sites

That looks beautiful! Can't wait for the released version (especially since only new internal we got is for Hitchhiker). And i wouldn't even mind the shadows - who needs them when we can look outside.

Link to comment
Share on other sites

That looks beautiful! Can't wait for the released version (especially since only new internal we got is for Hitchhiker). And i wouldn't even mind the shadows - who needs them when we can look outside.

Shadows IMO would be a "after test realease" priority

Link to comment
Share on other sites

Guest Aaack

From my experience on other 3d environments Z is basically up and down. From your screenshots I'm not sure if when the cockpit has a light directly from the front to the back it gets the right shadows. Also (this could be noobish, sorry, never messed with KSP) could it be that you don't have faces outside so the light source ignores any shadow projection?

Link to comment
Share on other sites

Like the others, can't help much.

I say this looks awesome, and would be happy to use it even if the shadows aren't right at first.

One comment: As this is for the inline cockpit, won't that front window be blocked most of the time? Not that that would stop me from using it.

Edit: Or does it match up with the dome thing on top?

Edited by Tw1
Link to comment
Share on other sites

Looking at the example in part tools, it seems like your internal is fine. Have you checked the position/orientation of the "internal" and "parttools_GameObject" parent nodes? If those are not centered out in pos/rot, you could have issues. Otherwise I'm not sure, it looks correct.

Link to comment
Share on other sites

Wow. Please release this, and the devs will hire you I bet.

Seriously, Nice work. I am +repping and subscribing.

Unlikely they'd hire him. I don't think they have a huge workload for their modelers right now or else Nova would probably have more to do.

And only being the most amateurish of a modeler myself, My only guess is you have an axis off somewhere.

Link to comment
Share on other sites

Okay, after staring at Unity so long that my vitreous jelly has started to curdle I have finally concluded that whatever's going on with the shadows, the problem's not with my mod. Or at least not SOLELY with my mod, as here we can see it effecting the stock MK1 cockpit:

zMqxlB2m.png

See? Sun straight ahead, shadows of the navball and other instruments straight down. I'll check around with some other people to see if they notice the same bug on their systems, but in the meantime I'm just going to disable shadows on my own cockpit and throw it up on spaceport. Enjoy!

http://kerbalspaceprogram.com/mk2cockpitinternals/

Link to comment
Share on other sites

Ahh, Z is supposed to be vertical, xy are the horizontal plane, also x looks flipped, I am unsure as to how it the game renders it, but it looks like shadows come from the corresponding axis, just try rotating the model so its aligned correctly with the modeling programs xyz.

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