Jump to content

How to make Decals?


Recommended Posts

2 minutes ago, SmashingKirby148 said:

It's something I've honestly wondered about for a while. Unless I'm blind, I've never decals covered for parts. Y'know, where your flag sows up on a part. So how do I do those?

Hopefully this helps

Link to comment
Share on other sites

Yes, it's actually very easy. First set up a plane in blender or what 3D modelling tool you prefere. The flags are all in 256x160 px resolution and the plane needs to have the same aspect ratio:
10zjSTL.png
Once the aspect ratio is set up you can scale the plane to the size you want and place it where it needs to be. No UV unwrap required. Bring the model to unity and use "alpha/translucent shader" for flags with transparancy:

kRNTRrk.png
Finally you need the module in the config:

	MODULE
	{
		name = FlagDecal
		textureQuadName = flagTransform
	}

Thats it! :)

Edit: Actually the mesh needs UV unwrap.

Edited by Eleusis La Arwall
Fixed a mistake
Link to comment
Share on other sites

18 minutes ago, Eleusis La Arwall said:

Yes, it's actually very easy. First set up a plane in blender or what 3D modelling tool you prefere. The flags are all in 256x160 px resolution and the plane needs to have the same aspect ratio:
10zjSTL.png
Once the aspect ratio is set up you can scale the plane to the size you want and place it where it needs to be. No UV unwrap required. Bring the model to unity and use "alpha/translucent shader" for flags with transparancy:

kRNTRrk.png
Finally you need the module in the config:


	MODULE
	{
		name = FlagDecal
		textureQuadName = flagTransform
	}

Thats it! :)

 

Ah! Seems easy enough. Thank you. :D But do I have to have the plane and the model in the same save or is the plane separate? And shouldn't the flag curve around the whatever is being made?

Link to comment
Share on other sites

It needs to be a seperate object inside the same .blend file (or other format). Here is an example of my hierarchy in unity:
qGNgv2k.png

To fit the curvature of a 24 sided cyclinder, cut it vertical in half and rotate the outer vertical edges each by 7.5° around Z-axis:
7QzgbQY.png

You can fit it to what every you want but if you change the aspect ratio, the flag will stretch.

Link to comment
Share on other sites

@SmashingKirby148 Merge both fragTransform into one gameobject. The module may get confused with two gameobject that have identical names. You can use other names but it must be same as referenced in the module:

textureQuadName = flagTransform

I can't spot any error in the unity setup. If this doesn't fix the problem I need to take a look at the config file.

Link to comment
Share on other sites

1 hour ago, Eleusis La Arwall said:

@SmashingKirby148 Merge both fragTransform into one gameobject. The module may get confused with two gameobject that have identical names. You can use other names but it must be same as referenced in the module:


textureQuadName = flagTransform

I can't spot any error in the unity setup. If this doesn't fix the problem I need to take a look at the config file.

 

Hmmm... like this? Btw, I tried this and it didn't work, but if this setup is right then it means I need to show you the cfg. So is this right?

H94ocfQ.png

Yes, the flagTransform is a renamed GameObject.

Link to comment
Share on other sites

@SmashingKirby148 No, this is not what I meant. Both (or multiple) flags must be the same object. The Module only references to 1 mesh.
n9dwXei.png

If you want multiple independant flags you need a mesh for each one with a unique name and a module for each one referencing the desired mesh. Like in unity have flagTransform1 and flagTransform2 and use this in the config:
 

	MODULE
	{
		name = FlagDecal
		textureQuadName = flagTransform1
	}
	MODULE
	{
		name = FlagDecal
		textureQuadName = flagTransform2
	}

Just want to check that the cfg is set up correctly.

Link to comment
Share on other sites

1 minute ago, Eleusis La Arwall said:

@SmashingKirby148 No, this is not what I meant. Both (or multiple) flags must be the same object. The Module only references to 1 mesh.
n9dwXei.png

If you want multiple independant flags you need a mesh for each one with a unique name and a module for each one referencing the desired mesh. Like in unity have flagTransform1 and flagTransform2 and use this in the config:
 


	MODULE
	{
		name = FlagDecal
		textureQuadName = flagTransform1
	}
	MODULE
	{
		name = FlagDecal
		textureQuadName = flagTransform2
	}

Just want to check that the cfg is set up correctly.

 

Ah, I see. So is it easy to make them into one object in blender? What do I need to do to make them separate objects?

Link to comment
Share on other sites

2 minutes ago, SmashingKirby148 said:

Ah, I see. So is it easy to make them into one object in blender? What do I need to do to make them separate objects?

Not quite sure if this is what you want but the commands in blender are easy. Join 2 objects: In object mode select 2 objects and press Ctrl + J (first selected object(s) will be joined into last selected object). Separate part of one object: In Editmode select verts/edges/faces you want to separate and press P. Click "from selected".

Link to comment
Share on other sites

17 minutes ago, Eleusis La Arwall said:

Not quite sure if this is what you want but the commands in blender are easy. Join 2 objects: In object mode select 2 objects and press Ctrl + J (first selected object(s) will be joined into last selected object). Separate part of one object: In Editmode select verts/edges/faces you want to separate and press P. Click "from selected".

 

I've joined them, still won't work. Unity setup is:

GameObject
   SarnusVMainFuelTank
      flagTransform
      tank

And the cfg:

PART
{
	name = Size3MegaTank
	module = Part
	author = SmashingKirby
	rescaleFactor = 0.625
	node_stack_top = 0.0, 15.0, 0.0, 0.0, 1.0, 0.0, 3
	node_stack_bottom = 0.0, -15.0, 0.0, 0.0, -1.0, 0.0, 3
	node_attach = 0.0, 0.0, -3.0, 0.0, 0.0, 1.0
	TechRequired = highPerformanceFuelSystems
	entryCost = 56600
	cost = 20000
	category = Propulsion
	subcategory = 0
	title = Sarnus V Main Stage Tank
	manufacturer = Smashing Industries
	description = A mega tank for your mega main stage.
	attachRules = 1,1,1,1,0
	mass = 12
	dragModelType = default
	maximum_drag = 0.2
	minimum_drag = 0.3
	angularDrag = 2
	crashTolerance = 6
	breakingForce = 400
	breakingTorque = 400
	maxTemp = 2000 // = 2900
	bulkheadProfiles = size3, srf
	tags = fuel fueltank ?lfo propellant rocket Sarnus
	MODEL
	{
		model = SarnusVParts/Parts/FuelTanks/Large/model
	}
    RESOURCE
        {
        name = LiquidFuel
        amount = 12960
        maxAmount = 12960
        }

    RESOURCE
        {
        name = Oxidizer
        amount = 15840
        maxAmount = 15840
        }
    }
	MODULE
	{
		name = FlagDecal
		textureQuadName = flagTransform
	}
}

 

Ok, wait, I did a bit of reshuffling and it kind of works. But when I select a flag, it chooses the main background colour of the flag and displays that. For instance, if I choose the Orbs flag, the flag turns yellow but doesn't show the orbs. If I choose the main KSP one, or those that have a transparent background, it disappears.

Link to comment
Share on other sites

15 minutes ago, Eleusis La Arwall said:

Whoopsi, I made a mistake. You actually need to unwrap the mesh. Easiest way is to use "Project from view (Bounds)" from orthographic view like this:
6gVQMRy.png

Sry, I totally forgot that it needs an unwrap. 

 

*sigh* I got it now, but one of them is flipped horizontally. I can't just flip 180 degrees because then it would be upside down. I also don't know which one it is since they're perfectly symmetrical. |:/

Link to comment
Share on other sites

Glad it works now!

You can use the mirror tool to flip the mesh along an axis. Set Pivot Point to "Bounding Box Center", select one of the meshes, press Ctrl +M and than Y (In my screenshot the view is along X axis, so I need to flip along Y.). Than Ctrl + F and select "Flip normals". it should fix horizontal flip.

Another way is delete the wrong faces/verts, set Pivot Point to 3D cursor (make sure 3D cursor is at 0,0,0) and select the remaining face(s). press Shift + D than R than Z than 180 and Enter. It will create a duplicate on the other side.

Link to comment
Share on other sites

13 minutes ago, Eleusis La Arwall said:

Glad it works now!

You can use the mirror tool to flip the mesh along an axis. Set Pivot Point to "Bounding Box Center", select one of the meshes, press Ctrl +M and than Y (In my screenshot the view is along X axis, so I need to flip along Y.). Than Ctrl + F and select "Flip normals". it should fix horizontal flip.

Another way is delete the wrong faces/verts, set Pivot Point to 3D cursor (make sure 3D cursor is at 0,0,0) and select the remaining face(s). press Shift + D than R than Z than 180 and Enter. It will create a duplicate on the other side.

 

Yay! Finally, my fuel tank can be finished now. :D Thanks a lot for your help, hope your mod goes well too. :)

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