Avera9eJoe

[1.2.2] WindowShine-v12 - Realistic stock and mod part reflections (1 Jul 2016)

595 posts in this topic

IMPORTANT NOTICE

On 9/30/2016 at 9:43 AM, Avera9eJoe said:

Hello everyone. You may have noticed that TextureReplacer hasn't been officially updated for a while now. I could be wrong in my assumptions, but I'm worried about what's going to happen with TextureReplacer in the future, and this concerns me as WindowShine is very dependent on the TextureReplacer reflection plugin. As a note of progress though, I have acquired new shaders for WindowShine that would fix part highlighting and cabin light issues:

hKDhFn9.gif

These new shaders should fix everything currently wrong with part highlighting and cabin lights. However, I don't know how to code and I don't know any modders who would be willing to add them for me. I have the shaders available and I am happy to distribute them to someone if they have the time to make a new reflection plugin for WindowShine. If you did this, you would be the co-owner of WindowShine, as the plugin is truly half of the entire mod (which without it is just a bunch of textures and a config file). @Porkjet I'll ping you here since you've been very helpful in the past. Thank you so much - WindowShine has been sitting for about 2 months with nothing improved and I would just like to get the ball moving once again.

If anyone here is interested in helping me out, or have any comments or concerns please send a PM my way. Thinking with optimism, thanks.

 

 

 

deEBSgI.png

Thank you @Teflon_Mike for the logo!
 
BqsHWSf.png

TbNFbAq.gif

Gif with GemFX and KSPRC v2 courtesy of @cobbman11

Video (-v2)

This mod takes advantage of TextureReplacer's reflective module pared with re-texturing to make all eleven stock windowed pieces reflective, meaning they mirror any object, planet, kerbal, or thing that gets in front of it. Eye candy.

 

Album on imgur

Gif in VAB

 

WindowShine is dependent on TextureReplacer managed by Shaw (Unofficially updated by RangeMachine) and ModuleManager maintained by Sarbian. Make sure to install them both first.

Download:
 

Installation instructions

Spoiler

1.1.3 stock installation instructions:

  1. Install the unofficial 1.1.3 TextureReplacer release by @RangeMachine and ModuleManager if you haven't already.
  2. Copy and merge copy GameData from the .zip to your KSP directory (including the .cfg file).
 
Installing mod support packs:
  1. Install the compatible mod pack (The actual mod, not the WindowShine download).
  2. Install WindowShine
  3. Install the mod support pack for the compatible mod, writing over/replacing in any arguments brought up.
 
MEMORY SAVER:
This will save you a good chunk of memory, but in doing so overwrite the stock part textures - Instead of installing the part textures into "TextureReplacer\Default\Squad", place the "Squad" folder in the WindowShine download inside GameData. This will overwrite the stock part textures directly, instead of TextureReplacer loading a separate set of textures each time the game loads.
 
Enjoy!

 

 
License: Link

 

Mod Support:
Many thanks to Nhawks17 and Nebuchadnezzar for createing even more mod-compatible packs!
 

 

*Using more than one pack that has same part can cause compatibility issues. Use with caution. :wink:

 

Change log

Spoiler

WindowShineTR-v12.3 Changelog
 * Removed docking port reflections due to right-click docking options dissapearing
 * Removed landing leg reflections due to strange glitches with extending/contracting

WindowShineTR-v12 Changelog
 * Made docking port windows and landing legs reflective
 * Fixed Mk2InlineCockpit reflecting
 * Made foil reflective on Cupola, Mk2Landercabin, and HitchikerStorageContainer
 * Made toroidal ring reflective
 * Cleaned up Modules in WindowShine.cfg

WindowShineTR-v11 Changelog
 * Fixed mainsail fairing reflecting
 * Added Rapier engine

WindowShineTR-v10 Changelog
 * revamped Mk1Cockpit
 * Added Mk1CrewCabin
 * reworked Mk1InlineCockpit (All mk1 spaceplane cockpits are now in one mesh, so I reworked them to compensate)

WindowShineTR-v9 Changelog
 * patch for non-retractable 1x6 solar panel

WindowShineTR-v8 Changelog
 * Fixed retextured Mk1InlineCockpit
 * Improved Mk1-2Pod windows

WindowShineTR-v7 Changelog
 * Added reflections to Mainsail bell

WindowShineTR-v6[Hotfix] Changelog
 * Fixed Gigantor solar panel reflection
 * Added Mk2crewCabin

WindowShineTR-v5 Changelog
 * Matched remaining window colors
 * integrate with ModuleManager and TextureReplacer to prevent stock overwrites
 * Improved Mk1-2 normal map (could still use some work)
 * increased reflection slightly on windows

 

 

Known issues:

*On parts with the added reflection shader/module, all other part shaders are ignored. I.E. Parts that have reflections added don't have edge highlighting, don't gray out when moved in editors, and lights do not turn on. This is sadly an issue with Shaw's reflection plugin built into TextureReplacer. Current fix unknown.

 

Shameless plug! If you've enjoyed this mod you might also like Space Plane Color Corrections. :)
Edited by Avera9eJoe
Added important notice
26 people like this

Share this post


Link to post
Share on other sites

Do the windows reflect everything? Sky, planets etc..?

Share this post


Link to post
Share on other sites
Do the windows reflect everything? Sky, planets etc..?

Yes they do :). Anything that is in front of them. Best part about it, no noticeable lag. From looking into the small lander can, it looks like it draws a cube on the "inside" of the window and maps the textures/faces of what it "sees" on the sides of the cube. I'm not the creator of this effect obviously... :P. I'm the texture and config editor. I had to retexture all the capsules, locate the meshes, and add the reflector module into their configs. Well, it's 2:06 AM where I am so... I'll check on this in the morning. Later!

Edited by Avera9eJoe

Share this post


Link to post
Share on other sites
Yes they do :). Anything that is in front of them. Best part about it, no noticeable lag. From looking into the small lander can, it looks like it draws a cube on the "inside" of the window and maps the textures/faces of what it "sees" on the sides of the cube. I'm not the creator of this effect obviously... XD. I had to retexture all the capsules, locate the meshes, and add the reflector module into their configs. Well, it's 2:06 AM where I am so... I'll check on this in the morning. Later!

Yeah I think I saw that effect before, anyway, it's nice to see you actively participating in the modding scene.

1 person likes this

Share this post


Link to post
Share on other sites

I like this!

Though im always hesitant to replace stock files :(

There should be a way to do this via Module Manager id imagine (adding the TRReflection, and re-assigning the texture should be easy). Course that would mean a double up on said textures in memory :P

If nothing else, may i recommend a .bat file or something of the like. Similar to what Ven uses in the stockpart revamp. for easy adding and removal.

Edited by rabidninjawombat

Share this post


Link to post
Share on other sites
I like this!

Though im always hesitant to replace stock files :(

There should be a way to do this via Module Manager id imagine (adding the TRReflection, and re-assigning the texture should be easy). Course that would mean a double up on said textures in memory :P

If nothing else, may i recommend a .bat file or something of the like. Similar to what Ven uses in the stockpart revamp. for easy adding and removal.

I'd need someone to make it for me haha. I can edit textures and mess with config files like no one's business, but coding... I'm no good at. :P

Share this post


Link to post
Share on other sites

Did you edit the images you include, or is your work just in the cfgs? I will make this into a MM patch for you I just need to know if the images have been changed.

1 person likes this

Share this post


Link to post
Share on other sites

...Whoa. I think we're progressing into the weirdly-realistic side of things that is just awesome.

Share this post


Link to post
Share on other sites
Did you edit the images you include, or is your work just in the cfgs? I will make this into a MM patch for you I just need to know if the images have been changed.

Yes the images have been changed. The reflections and image opacity are tied closely together, so I had to make all the textures have opacity of 1% (almost invisible), and leave the windows at full visibility.

I'm planning on making a tutorial so other modders can add reflections to their parts. It's fairly simple with practice. :)

EDIT: How easy would it be to add additional reflective parts to your patch? Could you make a config file that lets you add additional parts? I'm planning on making solar panels reflective too and I'd hate for you (or someone) to have to update the patch every time I make more reflective parts. It could also be useful for other modders.

Edited by Avera9eJoe

Share this post


Link to post
Share on other sites

Looking amazing, I check it out too, though the replacing of stock files as bit no-no, will too check on if we can make a MM patches, and I guess TR can replace the texture just by having the complete file path inside TR itself.

Share this post


Link to post
Share on other sites

oh0A9vf.png

New release! :cool:

Edited by Avera9eJoe

Share this post


Link to post
Share on other sites
blackrack said:
Post a pic of these reflective solar panels in orbit (with scatterer+eve :P)

Hahaha one sec!

- Note that I'm using old EVE with my custom cloud pack. I've had errors with Scatterer before so I haven't been using it in my main save. I've still got it tho ;).

Edited by Avera9eJoe

Share this post


Link to post
Share on other sites

you are my best friend :D

1 person likes this

Share this post


Link to post
Share on other sites

Pretty...

Edited by Avera9eJoe
1 person likes this

Share this post


Link to post
Share on other sites

This looks awesome! I can't wait to try it out when I get my new laptop.

Any progress on a tutorial for modders? I would like to incorporate this into my solar panels for the various mods I'm in the process of doing.

Share this post


Link to post
Share on other sites
-ctn- said:
This looks awesome! I can't wait to try it out when I get my new laptop.

Any progress on a tutorial for modders? I would like to incorporate this into my solar panels for the various mods I'm in the process of doing.

I was going to do a video on it but in the mean time you can read about it on the first page of TextureReplacer. Basically:

 

1. Go into TextureReplacer @default.cfg and set "logReflectiveMeshes = true" - This is important to find the internal meshnames on parts for a later step.

 

2. Create a ModuleManager .cfg for your parts. Start by creating a text document and add the reflection module listed for every part you are adding reflections to. It's extremely simple to set up. You can use any one of the mod packs as a base example. The more parts you want to be reflective the more modules you will have:

@PART[name of part]
{
    %MODULE[TRReflection]
    {
        %name = TRReflection
        %shader = Reflective/Bumped Diffuse
        %colour = 0.3 0.3 0.3
        %interval = 2
        %meshes = 
    }
}

Replace the bracketed name in @PART[name of part] with the internal part name of the part you are adding reflections to. It's on the 3rd line of part configs in "name = ". ModuleManager example: "@PART[largeSolarPanel]"

You can read the OP in TextureReplacer to learn what each of the parameters do.

After adding and editing your ModuleManager part Module, save it as a .cfg file with whatever name you want the users to see. Personally I'd suggest following the naming convention used in the other mod packs. Copy/save this .cfg file to the TextureReplacer main folder (Location inside of GameData shouldn't actually matter but it's most sensible in TextureReplacer).

 

3. Boot up KSP and load a craft with the parts you want to make reflective. If your .cfg file is working all the parts you made modules for should be completely reflective.

 

4. Quit KSP and open up your KSP.log file. Search for "[TR." and find the lines that say "[TR.TRReflection] Part [name of part your making reflective]" On the line/lines below the part name it will list the meshes used in that part. Copy the mesh names you want to be reflective into the "%meshes = " line inside the part config, separating each mesh name with a space. You can leave this blank and TR will run the TRReflection module on every mesh on the part. This is fine unless there are flags on the part (it runs the plugin on flags as well, making them reflective but also making their transparency black). Example: "%meshes = meshname1 meshname2"

 

5. Edit your part texture so that only the parts of the texture you want to be reflective are showing. Make everything else have opacity of 1%. The image will look like a blank background with only window textures/solar showing. If you are converting between PNG and DDS images, note that DDS images need to be flipped vertically when saved. When saving as DDS, you'll need to save with transparency. These are the best settings, courtesy of @InsanePlumber:

IXUVM3l.png

 

6. Take the texture you've edited/created and recreate it's file path from the gamedata folder. After you've done this place the texture in it's part folder, and place the stack of folders inside TextureReplacer/Default/ so that it should look like "TextureReplacer/Default/[mod folder]/[part category folder?]/[part folder]/[your texture]" - use any one of the other mod downloads as an example if you're having trouble with this.

7. ...

8. Profit

Edited by Avera9eJoe
cleared up code
3 people like this

Share this post


Link to post
Share on other sites

You should probably mention the OP under Known Issues that it's not compatible with OpenGL mode (as TR's reflection isn't).

Share this post


Link to post
Share on other sites
You should probably mention the OP under Known Issues that it's not compatible with OpenGL mode (as TR's reflection isn't).

Doing so know. Thanks :).

EDIT: New release. Added Mk3 crew cabin (for some reason the files are located in fuel tanks), and made missed windows on the Mk2 pods reflective.

Edited by Avera9eJoe

Share this post


Link to post
Share on other sites

I'm not having any luck with this mod. No reflections at all. Could it be a compatibility issue with 64-bit KSP?

Edit: A clean install did the trick.

Edited by cobbman11

Share this post


Link to post
Share on other sites

Excellent mod. Nice work Avera9eJoe!

1 person likes this

Share this post


Link to post
Share on other sites

But modulemanager involves literally no coding, using MM is super easy, and always a safe bet.

Share this post


Link to post
Share on other sites

Outstanding! What a great addition!

TbNFbAq.gif

2 people like this

Share this post


Link to post
Share on other sites

So how are the reflections rendered exactly? Is this a feature of texture replacer? How does the shader work?

Share this post


Link to post
Share on other sites
So how are the reflections rendered exactly? Is this a feature of texture replacer? How does the shader work?

texture replacer has the function but its default settings are not good but i fu tweak u can get just like that gif.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now