Jump to content

Some questions about best practices, and one or two more :)


Recommended Posts

EDIT: I've mostly answered my own questions with an awful lot of googling, but I'll still take any insights people offer. :)

Hey all, I've been working on a parts pack, but I came into this completely cold, learning Blender over the past week or so. I think I have a pretty good handle on what I'm doing, but it does leave me some questions about what the community considers to be best practices:

1. Polygon/Triangle count in the visual model, and the collision mesh. The parts I'm making are not ridiculously complex, but sometimes a really smooth curvature looks great and makes me want to use more vertices. I'm aiming to stick to the standard 24-vertex circles for things like fuel tanks. As an example, I made a small radial fuel tank (similar to the longer radial monopropellant tank in stock), and it ended up with something like 1072 tris in the model, and about 164 or so in the collision mesh (I spent a bit of time simplifying the collision mesh as best I could). The visible curvature is gorgeous, so I've left it that way for now, figuring we're not taxing most people's GPUs to the degree we're hitting the CPU. But most of my other models have stayed simpler, and most of my collision meshes are just a cylinder or truncated cone that matches the exterior of the model. Do any of you use a rule of thumb for how many polygons is acceptable? I'm assuming more complex collision meshes can impact physics performance? EDIT: I see the tutorial thread says 255 as a limit in collision mesh. I'm under that in everything I've made so far.

2. Collision mesh alignment. The stock fuel tanks clearly have the model oriented to place edges in the N/E/W/S cardinal directions, but what do they do with the collision mesh? I saw in another thread, someone commenting that it's preferable to have the faces on those sides, rather than edges. In a typical 24-face cylinder, would you aim the model's edges in those directions (to match stock), but turn the collision mesh to put the faces on those sides? EDIT: I found it mentioned elsewhere that the stock collision meshes for fuel tanks and the like are 12-sided. Experimentally I confirmed this, and confirmed that they are rotated relative to the model so that the faces, not the edges, are aligned to the cardinal map directions.

3. Models with negative space. If your model has some visible space inside it, are you bothering to use multiple collision meshes, or any other trickery to simulate concave spaces? I've just been making the collision meshes conform to the exterior, and so if there's an opening somewhere, it's treated in the editor as a solid surface. An example is this wide-open interstage adapter, where right now the collision mesh is a truncated cone that matches the exterior edges on the sides. It fills in the top and bottom accordingly, and also does not include a cylinder for that upper cylindrical section. Just wondering what's best here. EDIT: Yeah, I see in other threads people are using multiple colliders. Just not sure what's best for a somewhat empty cone, for example.

And one not related to "best practices":

4. I'm looking at the small Z-100 radial battery, and it's glowing LED on top. How do you do that in the texture? I opened up the MBM, and all I can see that doesn't conform to the rest of the battery pack is a large splotchy white area. No alpha channel or anything. I'd love to have some lit-up features. :) Is this something I need to do in Unity rather than in Blender before importing? Note, I'm talking about a self-luminous, glowing detail, not an actual light emissive. EDIT: OK, I guess technically that's still referred to as an emissive. Found this thread.

Edited by NecroBones
Link to comment
Share on other sites

I really like the Z-100 battery's green LED. I sometimes place them just for looks. I too don't know how that effect is achieved, but it would be nice to know.

As for collision meshes, my KSP Blender models are so simple that I let Unity give my outer mesh its collision properties (I don't make a separate one in Blender).

I've not been too concerned about poly counts. The reason for this is that with my whopping 2 gigs of RAM, KSP seldom crashes or lags on me. When that does occur, I think its due to a large (stock) part count while using KER; and usually in the VAB. I think you can optimize in Blender if triangle count is a concern.

I'm sure others will pop in with good advice. Keep up the good work.

(I'll eventually add some more fueled adapters and make them available at Curse.)

Link to comment
Share on other sites

Light like the z100 may just have an emissive texture + KSP/Eimissive/something material in unity, eventually a small point light which will be always ON.

Models SHOULD use more vertices/triangles as stock, as GPU wait most of the time the poor enslaved CPU (thank to single threaded physics from unity).

Why making an ugly, (very) old school 24 sides cylinder when you can made a 32/48 sides one ?

Search for High Poly Test Object there to see the result of using a lot of tri with a few physics instead of lot's of little polys with lot's of physics.

Concave space is up to you if you want to allow "open spaces" or not. Yo get it, you need to create as much as colliders as needed but here, complexity REALLY MATTERS, as 3-6 colliders for one part is ok (but may not be so ok if this parts is used multiple time like seen with the stock Claw issue not so long ago with 8 of them at the same time). I tried 16 colliders on one part... KSP don't like it that's much (huge slowdown already in VAB/SPH).

In fact here, it looks like Unity has been designed to make minecraft type game because when you read colliders' definition, they succeed to make colliders which don't collide at all (if not convex) ! Amazing, isn't it ? Why making collider, that don't collide :huh: ?

Link to comment
Share on other sites

I really like the Z-100 battery's green LED. I sometimes place them just for looks. I too don't know how that effect is achieved, but it would be nice to know.

Yeah, I'm really not sure how this one is done in particular. It can probably be done with the emissives, but the Z-100 doesn't have a separate texture file.

Link to comment
Share on other sites

Because the z-100 "light" is not one, it's just bright yellow/orange colour. MJ case use a light.

Well right, it doesn't emit light that illuminates other objects. However, it's not just a bright green texture. For comparison, if you look at the green "light" on the large (2.5m) stackable battery, that one is just a green texture. In the dark, it gets dark. However the Z-100 is self-luminous, and is always a bright green, no matter how dark your environment is. It appears to be a true emissive, along the lines of engine heat glow, but it doesn't have a second texture file (like you'd expect for adding emissives).

Link to comment
Share on other sites

you dn't have to use a 2nd map for emissive, any texture will work. the light on z100 is likely a separate mesh with emissive shader using the same diffuse map; while the rest of the battery uses standard ksp diffuse shader

Ah good point, I was over-thinking it. I think you're right! I'll try to re-create that in another part.

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