Jump to content

Which shader to use? Brightness issue


Recommended Posts

I'm making a couple parts that are re-using stock textures.  I've been struggling with the shaders for a couple days and I cannot get them to work right.

So, which shader should I use?  If I use anything specular the part looks shiny regardless of what the shininess slider is at.  So I've tried diffuse, alpha/cutoff, lightwrapped,unlit(that definitely didn't work), even some legacy unity shaders.  If I use the standard shader in Unity, the part doesn't load into the game.

This is the best I can get.  Seems pretty close in the VAB, but once I get to flight it's much lighter than the stock capsule.

screenshot12.png
screenshot13.png

Texture is being applied by replacing a placeholder png by using:


    MODEL
    {
        texture = PHpod25, Squad/Parts/Command/Mk1-3Pod/M1-3 Pod
    }

What shader/settings should I be using for something like this?  I'm running into this problem with all the parts I'm making.

Let me know if I need to provide any more information.  Thanks.

Link to comment
Share on other sites

3 hours ago, Geonovast said:

What shader/settings should I be using for something like this?  I'm running into this problem with all the parts I'm making.

The actual M1-3 pod is set up to use the KSP/Emissive/Diffuse texture. If you look in it's folder you will see that there is a second texture pic called. M1-3 Pod_GLOW.dds If you set your model to use the same shader and make sure you direct your model to use both textures then it should come out right.

Using that shader and forgetting the emissive texture usually makes for an even brighter model because the emissive applies the darkness to the parts of the model that shouldn't light up. It has been a while since I have directed to other textures, but assuming you are set to the same shader as the pod and none of your UV map is over the bits that are meant to light up. Try this.

    MODEL
    {
        texture = PHpod25, Squad/Parts/Command/Mk1-3Pod/M1-3 Pod
        texture = PHpod25, Squad/Parts/Command/Mk1-3Pod/M1-3 Pod_GLOW
    }

Hope that works.

 

 

Link to comment
Share on other sites

Thanks @ColdJ

I changed it to Emissive/Diffuse, Added a glow placeholder and directed it to the original texture, but unfortunately I still have the exact same issue.  Looks dead on in the VAB but still much brighter in flight.

Link to comment
Share on other sites

7 hours ago, Geonovast said:

Thanks @ColdJ

I changed it to Emissive/Diffuse, Added a glow placeholder and directed it to the original texture, but unfortunately I still have the exact same issue.  Looks dead on in the VAB but still much brighter in flight.

As your part looks to have nothing to light up. Try making your own emissive texture, set it in your model as the emissive, put in the same folder as your config and just make it a completely black pic. Obviously remove the line for the texture in your config so that it looks only in the folder it is in. This should hopefully darken the underlying surface. An emissive is basically like a base coat with the main texture overlayed on top. If that still doesn't do it then copy the original texture into your folder and edit it in a paint program to be darker, start off with about 10% darker and see how it goes. Again remove the texture redirect in the config. As long as you change something (doesn't have to be much) from the original it can be considered a new asset. Experiment till you get the effect you want.

One other question: Is your emissive in your model set up named differently than your main texture? If so did you remember to edit the texture redirect to make sure that that is what was being replaced? You will want the emissive to be named something other than your main texture.

Edited by ColdJ
Link to comment
Share on other sites

Just using a plain black texture made no difference.

And yes, had a separate placeholder texture for it in the config.

    MODEL
    {
        texture = PHpod25, Squad/Parts/Command/Mk1-3Pod/M1-3 Pod
        texture = PHpod25_G, Squad/Parts/Command/Mk1-3Pod/M1-3 Pod_GLOW
    }

The placeholder textures have just been all black, so I commented out the second texture line and it's made no difference.

Is there some default value the _Color parameter in the shader should be at?  I've tried adjusting it to various levels of grey, and I can get it to look ok-ish in flight, but then of course it's too dark in the editor.

Also, I've noticed that when I first bring the model into unity, it has an (uneditable) standard shader applied that makes the whole thing look slightly darker.  When I port that to the game, the part doesn't load.  So I have to drag the texture from the unity assets onto the part in order to muck around with the shader in the first place, and when I do it instantly gets lighter.

I'm starting to think there's some fundamental step in this process I'm missing.

Link to comment
Share on other sites

I've gone back to just diffuse and set the _Color value to RGB(195,195,195) and it seems to be a happy medium. 

Looks more like a direction lighting thing in the VAB now.  If I stick another pod upside down under it, it matches that one, and if I rotate the part to get the same-ish lighting as the first pod, it's a lot closer.

Although if anyone knows the _Color value that the stock pods use, I would appreciate it.

screenshot14.png

Link to comment
Share on other sites

9 hours ago, Geonovast said:

Is there some default value the _Color parameter in the shader should be at?  I've tried adjusting it to various levels of grey, and I can get it to look ok-ish in flight, but then of course it's too dark in the editor.

If it looks ok in flight then that is what you were going for.

I work in a blender environment so can't help with unity/part tools.

The colours all seem to be in the centre , basically white, The main texture near full brightness and the emissive near full darkness.

Set at 1 for opacity and emissive and set at 0 for shininess and gloss. There are things like Rim Colour and temperature colour and burn colour, but I haven't learnt what they mean as yet.

In my enviroment you can set your part to use exactly the same material setup as the original, don't know if that would do the trick or not.

Link to comment
Share on other sites

5 minutes ago, ColdJ said:

so you just need to apply the original material setup to your model

Can you be more specific?

I don't know what you mean by original material setup.  The only material settings I messed with at all in Blender was just to see how the UV mapping turned out.

Link to comment
Share on other sites

On 5/2/2022 at 11:23 PM, Geonovast said:

Can you be more specific?

I don't know what you mean by original material setup.  The only material settings I messed with at all in Blender was just to see how the UV mapping turned out.

Sorry, wasn't on for 24 hours.

Ok, so in the blender environment. (I say this because I use a fork of it called BforArtists2 version 2.70, which is the equivalent of blender 2.93 alpha.) Using the .mu plugin.

Here is a pic showing the Mk1-3 pod imported in, you will notice on the right hand side I have clicked on the materials icon to bring up that section (in mine that is a brown, yellow and white pie chart.) The materials name it was given by it's author is "Mk1-3 Pod". That material name is the collection of all the shader settings used for the main pod. It also has a material setup called "no name" which is used for the flag mesh that is used in game so that you can change flags. In the second pic I have also imported another model into the same work area. It has the material name "octo". Now in the second pic you will see that there are 3 materials available because each model imported into the same work session, makes it's material setup available for use. I could click on the The material setup in the drop down for the Mk1-3 pod while having the Octo model highlighted and that would change that model to use the Mk1-3 Pod's material set up. Now of course it will be pointed to the texture files that the Mk1-3 pod uses, but you can go further down and change the name that the material looks for for it's texture pics, you can even edit the material name in that area shown in the pic and it will still retain all the colour, shininess etc settings from that material setup.

So if you are able to use blender with the .mu plugin. You can use this method to give your model the materials set up from the pod. My thread in this same section has all the links needed to set it up.

tPdSjgK.jpgglOWomm.jpg

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