#LFO - Lux's Flames and Ornaments
1 messages · Page 3 of 1
It'd just allow us to actually not want to die while using it
but it does bring me to the idea of testing LFO 0.2.1 with the 0.9 bundle and vice versa
Well, that's something fairly significant - the not wanting to die part, I mean
This codebased is so coupled
that might not be a bad idea
lemme do that rq
hm ok
that tell me absolutely nothing
because neither 0.9 with a 0.2.1 bundle or 0.2.1 with 0.9 bundle works at all
the 0.2.1 dll needs "lfoadditive 2.0.prefab" and 0.9 needs "lfoadditive 2.0.mat"
and neither of the opposite bundles has the file for the other version
RIP
I could try using Asset Ripper to decompile the shader from 0.2.1, I know that it has like partial support for it
it might at least give us a bit of an idea
well, no, test it with our current LFO version
but it probably won't be fully usable
How would that help?
because the 0.2.1 shader works and the 0.9 doesn't?
I meant more so just to compare the decompiled shaders from 0.2.1 and 0.9
We know one issue, the shape is caused by the 0.2.1 -> 0.9 switch
since they would be in the same format
Is that the particular shader that works in SORRY?
yes,
"works"
and not just sorry
the 0.2.1 additive shader is when all the mesh-based plumes last worked
which are basically all except a few of yours
Questaria, Kesa, SORRY, they all use the mesh ones
#1092613573290754108 message
As I said, test with SORRY
because your plumes are mostly volumetric, not mesh based, and the mesh based are probably much simpler
test what?
True, they're very simple
the image I linked is a SORRY engine
Test new LFO with even newer combo bundle and a modified SORRY to use the old 0.2.1 shader?
but we don't have the 0.2.1 shader
and the decompilation is almost guaranteed to not give us the full source
That you would rip from the dead clutches of the old 0.2.1 bundle?
it's nearly impossible to decompile shaders
at most you get little bits and pieces
<- is just that stupid
that's why I wanted to decompile, basically
to compare the "little bits and pieces" of both 0.2.1 and 0.9 when decompiled
to see if it could give us some hints
of what to look at
The next time we get a Lux sighting we can ask if he could share the 0.2.1 shader source...
if he has it
^^^
but since he never committed that version to git, it's most likely he doesn't have it
since he just has his project and keeps updating it
without versioning it
so it might be lost forever
most likely
I could be wrong and he could have kept a backup
but I wouldn't count on it
Well... It sux that bundles can't be fully decompiled.
but it's still weird... did he not test LFO 0.9 with SORRY at all?
since the issue was already there when he released it
Maybe he tested it with SPARK and just assumed it would be OK for SORRY?
that's possible
I know he tested it with SPARK
but then it would be almost safe to assume he didn't make any major changes to the additive shader...
if he didn't feel like testing it with any of the mods that use it
I am downloading asset ripper as we speak
ahhh this is such a tangled mess
the post-patch 5 period just keeps giving
and I'm not sure I want to keep receiving
lol
WTB one shader mechanic. Low pay. High Stress. Madness almost certain. Unlimited glory if you're successful.
i swear to the gods if I decompile these shaders and they are the exact same
but at least we can hope that we all learn something from all this, and maybe set some better practices in place...
Madness almost certain?
I was born mad
Well, no ksp2 modding increased my insanity
Shader "LFOAdditive 2.0" {
Properties {
_Opacity ("Opacity", Range(0, 1)) = 1
_FalloffStart ("FalloffStart", Range(0, 10)) = 5
_FalloffStartPosition ("FalloffStartPosition", Range(-1, 1)) = 0
_StartFadeIn ("StartFadeIn", Range(0, 10)) = 1
_LenghtwisePosition ("LenghtwisePosition", Range(-1, 5)) = 0
_LenghtwiseBrightness ("LenghtwiseBrightness", Float) = 1
_SpeedRandomMultiplier ("SpeedRandomMultiplier", Float) = 0.1
[NoScaleOffset] _NoiseTex ("NoiseTex", 2D) = "white" {}
_NoiseContrast ("NoiseContrast", Range(1, 5)) = 1
_Tilling ("Tilling", Vector) = (1,1,0,0)
_Speed ("Speed", Vector) = (0,1,0,0)
_Noise ("Noise", Range(0, 1)) = 0.5
_Falloff ("Falloff", Range(0.5, 5)) = 4
_Brightness ("Brightness", Range(0, 10)) = 1
[HDR] _StartTint ("StartTint", Vector) = (1,1,1,1)
[HDR] _EndTint ("EndTint", Vector) = (1,0,0,1)
_TintFalloff ("TintFalloff", Range(0, 2)) = 1
_Fresnel ("Fresnel", Range(0, 10)) = 1
_FresnelInverted ("FresnelInverted", Range(0, 10)) = 0
_NoiseFresnel ("NoiseFresnel", Range(0, 1)) = 0
_ScaleRandomizer ("ScaleRandomizer", Range(0, 0.5)) = 0.05
_LinearExpansion ("LinearExpansion", Range(-1, 1)) = 0
_QuadraticExpansion ("QuadraticExpansion", Range(-1, 1)) = 0
_Seed ("Seed", Range(-10, 10)) = 0
[Toggle(_ENVIRONMENTREFLECTIONS_OFF)] _ENVIRONMENTREFLECTIONS_OFF ("_ENVIRONMENTREFLECTIONS_OFF", Float) = 1
[Toggle(_SPECULARHIGHLIGHTS_OFF)] _SPECULARHIGHLIGHTS_OFF ("_SPECULARHIGHLIGHTS_OFF", Float) = 1
[HideInInspector] _BUILTIN_QueueOffset ("Float", Float) = 0
[HideInInspector] _BUILTIN_QueueControl ("Float", Float) = -1
}
//DummyShaderTextExporter
SubShader{
Tags { "RenderType" = "Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Standard
#pragma target 3.0
struct Input
{
float2 uv_MainTex;
};
void surf(Input IN, inout SurfaceOutputStandard o)
{
o.Albedo = 1;
}
ENDCG
}
Fallback "Hidden/Shader Graph/FallbackError"
}
that is all assetripper will export
yeah, I kinda thought so...
but even just the parameters could be helpful I guess?
Shader "LFO/Additive" {
Properties {
[Header(General)] _Opacity ("Opacity", Range(0, 1)) = 1
_Brightness ("Brightness", Range(0, 10)) = 1
_LenghtwiseBrightness ("LenghtwiseBrightness", Float) = 1
[Space()] [Header(Color)] [HDR] _StartTint ("Start", Vector) = (1,1,1,1)
[HDR] _EndTint ("End", Vector) = (1,0,0,1)
_TintFalloff ("Falloff", Range(0, 2)) = 2
[Space()] [Header(Noise)] _Noise ("Noise", Range(0, 1)) = 1
[NoScaleOffset] _NoiseTex ("Texture", 2D) = "white" {}
_NoiseContrast ("Contrast", Range(1, 5)) = 1
_NoiseFresnel ("NoiseFresnel", Range(0, 1)) = 0
_Tilling ("Tilling", Vector) = (1,1,0,0)
_Speed ("Speed", Vector) = (0.5,1,0,0)
[Space()] [Header(Mask)] _Fresnel ("Fresnel", Range(0, 10)) = 2
_FresnelInverted ("FresnelInverted", Range(0, 10)) = 0
[Space()] _Falloff ("Falloff", Range(0.5, 5)) = 1
[Space()] _FalloffStart ("FalloffStart", Range(0, 10)) = 0
_StartFadeIn ("StartFadeIn", Range(0, 10)) = 1
_FalloffStartPosition ("FalloffStartPosition", Range(-1, 1)) = 0
[Space()] _LenghtwisePosition ("LenghtwisePosition", Range(-1, 5)) = 0
[Header(Shape)] _LinearExpansion ("LinearExpansion", Range(-1, 1)) = 0
_QuadraticExpansion ("QuadraticExpansion", Range(-1, 1)) = 0
[Header(Others)] _Seed ("Seed", Range(-10, 10)) = 0
}
//DummyShaderTextExporter
SubShader{
Tags { "RenderType" = "Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Standard
#pragma target 3.0
struct Input
{
float2 uv_MainTex;
};
void surf(Input IN, inout SurfaceOutputStandard o)
{
o.Albedo = 1;
}
ENDCG
}
}
And from 0.9.0
so definitely different
No fallback shader
sapcing added
removed _builtin_queueoffset
removed _builtin_queuecontrol
Holy shit a lot changed there
The bundle from 0.2.1 only has Additive 2.0
And this is from 0.9.0
It doesn't have a "Additive 2.0"
hm ok
No
no
Or is it?
it's in both
so the plumes would be broken in both
oh ok
so the shader is renamed but the file still has the 2.0 in the name
that explains that part
no it doesn't
huh?
thats a material called lfoadditive 2.0
but its shader guid makes no sense
Ahh nevermind
the .mat is just the container
I did show the shader
ahhh this is all a mess and a half
Ahh
AssetRipper doesn't handle shader guids
So the LFOAdditive 2.0.mat references the new shader
So the shaders are completely different
and SORRY just doesn't reference the new shader?
wait what?
yeah I'm on it
in fact, por qué no los dos
excuse me wtf
it never printed that stack trace before
even though the error's been there ever since we added the console
this is the first time I'm seeing it, and I had the game running earlier today

What version of SORRY is this?
yeah, will do
as the one in sorry is "LFOAdditive 2.0"
Is that with the one from LFO dropped in?
Yep
just a bit more documentation
is there no way to pan around the camera in this game?
like you could with the middle mouse button in KSP1
I feel like I've seen Lux do it in his videos
no change afaik
Of course it wouldn't be that easy
yeah...
If only we knew how to make a new plume to tst
it's also a bit difficult to tell if the BE-4 plume is supposed to look like that or no
since the colors are wrong
and there could be alpha coming into play and all that
Gods if we could only actually load these in the editor to testt
I'll try to recreate one of them I guess
since we know how they're made from the JSON
I had a stroke there
lol
trying to write two sentences at once
probably the Reiptor one because the difference seems much more pronounced there
oh fuck me
that thing has 2000 lines
well maybe not

ok maybe one from Kesa
good god how fucking long did these plumes take them to make
for the classic surface level engines they're all around 65 kB
duh
probably like this
except those are all broken in my LFO version...
there should be the 0.2.1 (which is actually 0.9) unitypackage floating around somewhere here
I guess I could try with that one, and with LFO 0.9
but I can't find that
we really don't have much going for us do we

Do we need the mesh based plumes :p
I mean I can try if the volumetric ones actually work
at least the non-profiled ones
because we know these seem to be ok
other than the colors
I'm too tired for thisss
idk something is telling me that this isn't right
the Volumetric (Additive) looks better
oh this is annoying, since I'm building the LFO bundle from inside the package in my LFO project, now when LFO is imported into a parts project, the lfo bundle builds in it as well
is there a way to keep the assets assigned to a bundle in VCS for LFO.Editor and not have it be built in projects that install it?
ok that did nothing
[Info : Unity Log] [Camera] Setting camera to ID Flight
[Info : Unity Log] [LFO] Setting _Brightness to 3,01 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _InnerBrightness to 1,81 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _InnerBrightnessFalloff to 1,23 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _LengthwiseBrightness to 1,88 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _ColorMedium to {
"r": 1.0,
"g": 0.0,
"b": 0.8495259,
"a": 1.0
} on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _ColorMediumPosition to 0,657 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _ColorLow to {
"r": 0.435441971,
"g": 0.0,
"b": 1.0,
"a": 1.0
} on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _ColorLowPosition to 0,218 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _ColorOffset to 0,42 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _StartPosition to 0 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _EndPosition to 0,195 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _RadialFalloff to 0,59 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _RadialFalloffPosition to 0,732 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _LinearExpansion to -0,45 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _QuadraticExpansion to 0,31 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _YAnchorOffset to 0,08 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _Noise to 0,73 on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Setting _NoiseTex to 3D Noise on LFO/Volumetric (Additive)
[Info : Unity Log] [LFO] Method invoked but returned false.
[Info : Unity Log] [LFO] Method invoked successfully, asset: 3D Noise
[Info : Unity Log] [LFO] Assigning texture 3D Noise to property _NoiseTex of LFO/Volumetric (Additive)
[Info : Unity Log] [Flight] Switching To Vessel Fly Safe-1 ----------------------
this all looks fine, and I see no errors anywhere else in the log...
[Info :Lux's Flames and Ornaments] Loading LFO Shaders. LFO/Additive, LFO/Volumetric (Additive), LFO/Volumetric (Profiled), LFOAdditive 2.0
[Warning:Lux's Flames and Ornaments] Shader name 'lfo/additive' is different from key 'lfoadditive 2.0'!
[Info :Lux's Flames and Ornaments] LFO Shaders loaded. LFO/Additive, LFO/Volumetric (Additive), LFO/Volumetric (Profiled), LFOAdditive 2.0
hm
but that shouldn't affect this
at all
since I'm using only the "LFO/Volumetric (Additive)" one
let me try just putting the plume on the prefab
nope
well, I give up
absolutely no clue what to do
just been trying random bullshit for the past hour which made no sense
like at this point unless Lux comes along and magically makes everything work, I feel like there's no chance we can fix this
I guess at least we can try to fix the color bug on SpaceWarp's side...
but that's about it
It's 7:18am and I'm thinking about the architecture of LFO
I think I need help
Lmao
Is [Info : Unity Log] [LFO] Method invoked but returned false. normal and expected? It's the only part that seems like it might not be OK, but I don't know what's expected here.
I'm a bit confused, I thought we were getting plumes, but they just were not the right shape and the issue was with the Volumetric (Additive) shader?
With no plume at all this makes me wonder if it's related to the apparent SW inssue where we're not getting the specified color and instead getting the default red.
Can we test the new LFO with the old SW on KSP2 0.1.3.2 or 0.1.4.1? Or is that what you've shown above?
The "no plume at all" thing happened to me with the LFO/Volumetric shader
No sorry
The LFO/Volumetric (Additive), yeah, like you said
And no, the shape issue was not with volumetric plumes, since there are no mods with volumetric additive plumes
That was the mesh-based LFO/Additive
Those are used by SORRY?
And I think you said that the SORRY plumes had massive configs for those, right? Unlike the simple configs mine use.
Yeah, SORRY, Questaria and Kesa all have ~2000 lines long configs for their sea level chemical engines
Very similar lengths, so I'm assuming they all use the same preset, the one for Sea level plumes
But the presets are broken
In the current version of LFO at least
Man, that's nuts. I'd like to take a look at one of those JSONs to see if I can figure out what the differences are about.
So I can't use them to make my own plume to test
Well, they use a large number of separate plumes mixed together, to make a good looking final result
Why can't we start with a simple SPARK mesh plume? I thought we were at a point where the editor worked?
To get those mach diamonds and so on
Did we move away from that?
I mean surely we can make those
I was able to get a simple mesh plume working with no issues
Can we model them in Unity Editor?
However, it's very difficult to test whether the shader is broken in the editor as well as in the game
Because we don't have no reference to compare to
When it's a new plume
That's why we wanted to be able to remake an existing plume
And compare it to the same plume with a working shape in LFO 0.2.1
So, one part of the problem then is that I designed my plume in a pre-release of 0.9.0.
And using my config will just give my shape
Since Lux apparently completely rewrite the mesh shader between 0.2.1 and 0.9
So yeah, we would need a plume that worked in 0.2.1
And to recreate it now
To see if it looks wrong in the editor
Or... We leave that be and let Isa and Jim redo their 2000-line monsters to get back to something that works for them.
Not great
But really, why not pull in Isa and Jim to help with this?
Because now we know whether the wrong shape is caused simply by Lux's rewrite of the shader, in which case it wouldn't work in the editor, either, or it's something else to do with the C# side
They at least have an idea of how they conmfigured a 2000-line monster
Well, like I said, I'm 99% sure they just used Lux's presets in the editor
And those don't work in our version
Ahhh. so they may have copied something from SORRY and not made from scratch. But still, they might have tweaked theirs.
Yeah, definitely, but I think it's unlikely they would be able to make the plumes from scratch
Or at least it would be very difficult and time consuming
One thing I can do is grab the original preset files from the zip from Lux and see if I can edit them so that they load in the new editor
There is also the fact that Lux was trying to move away from the mesh-based plume to volumetric.
So we're trying to save the old bad way of doing it
Yeah, which might be part of the reason why he possibly didn't even test his old additive mesh plumes with 0.9
I think you may have nailed it
But all the current engine mods use it, except some of your profiled ones
So it would be really nice if we could make it work
(plus, when I tried to create a volumetric additive plume, it didn't even work, as you've seen)
So there isn't much else to go on
Than the old mesh plumes
Since those at least show up in the game
But again, it's possible I just did something wrong
This is really hard with 0 documentation and never having seen Lux making the plumes
We can look at the Volumetric (profiled) to see why those do work and compare those to volumetric (additive)?
And nobody else has used the volumetric shaders either
Except for the profiled one
So we don't even know if they're working
Well, Lux has, since he has videos of his tests in the game
But it also seems like it may be significantly more difficult to get to a good result with the volumetric plumes, compared to the mesh based ones
You can do much more with them and they can look much better
But with much more work involved
For a very simple mesh plume for the CPP engine, I had a file that was literally like 50 lines
I had the impression (could be wrong!) that Lux thought the volumetric approach was going to not only be better visually, but also ultimately easier to configure. My volumetric profiled plumes are pretty easy
And it looked good enough
Of course this is all just my personal and subjective impressions
Since I really don't know how the volumetric shaders are supposed to be used
🙃
At least for the mesh based ones I have some reference in the existing configs
The part where we can't get volumetric (additive) to even show up in the game is a real issue. If we could get it to show up, then maybe we could play with it, but I suspect the shader is fundamentally a WIP, so this might only take us so far.
This leaves the SW 1.5.0 color issue
Which is a whole other problem!
It definitely has to be possible to get it into the game, since Lux was testing it I'm pretty sure
I just don't know what I did wrong
Yes! It must be possible.
Though I'm also not very clear on the difference between LFO/Volumetric and LFO/Volumetric (Additive)
Here, I think maybe we could compare to how a volumetric (profiled) plume works since those are volumetric and do show up
They seemed pretty similar, except LFO/Volumetric kept breaking and having visual glitches
In the editor
So maybe that one was more WIP than the additive one
Are we certain that the in-game examples Lux had were Volumetric (Additive) and not just Volumetric? The former sounds right to me.
Yeah, we don't really know
I could try to go back through all of Lux's old screenshots/videos and see if I could catch a glimpse of the editor to see what he was doing...
Also, we can troll through his posts on https://discord.com/channels/1078696971088433153/1141807690264367135 where he was giving me advice about setting up my plumes. He might have mentioned something there that would be a clue.
They are lfo presets that i modified
Temporary plumes, will replace with custom ones
Im seriously considering learning hlsl to write them from scratch, but aaaaaaaaa
Maybe a crazy idea, but could we just take the bundle from 0.2.1, put it into 0.10.0, and create a second bundle that will contain only the new things added in 0.9? That way we could possibly have both volumetric and mesh plumes working?
M-maybe
I like this idea! Are there name collisions?
Well, there won't be if we exclude all the files that existed in the 0.2.1 bundle from our new one
We'd have to manually load the bundle then
Is that an issue?
It will!
We know this to be possible
Kraken be praised!
There are a couple of mods that were never updated for 0.1.5 and their bundles still load
It can load as far back as 2018 or further
I shoulda known this from vrchat
But also, one thing I'm considering is whether Lux intended for the new LFO/Additive mesh-based shader to be backwards compatible with the 0.2.1 one?
Maybe it was a full rewrite where he expected the plumes would have to be redone?
So many things we don't know

And the one person who can answer this is mia a lot of the time
This is a cautionary tale tbh
This may be so, and if so, then it may be on him to fix when he returns
Perhaps we (and by we, I mean you two) will succeed in a rewrite of LFO that makes it a non-hair pulling thing so that when he returns we end up with a much better final product? I don't know how you'd feel about that...
Personally, I'm more concerned with getting the colors solved, but again I'd be little help here either.
I'll first test my two-bundle theory, but yes, I agree, other than that, I think we should start with the rewrite of the C# codebase first, then shaders
Is there anything I might be able to do that would help in either of these? I'm really quite willing, but not sure how much help my skils would be
Just a note as well, I am going to be busy for today and likely tomorrow writing a research proposal for my english class that is due sunday
Of course, no problem
I really should get back to my actual work as well, lol
But I hate leaving things unfinished like this
I mean if you wanted to, I suppose you could try to look at the commits leading up to SpaceWarp 1.5 and see if there's anything that looks like it could mess with the shaders
But, knowing how this usually goes for us, I kinda expect it to be something really obscure
Just curious, Lux was making great progress on his mods? Whatever happened. If it's personal that's groovy just seems bizare that such progress was made and then it just flopped over. Seemed to tie in with the many recent updates thgough
yeah, he's been MIA due to personal reasons, for the past month or so
but at least he's sent us the current code he had for this mod, so we can continue working on it while he's absent
the not-so-good news is that we don't have the previous version, and in this one, most plumes are broken
I thought we did have the previous version. When I made my bastardized 0.2.1 / 0.9.0 decompile version that was working with something I got from his repo that claimed ot be 0.2.1. I was able to make something that at least worked with my plumes (other than the color of course). Maybe what we've got for 0.2.1 isn't complete, or is just too old, but we've got something.
Ahh, gotcha
since that's like the #1 most important thing we need
The code itself is not so helpful.
everything else we can completely rewrite from scratch
and it won't be too complicated to do
but I know literally nothing about shaders
so that's the biggest issue
basically, the C# codebase is just a small wrapper around the shader functionality
and not very important
in the big picture
speaking of which!
I see someone lurking
@weary bobcat
please please please tell me you still have the source for the original "LFOAdditive 2.0" mesh-based shader that was in 0.2.1
since the updated version that's in 0.9 seems to be broken
and we only have the source for the 0.9 one
0.2.1
and 0.9
alright, so I did a bit of a deep dive
and read through this entire thread: https://discord.com/channels/1078696971088433153/1085910413239140416
Wwise:
- #1085910413239140416 message
- #1085910413239140416 message
Patchouli: - #1085910413239140416 message
- #1085910413239140416 message
- #1085910413239140416 message
Blender plume: - #1085910413239140416 message
LFO: - #1085910413239140416 message
- #1085910413239140416 message
- #1085910413239140416 message
- #1085910413239140416 message
- #1085910413239140416 message
- #1085910413239140416 message
- #1085910413239140416 message
- #1104608965972742154 message
- #1104608965972742154 message
those are the most important parts I found
some of the LFO links should hopefully contain the working version of the old mesh shader
ideally
or use it to help us debug the new one
one of these has to contain what we need, right?
apparently no???
what the fuck
I'm so confused about the version numbers
in July, LFO 0.2.1 was already released
but the 0.1.1 "DevKit" was first shared on August 29?
then followed by 0.1.2 on the same day
and 0.2.0 god knows when (we only have schlosrat's version, no idea when he got it from Lux)
and the LFO 0.2.1 bundle contains only a single plume shader called "LFOAdditive 2.0"
and none of the files I linked and downloaded contain that
I'd have gotten it on https://discord.com/channels/1078696971088433153/1141807690264367135. I'm sure we can associate a date with it, and it may have been hot off the press when I got it.
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
it's not really important
since we have older versions of it
and even those don't contain the needed shader
seems like Lux never made a package with it
Did you get anywhere with the two-pronged bundle approach for a decisive pincer maneuver? Perhaps we can out flank the problem in the short run that way.
not yet, I'll try it after I eat though
it will not be that easy, since we'll have to basically have a map of where each specific asset is
alright, time to get into this
I hate that this is necessary but I don't see a different option to get existing mesh plumes to work
ok so since the way LFO currently handles assets was just really not going to work well with this double-bundle approach, I'm rewriting a lot of it anyway
LOL
That was franly inevitable
This is just the tipping point
In the end we'll have something that's much more maintainable and extendable perhaps
Alright so I've finished a large portion of the actual restructuring/rewrite
Basically I only need to finish logging for the editor part of LFO, and, well, then actually test if any of this works 
The last hour or so I've spent with my eyes closing on their own, so it's safe to say there are probably bugs 
So I'll first finish it and test it, and then push anything
When extracting shader : shader disassembly not supported on DXBC
someone knows a solution for that ?
Shaders can't be extracted/decompiled
You have to do what you need to do with them at runtime
Yeah, it doesnt look anywhere near trivial to decompile
Though if you have the bytecode and know how to build a c++ library ... maybe?
https://github.com/Unity-Technologies/HLSLcc
Why do you need to decompile a shader, by the way?
To see how it works, what it needs to render stuff?
I was struggling to figure out why overlays for planets aren't working anymore and was just switching things on and off, copying various materials and what not, basically trial and error all the way. In the end I found out it was the shader, because I found a reference in the code to the same shader but with a sufix "_old". I switched to that shader and immediately everything worked again. Would have been a lot easier to take a look at the shader and see what they changed.
You can at least easily get the parameters the shader has
That I know
Would be also nice if we could harmony patch the shader if needed, no?
Yeah, the only way you could get anywhere close to that is if you decompile the game shader into HLSL (which already is nearly impossible), change stuff, and then illegally distribute it with your mod
Curiosity 🙂
Perhaps to see how coding a free one
With my coding level, you can say impossible 😀
Yay!
bug is still there but the editor part should be working so I pushed both repos
Which bug?
gotta go walk my dog, but when I'm back I'll take a look at it
it isn't immediately obvious to me where I broke it
also pretty sure that ref on the prefab is not necessary, since the variable itself is never assigned to in the method
it was already there but it should be safe to get rid of
excuse me wtf
and I've got a debug build set up, including player-connection-debug=1
whyyyy can I not debug it
it works, it was just being dumb about it
for some reason
ok that was such a stupid bug
I had ServiceProvider.GetService<AssetManager>()instead of ServiceProvider.GetService<IAssetManager>()
so now it's back in a working state
other than the shader, of course
considering I was writing this code half-asleep, and didn't test it at all until now, I did better than I expected lmao
but the volumetric ones don't seem to be working, interesting
ah ok so apparently sometimes the configs refer to materials, and sometimes directly to shaders, when specifying a shader
alright, this is better
now it's in what seems like a fully working state
so I guess the next step would be to look into the SpaceWarp color bug
Yay! We’re so back!
@brittle tendon
Can you disable the new colors patch in spacewarp 1.5 and test theplumes
sure
Because the code for that is different between 1.4.3 and 1.5
nope, still red
H-huh?
I commented out all the HarmonyPatch attributes in the ColorsPatch class
and nothing
(except for wrong looking parts)
oh wait
not all of them
jesus that file is a mess
It's disgusting
And if that works
Try with removing just the lower half and replacing the upper half with
[HarmonyPatch(typeof(ObjectAssemblyPartTracker), nameof(ObjectAssemblyPartTracker.OnPartPrefabLoaded))]
internal static void Prefix(IObjectAssemblyAvailablePart obj, ref GameObject prefab)
{
ReplaceShader(ref prefab, Shader.Find(KSP2_OPAQUE_PATH), "Parts Replace", "KSP2/Parts/Paintable");
}
[HarmonyPostfix]
[HarmonyPatch(typeof(SimulationObjectView), nameof(SimulationObjectView.InitializeView))]
internal static void ApplyOnGameObjectFlight(GameObject instance, IUniverseView universe, SimulationObjectModel model)
{
ReplaceShader(ref instance, Shader.Find(KSP2_OPAQUE_PATH), "Parts Replace", "KSP2/Parts/Paintable");
}
internal static void ReplaceShader(ref GameObject target, Shader shaderToReplace,params string[] allowedShaders)
{
foreach (var renderer in target.GetComponentsInChildren<Renderer>(true))
{
string shaderName = renderer.material.shader.name;
if (allowedShaders.Contains(shaderName))
{
var mat = new Material(shaderToReplace);
mat.name = renderer.material.name;
mat.CopyPropertiesFromMaterial(renderer.material);
renderer.material = mat;
}
}
}
Okay, where else do we touch anything to do with shaders in spacewarp
What happens if you just delete that entire class idk?
I did a solution wide search for Shader and Material
Nothing
nothing
other than the Colors(Patch).cs files
yeah I was expecting this to be something really obscure...
seems like I was right
but also a good reminder that we need to clean up those two classes for 2.0 lol
Is it time to do a git bisect
I think it is
Gods this is going to be pain

And you are the one with the environment set up to test stuff
I mean I can just send you a zip with LFO, and then you just need SPARK or SORRY
but I can do it
I'll just eat dinner first
Alright
Thank you
Hmmm, does SpaceWarp 1.4.3 work on KSP2 0.1.5.0
Or are we going to do between 1.4.3 and 1.5.1 on 0.1.4.1?
technically there should be nothing preventing 1.4.* from working
all we did was upgrade to netstandard2.1 and rebuilt bundles
True
Then i suppose I can get to work on a bisect so we can both try
Anyways, bisecting between 1.5.1 and 1.4.3
This is going to be worse than I thought
there are versions that don't build correctly between the two
Ahh git bisect skip works
You might want to remove the semver stuff from the swinfo.json when testing yourself munix
Otherwise it can cause a crash at startup
Did we not fix this bug in 1.4.2 ... while we were still working on 1.5
I don't even remember it 
That was the loading localizations bug
huh
The loading localizations from addressables
yeah got it

This is almost as bad as going over each commit individually with the amount of errors

Also you need to change the min version of LFO
or it wont load
I might need to do a second bisect after this
Ohh gofs
I can't test with that version of LFO
specifically because of its dependencie requirement from bepinex
unless I dnspy and edit the DLL
Alright, modified the LFO.dll
It might be impossible to do a normal bisect
we might always have to fix the localizatiosn
oh god
what is the fix?
Well, referencing KSP2 version 0.1.4.1 and then changing getasset to getassets or something like that
But remember to also remove the semver from LFO and make the attributes reference SpaceWarp 1.4.0
yeah I did all that
I think I just want to do a diff betweeen the 2 versions at this point
88 commits between 1.4.3 and 1.5.3
I think we need to go further back, since 1.5 was branched off 1.4.0
and had many changes before 1.4.3
aaaaaaaaaaaaaaaaaa
This is going to be a fun night
Let me just try random stuff at this point
And we know this is a space warp issue
Alright, what is everything that is essential for this
in what context?
I meant, what is everything essential for spacewarp to run this test
So things we can't blame it on so far
I mean
- My reimplementation of general loading actions
- The sound loading system
- Falki's KSC App button
- Colors Patch
Testing without lua next
Lua is also not the issue, as expected
good god this is annoying
It is
I wish we noticed this before 0.1.5 (or at least the fact that it's a SpaceWarp issue)
schlosrat knew about it but thought it was caused by the 0.1.4.1 patch
Okay
We can't blame this on
SpaceWarp.Game.dll SpaceWarp.Messaging.dll SpaceWarp.Sound.dll SpaceWarp.UI.dll or SpaceWarp.VersionChecking.dll
Loading spacewarp 1.4.3 back in 0.1.5.0 for more testing reasons
Just to confirm its good
Ahh great I literally cannot test LFO in this version?

great
munix can you build a version of that version of LFO built to reference spacewarp 1.4.3
actually scratch it, I can just use the released version of LFO, right?
Okay, well, 1.4.3 definitely works
the issue is in the main DLL
So thats all we have to know
something is bugged in spacewarp.core.dll
Alright, time to disable the module manager
(This test works even without any extraneous modules)
ok so I randomly picked a commit like in the middle, fixed some stuff, and it's already broken there
ac4ca33d - Merge pull request #254 from SpaceWarpDev/semver
So yeah, the issue is definitely somewhere in the core of spacewarp
Alright for more narrowing down
- Not the official mod loader patch
alright I've narrowed it down to 9 commits so far
Huh
What commit
let me try the one before
oh but none of these will probably work
yeah, typeloadexceptions galore
So a mistake was introduced into the core of the modularization for spacewarp 1.5
yeah that doesn't narrow it down too much...
oh lord

And I have to go again soon...
Aaaaaaaa
I checked a lot of auxillary systems
Its somewhere in the core
well I just finished reading through all the diffs between the commits and didn't find a single suspicious line...
You guys are amazing! You've narrowed it down soooo much!
like everything I've seen tells me that there is nothing in those 6 commits that should affect shaders/materials/anything related in any sort of way
but it's definitely there
So, git bisecting is where you sanp off and build a some commit in the middle and just keep dividing until you find the commit that has the bug?
This is a process I've never used but it makes a lot of sense
Eventually you would arrive at a commit where the bug first appears.
But it might be complex and subtle such that the commit where it appears is interacting with something not obvious.
yeah, which is our case
Nuts.
Can you point me at the commits? I'll look too.
Unlikely I'd help, but I wanna help
they are these ones: #1092613573290754108 message
first one is 0b84b0f3, last one is ec8cc0a7
somewhere between these it happened
Is that on the main branch?
What date?
07/22-07/23
this is such a pain in the ass
those commits basically rewrote everything
91 changed files just in the last one
yeah but most of those were name changes?
yeah, a lot of it was just moving them to a different folder
I honestly think I broke something in the loading flow
that would kinda be my guess, the loading flow or generally patches
Is there a way to document the loading flow before and after that set of commits?
well... checkout the commit before the first one, see how it works, and then checkout the last one, and see how it works
Could it be how asset bundles are loaded?
uh I don't think so
in the current version LFO doesn't use SpaceWarp's asset API at all
I load the bundle manually
istg
Yeah
There is only one thing that can be broken at this point, the core loading system
The only change to LoadingActions in the last of those commits is to the SW.Core csproj
BootstrapPatch is where we set up the loading flow
you think some incorrect IL manipulation or something?
That would cause a crash
I'm thinking some behaviour changed
@brittle tendon
Commented one suspicious looking line in the Awake method of SpaceWarpPlugin
I swear to fucking god
I don't even recall why I put that line there
what the fuck

I was wondering what it was about
And I don't even know why that was in there
So now we have to do the custom shader stuff
yeah, that's the last step towards fully working LFO
but I'm still questioning whether the new shader is broken or just different
Can you test with the dev branch using SPARK though munix
maybe the plumes were just meant to be remade with the new shader
if its just different, why not have both shaders
They are named differently
yeah, a sec
.
There is an easy way to check which shader those were meant to use
By checking the parameters against these definitions
I mean hm
the plumes for the chemical engine mods were made with the presets from the LFO DevKit unitypackage
and all the versions of that contained the new shader
not the old one
I'm gonna check stuff rn
Every parameter is shared between the two
I think we need to just do some testing, make some plumes and see if they look different in the game than in the editor
Okay, so what if I do this IOProvider.Init at a different point in time
Or delay binding until then
I can't
I guess I am going to have to do my own caching
and yeah I can confirm SPARK plumes work with that commit
but obviously, no SpaceWarp UI
trying with a custom thing
Man this is the weirdest bug
and this is exactly what Nate was talking about in the interviews when he was saying that all the systems are so interconnected that working on one feature can easily break a completely unrelated other feature

fair enough lol
I mean an unrelated other feature that they dont even test
that seems to have done it
so after this hotfix is released, SPARK should be fine, basically
since LFO 0.9 still works fine with it
but we still need to look into the mesh shader for SORRY, Kesa and Questaria
You guys are amazing!
For the issue being one line of code
Absolutely amazing!
yeah

seemingly completely unrelated
Dont merge yet
Hmm, how soon am I able to modify LFO to use KSP2UnityTools addressables system?
I mean, the code is basically rewritten to a point where I'm like 80% less disgusted by it
so I guess now is not a bad time
and for me I guess it's time to start learning about shaders

there, I officially proclaim "restructuring" to be complete
(mostly)
I guess I could make a 0.10 release?
Go for it
so that we're finally able to get rid of anything unwanted
Yeah and we wanna do that asap
by the way...
this is how I dealt with it lol
it's not pretty but it seems to work
I didn't want to be keeping the old names, even if the files are new
Are these normal for SW 1.5.4?
[Error :Space Warp] System.NullReferenceException: Object reference not set to an instance of an object
at SpaceWarp.Patching.LoadingActions.PostInitializeModAction.DoAction (System.Action resolve, System.Action1[T] reject) [0x0000d] in <c4b7b8e285454218b805517608ac3ffc>:0 [Error : Unity Log] [System] [Error :Space Warp] System.NullReferenceException: Object reference not set to an instance of an object at SpaceWarp.Patching.LoadingActions.PostInitializeModAction.DoAction (System.Action resolve, System.Action1[T] reject) [0x0000d] in <c4b7b8e285454218b805517608ac3ffc>:0
[Error : Unity Log] [System]
[Error :Space Warp] System.NullReferenceException: Object reference not set to an instance of an object
at SpaceWarp.Patching.LoadingActions.PostInitializeModAction.DoAction (System.Action resolve, System.Action1[T] reject) [0x0000d] in <c4b7b8e285454218b805517608ac3ffc>:0 [Error : Unity Log] [System] [Error :Space Warp] System.NullReferenceException: Object reference not set to an instance of an object at SpaceWarp.Patching.LoadingActions.PostInitializeModAction.DoAction (System.Action resolve, System.Action1[T] reject) [0x0000d] in <c4b7b8e285454218b805517608ac3ffc>:0
[Error : Unity Log] [System]
[
I just updated
I didnt touch that part
you know how it goes
logs?
[Error : BepInEx] Failed to run [PatchManager.PreloadPatcher.Patcher] when patching [Assembly-CSharp]. This assembly will not be patched. Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Could not find PatchManager Core
You don't have patchmaanger installed?
CKAN thinks I've got 0.3.1.
CKAN could be wrong
And as I've been working with CPP I certainly must have ut
but I'm going to yank it and reinstall
Can you show your plugins folder
Because if its not finding a file named PatchManager.Core.dll, ya don't have it
MY PM folder is apparently hosed. I'll wipe it and reinstall
CR was also hosed for some reason...
That is very odd
Beautiful blue plumes!
Actually, I think my X2 plume is looking weak, this is most likely just an issue with my plume config and nothing to do with any of this.
And I really need to fiddle with the MPD plume... But as we now have a working LFO editor!
Anyways, I am going to start work on the editor side of addressables based plumes
What have you got planned? Is this where we get rig of the JSONs and make it all addressable?
It is where all new plumes will be in addressables plus all their parameters such as meshes and such
Meaning I am also going to have to make the meshes addressable as well
Well hmm
Actually I'll keep the meshes in a bundle
but all the images and stuff will be made addressable
what if a mod wants to use a custom mesh?
What about existing mods currently using JSONs?
I'll keep support for those
That is the question, I'm not sure how easily I can do that though as a mesh is a component not an asset, so I can't just easily go back to the FBX I think
oh by the way, before you start with the changes, please just give me a moment to edit all the previous commits
Yeah, custom meshes are going to be an interesting one
It might mean that there will be mesh duplication across mods
Oh and so will textures also be interesting
At least if I automate everything
Yeah, this might involve a lot of asset duplication unless I have a deduplicator in the editor scripting
Where I suppose I could at least deduplicate textures and such
alright that should be it
you should be able to fetch and pull the new origin now
ahhh fuck I made a mess in the main LFO repo
lmao
dev is based on the now-nonexistent original main
it's not exactly a nice solution... but I just switched the default branch to dev and deleted main
since dev had all commits from main anyway
alright that was messy af but seems like now we're back to normal
God, that sounds like something I'd do... What's wrong with you man? 😉
while you're here, would you mind testing the 0.10.0 version for me before I release it?
just to make sure it really works
ah stupid
I haven't rebuilt the bundle yet
a sec
oh btw @grim bridge there's still a small issue with the editor package
when you install it, and build bundles in your project, it will also build the lfo-resources bundle
and automatically copy it to the zip
when using KSP2UT
now that the extension is gone, SW at least won't load it, but it's less than ideal
amazing, more bugs with the new bundle
fuck me
ok wtf
when I open the file AssetManager.cs in Rider, I get no advanced syntax highlighting, no analysis, errors showing up, nothing
but when I rename it to anything else, that all starts working
and renaming it back to AssetManager.cs breaks it again
Hmmm maybe I should add an API to add "excludes" to KSP2UT
that might be the best option, yeah
there seems to be a bit of an issue with the new meshes
the original fbx files directly have a renderer on them
but in these new ones, you have some nested objects, and the renderer is on that object
Yeah
I noticed that
I can try to just export the inner objects from Blender
alright, errors all fixed
but there's still an issue with the size
you can see the tiny white specks
those are the shock diamond meshes
I'm pretty sure
seems like they were off by a factor of 1000
now they seem to perfectly match the original dimensions
they all had scale set to 0.001 in Blender
that... changed absolutely nothing
lol
in both Blender and Unity they look the right size
but in game they stayed tiny
how?
the original ones have this
the new ones this
how the hell do I change that?
This is certainly my fault
I had no idea it would do that.
actually, the scale didn't matter at all
I think I've finally got it
I had to set units up like this
cm and unit scale of 0.01
now when the meshes are at 1x Unity scale, they are the proper size
I can fix it if you want.
I set up my blender to work in mm, and I probably ought to change that anyway
It made sense for the first few things I was making
But now it's impacting you and making you need to set things silly
Is that what they're supposed to look like?
awesome, so now it should be ready for the 0.10 release
Or simply what you're expecting
yeah
that's the better term
that's how they look in 0.9
and the goal was to replicate that
of course, it would be better with the correct shader from 0.2.1, but that's a whole other issue
So the shader is still goofed up, or the plumes need to be re-built, take your pick
But we're back to 0.9.0 in a form that can actually be released!
yep
and now with the correct bundle
alright, so one final round of testing for me, with SORRY, SPARK, Kesa and Questaria
and I can send you the zip for testing as well
Thanks!
suspicious file downloaded (thank you windowz)
Good thing I'm vaccinated!
ehhh so
no Questaria
those engines seem completely broken
you get a spam of this and can't place the parts
I get that too some times, but it's intermittent
looks like something is incorrectly set up on the prefab/json of the part
I don't know that it's related to LFO or anything
yeah most likely not
though I can test without LFO later
but since the other three mods' engines don't do it (SPARK, SORRY, Kesa), I will assume it has nothing to do with LFO
That does happen with SPARK
Not all the time
But sometimes it refuses to place the parts
interesting
I've never seen it with SORRY though
and for Questaria it happens always, with all the engines
The most reliable way I know to trigger it is to have a radially attached part with 2x or higher symmetry and try to place TNO reeactors or SPARK engines on it
at least during the current VAB session
(and no symmetry anywhere)
it looks to me like incorrectly configured attachment nodes
and for SPARK, since you're mentioning symmetry, probably the symmetry setting
I'm getting this going on also. It looks like this on the pad and in the VAB
But it looks like this in orbit
This is getting to orbit the lazy way as these are really vacuum engines
Yes
No, there's no color bug
It's just a trick of the lighting on those tanks
They look fine in sunshine
oh wait so what was the issue?
The main engine?
The one with the missing nozzle and everything on the central tank
You can see a bit of the cathode protruding, but the nozzle is just gone and the rest is massively clipped
Kinda does work well like that
I suspect most of these issues have to do with the configuration of the modules
but I can't say for sure
It's fine in the VAB and even on the pad, but jumping to orbit is... problematic for that one
I wonder what I've done wrong?
We'll need to sort that out before we have another workshop where we roll out the new tools
alright, other than Questaria, all the chemical engines look like they work
(within the limits of the shader)
It works fine if you keep the stress off it apparently
and what shader is that?
Its the mesh
yeah, well, then that's not unexpected
It's actually the same as on the MPD1 and MPD2
ok that is weird
But the MPD2's that are beside this look fine
are these the spark_mpd_md_v2 and spark_mpd_sm_v2 parts?
that looks to me like the bigger one has noise turned down to 0
which is reflected herree
Nope, it was not an electrical issue
Hmmm... how did that get like that?
I'll fix the noise setting in the JSON and give it another go
also, looks like you need to set the colliders to convex on your tanks