Jump to content

[HELP] KSP alpha transparency


Recommended Posts

Hi, I noticed that in Unity, for the KSP/Alpha texture options, there is one called "translucent". Does anyone know how this one works exactly? I tried it with a alpha map and this is the result in game:

8Mnus1r.png

Only the glass panel parts are the places with alpha transparency, and every where else has 255, 255, 255 in the alpha map. Does anyone know what other parts of the texture is also translucent, and how I can fix this so that only the glass parts are? Thanks!

***EDIT: Sorry, I mean the alpha channel, I forgot what it was called... :P

Edited by CoffeeSE
Link to comment
Share on other sites

I cannot assure you that this is the best way, but usually I have two different game objects. Separate the frame from the glass. Set the frame to diffuse, and the glass to translucent. You can get it to work as a single object, but I consistently have issues.

Link to comment
Share on other sites

Hi, I noticed that in Unity, for the KSP/Alpha texture options, there is one called "translucent". Does anyone know how this one works exactly? I tried it with a alpha map and this is the result in game:

Only the glass panel parts are the places with alpha transparency, and every where else has 255, 255, 255 in the alpha map. Does anyone know what other parts of the texture is also translucent, and how I can fix this so that only the glass parts are? Thanks!

You don't use an alpha map with this shader. It uses the alpha channel of the main texture to do the blending

Link to comment
Share on other sites

Also if your not having any subtle variation in your alpha map (just black and white) use the cutout shader. It is cheaper and will work better. For crisper lines, click on your texture in unity and in the property box change it from compressed to true color. Your file size will be larger but for something that is real close to the camera it is justified.

Link to comment
Share on other sites

Did you set the alpha channel right when you imported the texture to Unity? It sounds like your texture has an alpha channel, so you want to set "alpha is transparent", it looks like you might have it set to "alpha from greyscale".

The translucent shader allows for varying degrees of transparency based on the alpha level, the cutoff sets everything above a certain alpha level as completely clear. Either way, you need to tell Unity the correct source of the alpha channel.

Link to comment
Share on other sites

I cannot assure you that this is the best way, but usually I have two different game objects. Separate the frame from the glass. Set the frame to diffuse, and the glass to translucent. You can get it to work as a single object, but I consistently have issues.

Thank you! I did not know I could do that...

Link to comment
Share on other sites

  • 10 months later...
Why are you being so reticent?

I was referring to the last post, about having two different game objects. Though I fixed it myself by having two meshes/objects within a single GameObject. The only downside I see so far is that it also means having two textures, as I do not know how to get them to share the same texture.

Link to comment
Share on other sites

I was referring to the last post, about having two different game objects. Though I fixed it myself by having two meshes/objects within a single GameObject. The only downside I see so far is that it also means having two textures, as I do not know how to get them to share the same texture.

What's wrong with using the same texture?

Link to comment
Share on other sites

What's wrong with using the same texture?

Nothing, outside that I do not have a clue how to do that :) Right now I make two models in a CAD program, pipe them to Blender to unwrap, export the UV/textures as PNG, paint them in Photoshop and combine everything in Unity. Probably not the best workflow, but the best I could come up with right now. The CAD program is an odd choice, I am sure, but I am fairly well versed in it and it seems to work out for now.

The outer ring and the middle box are one part, and the connecting bit with the black 'holes' in between is another. Though not in this pic, this allowed me to separately set the alpha of the second part. In hindsight I do not really need that. Right now I am picking through your texture tutorial and realizing that I know nothing about manipulating textures in Blender or ambient occlusion.

Do not mind the sloppily painted textures, I am just testing.

full.png

Edited by Camacha
Link to comment
Share on other sites

Actually if you want to use alpha on a small section of the part, then it's best to divide the part into separate objects with separate materials. This can potentially let you save memory by only having the alpha channel on the small texture which needs it. Same principle applies for emissive parts.

Link to comment
Share on other sites

Actually if you want to use alpha on a small section of the part, then it's best to divide the part into separate objects with separate materials. This can potentially let you save memory by only having the alpha channel on the small texture which needs it. Same principle applies for emissive parts.

So that would mean the part ends up with two textures in the GameData folder? One large for diffuse and one small with the extra alpha/emissive channel? Just to make sure I understand correctly :)

Link to comment
Share on other sites

  • 1 year later...

Yes, necro, but this is directly relative:

How should one go about doing a mesh texture, then? Like grating or chain link fence. That sort of thing.

Were I to have a seperate object for each "hole" in the grate, I would end up with quite a few objects. 

If just the grated sections of the Part were a separate object, and set to translucent, would that achieve the effect? Will the translucent show texture on both sides, or will there need to be another object to show that as well?

EDIT: this kinda worked, but I did have to do two planes to show texture on top and bottom. Also, the unlit shader for the frame seems to have been over-ridden by the specular on the grating? 

Edited by DrunkenKerbalnaut
Link to comment
Share on other sites

3 hours ago, DrunkenKerbalnaut said:

Yes, necro, but this is directly relative:

How should one go about doing a mesh texture, then? Like grating or chain link fence. That sort of thing.

Were I to have a seperate object for each "hole" in the grate, I would end up with quite a few objects. 

If just the grated sections of the Part were a separate object, and set to translucent, would that achieve the effect? Will the translucent show texture on both sides, or will there need to be another object to show that as well?

EDIT: this kinda worked, but I did have to do two planes to show texture on top and bottom. Also, the unlit shader for the frame seems to have been over-ridden by the specular on the grating? 

Alpha cutoff bumped is what you need, or just alpha cutoff but the bump makes it look better, check out the heli nets in SM Marine  or this below the basket from the Kerbling Orbiter that i did for HL Airships

c4812s6.png

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