Jump to content

emissive/specular shader


Recommended Posts

I'm having some trouble understanding how to use this shader.

I've read through the "How do textures work in KSP" guide and it makes sense, but I must be missing something about how to apply what it says. The way I understand it, the specularity is controlled by the alpha channel of the diffuse texture.

When I use this shader, the parts I export from unity appear to be VERY shiny, no matter what I do. I tried setting the transparency of the diffuse texture all the way down to 2% in GIMP and the model still reflects a lot of light. Setting it much higher than that and it gets extremely shiny, blindingly so.

Playing with the "specular color" and "shininess" settings in unity haven't revealed much to me.

Am I understanding things right?

Link to comment
Share on other sites

I'm not sure exactly how much shader control one actually has over KSP shaders, other than simply the selection of shader in the first place. I recommend experimenting with the various shaders as well as the tweaking you are attempting within a shader.

If you grab my parts (see sig line) and try them out in KSP, you will see that my opaque parts are quite shiny; the shader used for those is Specular. That is after trying to water down the settings. But on these parts I wanted a little contrast to the relatively drab stock parts. I've not done much with Emissive so I have no ideas on that.

Link to comment
Share on other sites

I used emissive because I wanted an engine heat animation. I also wanted to have a normal map, but to get that you have to chose emissive bumped specular.

I was looking at one of the engines in the NovaPunch2 pack (the 5m Bearcat x5) and it has 3 textures in its parts folder. One is the diffuse texture, one is the emissive map and one is the bump map. So I am assuming it uses this same shader. I cant see that it does anything different from what I've done, but it does not share the awful shininess. I have no idea what the shader settings that were used in unity by that author, though.

Link to comment
Share on other sites

It's some sort of wizardry by frizzank, and I haven't figured out how to do it yet.

For my own work, when I used the Emissve Bumped Spec shader, it comes out like this:

EYPBlk9.png

But it looks more severe in Unity than when rendered in KSP.

And this is the settings on the material itself:

(thats the nozzle object material, the upper section is regular bumped spec and they look the same)

xWKMPbq.png

So I have the slider set to almost zero to make it tolerable, but I know I am missing something.

One thing; you did click on your normal map image and set it to be a normal map and not a texture (and uncheck create from greyscale) - if its not, the shading gets really borked.

Edit: You can also try saving the diffuse without an Alpha channel at all, that should in theory switch off specularity "augmentation" from the diffuse and it should be uniform across the model just from the shader/slider. The diffuse for the engine above is a PNG with no Alpha channel

Edited by Tiberion
Link to comment
Share on other sites

Thanks for the info Tiberion. The normal map is marked as such. "Create from Grayscale" is unchecked.

My model is composed of several sub-models (?). I tried setting the top portion that does not need the emissive effect to use the "bumped" shader, but it still appears the same.

I'll try saving the diffuse without an alpha channel.

Link to comment
Share on other sites

That didn't seem to make any difference. I also tried resetting the shader for every object to simply "diffuse" and it still looked the same. So now I am thinking I've done something fundamentally wrong, somewhere. Or else it in fact looks the way it is supposed to look, given the textures I've created. I'll try getting some screenshots up later.

Link to comment
Share on other sites

I went back and examined the textures that were in the NovaPunch pack. I think one thing I have done "wrong" is use white as the basic color of my part. The colors that appear white on the 5m x 12m fuel tank, for instance are really light gray. Changing my part to use that color helped tone it down some. But it still seems crazy bright.

Link to comment
Share on other sites

Here is a picture of my part with the 5m x12m fuel tank stacked on top of it. The brilliant white color shown on my part is actually the exact same color used in the white areas of the texture for the NovaPunch tank.

bright_white.png

Link to comment
Share on other sites

Hmm, I think I know your issue.

What program do you model in? It appears that your entire part is in the same smoothing group, and KSP thinks its facing directly up towards the VAB lighting source, which is why its washed out completely.

if you use blender, you should do an edge split modifier (On the right side, select the tab with the wrench icon, select edge split. Adjust the angle until all of your hard edges appear shaded properly and then hit apply from Object mode) This actually unlinks the pieces of your mesh into different surfaces so lighting can be applied to them separately. The UVmap is unaffected, but you can reverse the operation by going to Edit mode -> Mesh -> Vertices -> Remove Doubles

If you use Max, I can't be of much help, about all I know is you can add polys to 'smoothing groups' to set up individual shading areas in a similar way.

Link to comment
Share on other sites

Thanks, Tiberion. I do use blender and I seem to remember doing that modifier as I was working through some tutorials a while back. I'm certain I have NOT done it for this model. I'll give it a shot later today and report back.

Link to comment
Share on other sites

Use the KSP/Emissive/Bumped Specular.

Make sure your normal map is using Y up. Your normal map should not look like its inverted.

To test this make a simple black and white height map and select it as the normal map. Then it the height maps texture properties select normal map for the texture type and convert from grey scale. Then click apply.

Setting the specular color to Black in unity should remove all the specular highlights in the preview window.

This is the intensity of your specularity, how bright your hotspot is.

The shininess controls the spread of the hotspot. This simulates a shiny surface or a dull one.

The alpha channel of the diffuse only controls the intensity of the spec map black is 0 and white is full on bright. The specular color overrides this value.

Link to comment
Share on other sites

Thanks to all who helped! I think that splitting the edges was what worked. I say "think" because I wound up having to start over (long story) and that is what I did different. And then I wound up starting over again. I've got new questions but I'll start another thread.

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