Jump to content

Idea for mod


Jhorriga

Recommended Posts

Well, since nobody else has spoke up and since I'm at work and am bored, I'll chime in.  Forgive me if I sound very basic. I have no idea what your skill level is.

I don't think that would be all that easy to accomplish.  It's doable but...

Every part has a texture that starts out as a bitmap, or a png or jpg.  Those textures are 2D and represent all of the polygons in the model flattened out.  It's commonly called the unwrap.  When a part is unwrapped and the texture is created, the person who creates the unwrap decides where all those flattened parts and pieces go. That means, all textures are all very, very different.

The only what I know of to change the way a part looks (adding scorch marks) is to change the actual texture.  And because you're suggesting a progressive increase, it would mean that there would need to be a new texture applied with each increase or at the very least an additional overlay texture.   So, the first problem, you'd need to swap in and out multiple textures for one part or fade one in and out.  That means more memory to hold those extra textures.  Next, all of those textures would have to be hand drawn. It's not something you could simply apply to a part (that I know of) because even though you know where the front is on a 3D part, there's no way programatically to find the front on a 2D texture.  It could be anywhere and at any angle.

So that means, you'd have to get every single modder to create multiple textures for all of their parts so that they could get scorched.  You're lucky you get ANY texture with my parts.  I'm a minimalist and I likes white.  And if you look at Lack's LLL parts pack, you'll think I'm Picasso (no offense I love LLL parts).

Soooo... can it be done?  Yes.  Is anyone gonna do it? Highly, highly doubtful.
 

But don't let me discourage you.  Keep the ideas flowing and we'll just keep punching holes in them till there's no room for holes.

Edited by Fengist
Link to comment
Share on other sites

1 hour ago, Benjamin Kerman said:

What about heat shields? How do they accomplish the blackening? 

If you can get into that, this might be possible. 

@Fengist

Maybe I wasn't terribly clear.  I try to rephrase.

Creating changes in colors or swapping out textures is easy enough.  If you click on the green circle in my signature, there are parts in that mod where the lenses change color as you slide bars or click buttons in the part's PAW.  I'm able to do that because I know those parts. I created them. Some of the textures I can change the colors on and change the way the part looks. some I can't.  Were I to choose to do so, I could keep track of the amount of heat a part has been through and potentially change the colors or textures based on that.  Again, relatively easy.  But that's because I know how the part was made and I created the textures.

The heat shields you mention do just that.  They change the _BurnColor by using ModuleColorChanger.

	MODULE
	{
		name = ModuleColorChanger
		moduleID = shieldChar
		shaderProperty = _BurnColor
		useRate = False
		toggleInEditor = False
		toggleInFlight = False
		
		redCurve
		{
			key = 0 0
			key = 1 1
		}
		greenCurve
		{
			key = 0 0
			key = 1 1
		}
		blueCurve
		{
			key = 0 0
			key = 1 1
		}
		alphaCurve
		{
			key = 0 0.8
		}
	}

The catch there is, RoverDude, who created that part knew what it would look like if he changed that color and he knew he could use ModuleColorChanger to make it darker and achieve the desired effect.  While I think all KSP shaders do have the _BurnColor attribute and theoretically it's possible to set a _BurnColor on any part, it's just a solid color, you wouldn't be adding any scratches or scrapes.  And, if you take say one of my boat parts and a stock part and apply the same _BurnColor to both, they'll look vastly different.

Snjo's Firespitter has a texture swapper.  If you create multiple textures for a part, you can swap them out in-game and achieve very different looks.  So applying a series of increasing scorch marks could be done that way.  But that would take knowledge of how the texture is laid out.

The methods that could be used to achieve heat stress do exist and it can be done.  But, they all have one thing in common, the creators knowledge of the part.

Here's 2 textures from KSP parts.  The heat shield you mentioned and an oscar fuel tank

tj90yu3.png

jfdPAca.png

The first thing you notice is the size.  If you tried to apply scorch marks to the shield and didn't adjust for size, they'd look huge on the oscar tank.
Nextly, the colors.  If you blended in the same black _BurnColor to both of these, they'd look very different.
And finally, the thing you don't see, the texture for the heat shield repeats itself.  Though there's only one black rectangle, it may cover a dozen facets on the actual part. If you applied a scorch mark, it would be duplicated exactly in other locations.
And here's one I just thot of.  How would you apply scorch marks to one of those shapes in either texture and have them blend smoothly across the entire part if you didn't know what the texture looked like?

But here's the big one.  How would you know, from a code writing standpoint, which direction to apply the scorch marks in?  Which way is up, forward, backward??? Or for that matter, which way was the part turned?  Vertical?  Horizontal?  Maybe it was sticking out the side at a 45 degree angle? Imagine for a moment you're blind and someone hands you a square painting and tells you to turn it right side up.  Trying to apply scorch marks to a texture and all you know about it is it's size  would be very much like that.

So, unless there's some technique that alludes me, and there very well may be, applying the realistic distress the OP suggests to parts you didn't create, would be difficult if not impossible.

Applying them to parts you create or where you have access to the textures, very possible.  But it would require manually creating more textures to add the distress and then, making sure it looks realistic when the textures change.

In the case of the heat shield, changing one of the essential colors of one part would also work but you'd also have to visually inspect those changes to see if they look good.

Change the colors of every part on a ship and you'd likely end up with a quilt.

 

Edited by Fengist
Link to comment
Share on other sites

As @Fengist explain it modifying/darkening the whole texture on a part will have very unpredictable results unless you design it for each part.

But there is another way, I think, you could add another texture (just the scorch marks) on top of the original part's texture. It will be easier to determine the right orientation and the scale of the scorch won't be determine by the scale of the part's texture.

Probably a good amount of work to do it but it will surely make for a nice mod.

Link to comment
Share on other sites

The only way this could really work and look half way decent would be similar to how Farming Simulator handles dirt.  It's basically a transparent layer on top of the tractor and when they want the dirt to show, they just make it more opaque.  The problem is, you would have to create this layer for every part, which would be a massive undertaking.

Edited by Alshain
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...