Jump to content

Big bad bumps :(


Recommended Posts

I just got my second ship into KSP and this time I thought I'd try using a bump map. It looks terrible.

Here's the ship without a bump map. The texture needs some improvment, but it's servicable.

BB67F301A6676F43D16A6EE68947D402117BB6F4

This is the same area with a bumpmap applied in Unity.

346F8CC30553ECB6687BDBACB30DB0D88D19E799

The bumpmap was made with the same texture that made the lines on the hull. The idea was that they'd have a slight indent. I used a medium grey color (128v) for the basecoat on the bumpmap. The lines were pure black, but after a few attempts to tone it down I lowered the opacity for them till theres very little contrast between the base and lines. It still looks like crap in KSP.

When I import the bumpmap into unity, the first time I try to use it I get a message saying it's not marked as a normal map and do I want to fix it. I do and it looks fine in Unity, but when I get it into KSP I get this mess.

I've played with the bumpiness in unity and it changes there, but even if I set it at a super low value before I write the KSP part, it still has the same depth.

Is there perhaps something else I need to do in unity to lock the new bump settings to the object before I write the object with parttools? The amount of bump shown in KSP is more than the maximum bump setting shows me in unity. When I turn it down so it looks good in Unity, I assume that's what it's going to save for KSP. That doesn't seem to be the case.

The other thing is that the normal map isn't working the way I intended my bump map to look. The black line in the upper picture is supposed to be a slight indent into the surface where the hull plate meets the frame. Yet the right edge of the vertical line looks like it's got a raised lip. You see the same thing above and to the right of the door.

Should I be choosing NOT to convert the bump image to a normal map?

Anyone got any advice on how to fix my bumpmaps or able to point me to a decent tutorial?

Link to comment
Share on other sites

First of all, I recommend that you use 1024 resolution textures (including UV island maps exported from your 3D editor (like Blender). Always use a solid color background layer (I usually use black) in your image editor (like Gimp). Sometimes the UV unwraps will produce a line with a jag in it instead of a straight line in one or more islands. Not sure why this is but its a pain and you may need to rotate your model a little and try unwrapping again. (I'm too lazy to do that but its something I've been tempted to do, even though my models are perfectly aligned with respect to grids and degrees.) Also try zooming in on your layers and fixing pixels which look wrong (jaggy or otherwise out of place). Come to think of it, you might want to work in higher resolutions and then sample down to 1024. I've not tried that. Instead of applying bumps in Unity (which I have done), I've also been applying bump filters in Gimp and then just using a non bump KSP shader in Unity. I haven't experimented between choosing normal or not, but you could try both and compare. Unity does seem to like blowing imperfections right out of proportion.

Link to comment
Share on other sites

I'm actually using 1024 res textures. It's the lowest choice in Wings 3d. The hatch is a fairly small part of the texture, butI don't think the resolution is the problem though in spite of how bad it looks around the door. It looks good as a bumpmap in Unity. It's turned down so it's subtle enough that you only really see it as a break in a specular highlight. Like the depth of the indent is about half of the width of one of the lines in the upper image.

It's not untill I export it to KSP that it looks WAY overdone like in the lower image.

I am using a solid color for the background. I use a medium gray so I can go lighter for a bump coming out from the surface and darker for an indent into the surface. I started with pure black lines but later dropped the contrast to try to get to to look better in KSP. I took a closer look at the bump texture over a high contrast background and it needs some cleanup. I took a lot of time tweaking the UV's in wings so I'd have all straight lines, but it looks like a couple were't quite perfect. I wish there was a snap to grid in the UV editor in Wings. It looks like photoshop may have tried to antialias a couple of lines and that may be what's causing the raised edge. Still does't explain what's causing it to be amplified so much from what Unity is showing.

Link to comment
Share on other sites

It looks like compression artifacts in the normal map texture, what image type are you using for the normal map texture file?

If you're currently using a compressed image type, try it with PNG. While this will load slower (until 0.22/Unity4.2 fixes) it might fix your issue?

Link to comment
Share on other sites

I use PNG non-interlaced to go from photoshop to Unity. I'm saving from unity as MBM. I thing I might have to try TGA and just re-edit the normal map after unity saves it with the KSP object.

I still haven't figured out why is amplified so much from what I'm seeing in Unity. This is probably 10 to 20 times as much bump as I'm seeing in Unity.

I may try clearing everything out and starting from scratch. I could rebuild the scene faster than finding the problem if it's a glitch in Unity.

Link to comment
Share on other sites

I just got my second ship into KSP and this time I thought I'd try using a bump map. It looks terrible.

Here's the ship without a bump map. The texture needs some improvment, but it's servicable.

BB67F301A6676F43D16A6EE68947D402117BB6F4

This is the same area with a bumpmap applied in Unity.

346F8CC30553ECB6687BDBACB30DB0D88D19E799

The bumpmap was made with the same texture that made the lines on the hull. The idea was that they'd have a slight indent. I used a medium grey color (128v) for the basecoat on the bumpmap. The lines were pure black, but after a few attempts to tone it down I lowered the opacity for them till theres very little contrast between the base and lines. It still looks like crap in KSP.

When I import the bumpmap into unity, the first time I try to use it I get a message saying it's not marked as a normal map and do I want to fix it. I do and it looks fine in Unity, but when I get it into KSP I get this mess.

I've played with the bumpiness in unity and it changes there, but even if I set it at a super low value before I write the KSP part, it still has the same depth.

Is there perhaps something else I need to do in unity to lock the new bump settings to the object before I write the object with parttools? The amount of bump shown in KSP is more than the maximum bump setting shows me in unity. When I turn it down so it looks good in Unity, I assume that's what it's going to save for KSP. That doesn't seem to be the case.

The other thing is that the normal map isn't working the way I intended my bump map to look. The black line in the upper picture is supposed to be a slight indent into the surface where the hull plate meets the frame. Yet the right edge of the vertical line looks like it's got a raised lip. You see the same thing above and to the right of the door.

Should I be choosing NOT to convert the bump image to a normal map?

Anyone got any advice on how to fix my bumpmaps or able to point me to a decent tutorial?

I'm not sure if you got this solved or not yet. but for future reference a bump map is not the same as a normal map. while a bump map is simply a greyscale image to show height off a surface, a normal map is an RGB image, normal maps look quite purple when you look at them.

there are programs that will convert a bump map to a normal map, I think xNormal64 is a free one that does it.

as far as the artifacts around the door, to me that looks like JPG artifacting from a highly compressed JPG, that may be unity causing that in the conversion, alternately look at your bump map and see if there's similar artifacts in that. You siad you use PNG and then unity saves as MBM, I've been using PNG and saving as TGA compressed, and I haven't had any sort problems so far. In the end it may just be a result of unity trying to interpret a greyscale image as a normal map.

Link to comment
Share on other sites

I didn't manage to find a solution yet. I just went on to other things while looking for the solution. The artifacts around the door are partly the fault of the bump map, but Unity is what's making them look like a mess when it writes the image. It amplifies the bump effect many times when writing the KSP object. I've tried outputing from unity in MBM, TGA, and PNG and I get the same result every time.

The thing that bugs me is that it looks good in Unity and it's not saving what I'm seeing.

I did realize that bump maps and normal maps are different. As I understand it, bump maps only show height while normal maps show height as well as a simulated angle for surface features. What I haven't figured out yet is what the actual colors mean to hand paint one. A lot of white in a bump map translates to a lot of yellow in a normal map. Darker colors show up as more purple. But how to hand make one in Photoshop is something I haven't figured out yet.

Because normal maps seem to need multiple pixels to do what a bump map is able to do in a single pixel line, it seems like normal maps would be unsuitable for fine mechanical detail and more useful for organic or more random textures. I've also tried raising the resolution of the maps to 2000 pixels square and it looks just as bad as 1000 pixel images when Unity writes them.

I'll try the conversion program you mentioned, and I've also heard of a photoshop plugin that does the same thing. Perhaps I can just replace the faulty map that Unity is writing.

Link to comment
Share on other sites

here's some info on bringing in a greyscale image and having it work as a normal map, you have to specify some conversion settings in the texture importer

http://docs.unity3d.com/Documentation/Manual/HOWTO-bumpmap.html

is that the process you're going through?

I'd never used the conversion of bump to normal in xNormal before so I thought I'd give it a try, I used the Height Map to Normal Map option in the tool section. The bump was a medium grey with some black lines for indents and some white lines for raised detail. you can see the result of the normal map generation. I wouldn't expect white areas to be coming out yellow unless they're defining a detail at a strange angle to the surface.

nrmlmapexample.png

I've yet to try this workflow in unity/KSP but from what I've seen previously in other normal maps I've done, putting this normal map into the bump texture slot of a KSP material would give a reasonable result.

Edited by Ohfive30
grammar
Link to comment
Share on other sites

You were just a gigantic help.

While composing a long and detailed reply on exactly what I've been doing with my bumpmap I stumbled across the solution. Normal maps seem to need more pixels to work. I assumed that the imagemaps written for KPS would be the same size as I loaded into Unity. They're not. There's a maximum size setting in the bumpmap inspector window. The heading of the window says import settings so I thought that was the maximum size that it would bring them into unity as. In fact, in the link you sent me to it's the field right under the words "Texture importer"

That turns out to be the size that Unity writes for KSP models. By turning this up to 2048 for the bump/normal image I got the samed results in KSP as I was seeing in Unity.

So, problem solved and I can move onto the next issue. :)

Link to comment
Share on other sites

  • 5 months later...

Thanks a lot for this thread! I've always understood the theory behind normal maps but never understood how to make them work. Now I do. :)

My first try at making a panel by normal map worked out okay. However, I noticed that the "gap" between panels are quite subtle. I can only tell that it's there because I know it's supposed to be but a casual observer probably cant tell the difference between the normally mapped texture and a plain one.

I am using a 2048x map as suggested above but I am not really sure how big to make the "gap". At the moment its only 3 pixels wide which, in retrospect, is quite tiny. I will, of course, experiment on my own to find something that works for me but I was wondering if there was a "best practice" or "rule of thumb" people have come up with when it comes to good execution of a normal map? Any tips?

(Sorry to bring back a relatively old thread but it's a good one and deserves more discussion.)

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