EnvironmentalVisualEnhancements
EnvironmentalVisualEnhancements copied to clipboard
EVE compatability with Kopernicus/RSS
@rbray89 There are two issues here:
- Kopernicus may replace the shaders on bodies. How should we handle compatibility?
- Kopernicus supports the renaming (at main menu) of bodies, and also the renaming of only the CelestialBody (with PQS and scaled space versions keeping the old name). How should we handle compatibility?
1 has obvious applications, but I should explain 2. The reason for the "change celestial body name only, and at main menu) is so that KSP will actually work with the homeworld not named Kerbin. Can't replace the PQS name because too much relies on it being still named Kerbin (most of the KSC stuff), and since PQS can't change scaled space can't either or (IIRC) the PQSMod that switches between them has trouble. However, we can safely rename just the CelestialBody, and that allows RSS to have Earth named Earth.
@rbray89 just bumping this--I notice @pingopete says scaledversion textures aren't showing, which I assume means EVE still isn't compatible with Kopernicus shaders...
Hmmm... Afraid I didn't see this until earlier... (1) Hmmm... I try and use the same texture names as the original shaders. I only perform shader replacement (not material) to ensure that we don't loose the textures. I have plans to include as many of the original material parameters that are useful as well.
I didn't realize Kopernicus was loading and performing shader swapping. Does it have a terrain shader as well?
(2) This one I'm not so sure about. It would really depend on which mod gets loaded first. I could try and do a differed load. I only reference things by the CB name and SS transform name.
(1) @Teknoman117 would know best, but I believe Kopernicus does replace the materials on both (scaled/PQS). I'll have to dig regarding names.
(2) When do you query CBs? If it's anywhere after mainmenu, then my suggested solution is to use only CB name, grab the CB, and get the scaled space transform by getting that component in the object tree rather than searching for it separately.
Alternative to (2): Use only scaled space transform name, and get component CelestialBody upwards/downwards from the scaled space transform.
(1) If it is material replacement, that could explain it. (2) The query only happens at loading (main menu). The CB and scaled space transforms are then stored locally.
As an aside: Did you guys ever figure out how to add a bona-fide PQS to Jool? I just have a dummy class I use that I can attach PQS mods to. I also wanted to double check that the way I'm attaching PQSMods is correct.
Ah, I see. Ouch, yes, that does sound race-condition-y, although it could be solved by the alternate approach above (getting scaled transform only, and then looking in the scaled transform's gameobject for component of type CB i.e. regardless of CB name).
I haven't tried myself, but you can see if adding a PQS node (and required default parameters) to Jool's body definition in Kopernicus works. I rather think it would.
Another approach I had considered is using single frame-delay so that ALL mods would load before mine, regardless of alphabetical order.
That's probably safest, tbh, a lot of stuff runs on main menu.
(1) Yes the materials are replaced by Kopernicus, I swear I had a good reason for doing this. Something related to preserving the original when cloning bodies.
Nathaniel Sent from my iPhone
On Jul 6, 2015, at 12:48 PM, NathanKell [email protected] wrote:
That's probably safest, tbh, a lot of stuff runs on main menu.
— Reply to this email directly or view it on GitHub.
Which also means if the shaders are changed later they wouldn't be inherited. However, if EVE queried the live CB from main menu it should be fine (versus the shader and material names, as the latter is a random string). New planets and new materials are created at PSystemSpawn, before main menu
Hmmm... That is what I am doing... Do the replacement materials use the same shader as the original materials (same parameter names, etc)?
Yeah it just clones the material but assigns a random name. Unless someone changed that....
@rbray89 so is there anything we can do Kopernicus-side to make things easier for you?
Just uploaded a new version that should address the ;loading order concerns.
Awesome! What about the terrain and scaled space shaders? Does that also work now, or if not should we change them any on our end?
I think that the change should address both...
Awesome!
Thankyou!
Looks like I'm still going to have to get the scaled transform another way though. Do you know of a quick way to get it from the CB?
@rbray89 does cb.scaledBody not work?
Ah, I never noticed that before! I'll give it a shot :)