#Shoemaker (Planet Modding)
1 messages · Page 2 of 1
Decals and discoverables arent one and the same
Decals can be used for discoverables but dont have to
yeah I understand there's no connection between them
You can put a discoverable at any point ... if you know how to convert lat/long/radius to x/y/z
I was just curious why the island runway isn't one
ok so KSC is a PQSSurfaceObject
hmmm this makes me think. are they going to replace the PQSSurfaceObject with the PQSDecal stuff?
PQSDecal seems a lot easier to use.
it would make more sense to me for them to replace the current KSC with whatever colonies will be made of
but who knows
I think the issue would be that the buildings need to be interactible (like highlighting on hover and clicking on them) and I don't think that the decals can be?
looks like decals can be anything?
the hover stuff has nothing to do with decals or PQSSurfaceObject
the building interaction is this stuff
and my half done tutorial on the mouse inspect + object browser actually uses that
idk, I would still guess that there's probably a good reason why they use one thing for the KSC and a different one for discoverables
but I have no clue what it is, I haven't looked into any of it
I thought I gave the reasoning
Decals deform the surrounding terrain
PQSSurfaceObject just deletes it it seems.
uses a pqs sphere to delete
sounds very inefficient
I don't think the KSC deletes any terrain
if it did I wouldn't have the issues with the mountains on the runway
oh wait im looking at the LOD code
just noticed something that might help with the collider issues RenderPlanetCollidersEnabled - graphics setting
I have zero clue how to texture a planets surface atm
This looks promising
Part of the array
Hold these
0
1
2
Aaaaaaaaaaaaa
I don't know
This is so arcane
I don't understand what goes where
it has something to do with the shader, but what?
What's happening?
im not a shader programmer but i make blender shaders so i can try to help understand them
If only I could decompile the shader
yeaah the issue here is not even just understanding an existing shader
it's taking just the parameters of it and guessing what the shader does with them
because we have no way to get the code
Unity version is too new
Could attempt again ... ig
But ive tried like 4 times
Using tbe latest prerelease of asset ripper
ha first thing I saw when I downloaded the UABEA nightly was Avalonia
pretty sure that's the UI framework I suggested to use for the CKAN UI rewrite
would be nice if ckan had a better ui, that way people would stop using badly made mod managers like toucan.
I don't know if I've ever seen anyone actually use it
tried this and no. its very broken.
Maybe try the assets from an earlier version before the unity upgrade?
But we know that they have been doing stuff with the assets
I mean the shaders
Im pretty sure
and we were trying basically since 0.1.0 to decompile shaders, with no luck
not these specific ones, but we did try
Yeah exporting shaders breaks when set to decompile
This is 3 years old and doesn't support the modern asset bundle format
I think it's about this comment, mostly: https://github.com/mafaca/UtinyRipper/issues/249#issuecomment-1189616806
Yeah
I'll be honest, without investing a lot of effort, there is no way to decompile these shaders
but, the mentioned fork just says it's been merged into the main repo
If we could disassemble it into DX assembly, compile that into bytecode, maybe we could use this
Gonna try one thing to see if I can get one texture to work
No
of course that didn't work
Also apparently the island runway ... is a texture on the shader itself
Okay, I can ignore all these parameters ... for now
as they are not set at all on vall
Okay, so my working theory is that these values are related to the index into the texture array
values between -1 and 4 when the texture array is 5 items long
between 0 and 12 when its 13 items long
And the enable params are always zero/one
how do they map, RGBA, XYZW..
I have no clue
And I cant have a clue unless I have the shader code
And I am 100% sure that IG wont just give us that
Not really
Could be related to Vegetation, like in SampleRgbaChannelExcludeMaskJob.Execute?
Dont think so
So the PQS shader is a compute shader ... obviously
I have one idea, but I need to rip a lot of textures to test it
I can try recreating a planet from scratch, lets say ... vall
copying all it's parameters
and modifying it from there
but I have no clue how I would actually understand what stuff does
I'm going to inspect vall's biome map to see what values it actually uses
but that's likely going to be a tomorrow thing
reasonable
The issue is, that all this work may be subject to change come the next update or whatever
or when they switch to using CBT
Yeahh
not sure this helps in any way, but it's the best I could find on the current PQS system: https://forum.kerbalspaceprogram.com/topic/205930-developer-insights-12-–-planet-tech/
Hi, I’m Eric DeFelice, a graphics engineer on the KSP2 team. My job is to create technical solutions to the graphics features we have on KSP2. One of the most obvious of these systems is how we generate, position, and render the planets in the game. We need a system to render the planets while in...
What happened when you zeroed all of them?
Nothing
I don't have the code right now, but if it's a compute shader, shouldn't there be atleast one ComputeShader.Dispatch call, and maybe the ComputeBuffer instances where these parameters are packed to send them to the shader? Or am I getting it all wrong? (I didn't dig down - just sayin' )
As a funny side note, I implemented once a QuadSphere subdivision LOD system in Unreal, and using compute shader in unreals is creepy; zero docs
I know what the parameters are naemd
and what types they are
just literally no other information is exposed to me
like how they interact with eachother
would you mind sharing where you found them?
Just look at the shaders in the dev branch of KSP2UT
there are dummy shaders for both local and scaled space of planets
Have you already seen the KSP.Rendering.Planets.PQSJobUtil.HeightSample function and the related HeightLayerSample? Seems like the same shader calculations but in a burst job
Ahhhn, ok
What I dont understand is the ground texturing
Yes, the local shader
just a couple of parameters
Only a few
@frigid current Have you taken a look at how Planety did it? I'm pretty sure the textures worked
Did they? I kinda thought that was the one thing that wasn't working
I thought it was atmo that wasn't?
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Seems to me like it's the same issue Cheese is having, with the local space shader
The exact same issue
And ive exhausted my list of possibilities for figuring it out
I guess you guys already tried begging the devs for help?
yep...
I wouldn't say begging, but yes
If you can give me a rundown of what exactly needs figuring out and what you're tried, I might be able to take a look at it... another pair of eyes never hurts ig
What the 700 or so odd parameters to the CelestialBody/Local shader do
Okay not 700
Closer to somewhere between 100 and 200 iirc
I'm guessing you already tried just going and tweaking them and seeing what changes?
So its a problem of just sheer amount of information
To a slight degree, not sure how I would see the effects of any individual parameter though
I also dont know the invariants of the system as they relate to eachother
Is all your progress on the github rn?
I can put my progress on github qhen I get home
alr
Im currently getting ready to bowl
I bowl with a group of like 11 others
Well family friends
Sounds nice
@frigid current Any idea which file the shader in question is located? I can try decompiling it, but I need to find it
fyi Cheese was able to decompile it using RenderDoc
but I'm pretty sure that's done at runtime
nothing else worked
Like decompile decompile, or just disassemble?
well, disassemble
I don't think that any way to decompile HLSL from bytecode to actual code exists
from research over the months, it seems like the only way to really do it is manually
Tried this?
I assume the result will be a bit like C decompilation though
This seems a lot more promising https://github.com/AndresTraks/HlslDecompiler
Cheese once you're home, please try it, I can't compile it on my Linux box and I don't want to create a Windows VM just for this
Got these same errors when using a similar tool in renderdoc
and the second one says that the file has unknown format
is it possible that Unity now compiles by default with DXC instead of FXC?
since the tool seems to only work for FXC-compiled shaders
(to be fair I have no clue what I'm saying lol)
I just know that when using the same input file for it, it just says Unknown file format! Finished.
@fossil jetty Did you try changing the file extension?
the error is thrown when the first 4 bytes of the file don't contain one of the expected signatures
so extension shouldn't have any impact
You sure it verifies by the magic number?
Because it's pretty common in windows programs to do it by extension IIRC
yep
I can't deal with dark mode, it makes everything hard to read for me
Do you even need to fill all the parameters of a shader?
Because we do have the names
Also did you guys manage to somehow examine what the stock planets have there in the parameters?
I can but it barely gives me any info
At least none that i understand
I even examined the stock biome map
Through renderdoc or?
Through thunderkit
It tells me what the parameters are it just doesnt help me
There is just too much
I think the approach is just a lot of examining
Im not even sure if its worth it to put that much time into examining something that will change
Do we know how soon?
I would assume this year, but no clue when specifically
^
I mean, you tried the Earth from scratch, right?
Maybe modifying Kerbin would be the way to go?
Maybe?
Its still a lot of effort
When roughly will you be able to upload the stuff to github? I'll take a look and see what I can do
Somewhere between 1 and 4 hours
We do 3 hours of bowling and then go somewhere else sometimes
Are the shaders parameters baked in or are they computed at runtime, atleast partially?
Wdym?
The parameters are compiled in, the inputs to the parameters are put there at runtime
whether they're all set directly on the planet prefab or set at runtime
yeah I'm pretty sure the questions was about the values of the params
I think it's the prefab, no?
Kerbin_pqs
Vall_pqs
Eve_pqs
Laythe_pqs
Those all have references to the material
Its called the local space material
yeah that
@frigid current poke
Just got outta bed, gonna eat breakfast then push it
alr
@twin anvil its not github, but this is the assets folder, copy the files in this into assets after installing Addressables, Thunderkit, and KSP2UnityTools (from the dev branch), make sure to copy over while unity is closed though
alr
To use the dev branch btw, append #dev to the git url
Btw, who was the one who managed to create a modding environment on Linux?
no clue
but for the most part, you should just need .NET 8 SDK and any editor
I think I remember some people having issues with ThunderKit on Linux though
for reference the latest template versions contain GH workflows for building mods on an Ubuntu runner
so it should also work when building locally on Linux
you might just need PowerShell and Mono installed for some stuff
Scratch my message from 14:42, thunderkit doesn't wanna import
On the Native unity version anyways
And on Wine Unity hub is borked
How did you open those?
Also I'm getting a fuckton of errors from KSP2 Unity tools
Show
you need KSP2 imported first
well
it's saying it can't update the imported game DLL
so something went wrong with the import
Now it magically* seems to work
*I checked auto reference on the game DLL
Unity in Wine sounds like a pain in the ass lol
I needed to rebuild the TK settings
@frigid current How did you open the Kerbin/Jool/etc PQS?
probably in ThunderKit's addressables browser
Collections: list is empty
An empty project has that issue as well
@frigid current What was the thing that wasn't working? Local space?
yes
CelestialBodyAssetLoader seems to be responsible for loading that - did you look into that script?
It's specifically biome texturing with the local space shader
I have no idea how that works
Biome texturing, okay
What exact piece of information is missing?
How indexes for the texture array for ground textures are computed
@frigid current Could you do me a favour? I need screenshots of how the PQS for Kerbin looks - ideally in asset form though (although probably in DMs considering server rules)
When I'm not busy, sure
Or @fossil jetty if you're available and not going to sleep right now
sure thing
@frigid current Do you do some special ritual to get Earth to show up?
I cannot believe I had issues with Flight Plan/K2D2 when using this + 2.5X mod /s
Had a ton of fun just now, thanks contributors
Hmm, I have some ideas, but I know not how helpful they would be
A real time shader editor in game would be immensely useful tho
didn't Lux make something like that?
Textures Utilities Reloaded. Contribute to LuxStice/TUX development by creating an account on GitHub.
I didn't look into it too much though
what part exactly are you guys stuck on?
Could anyone explain to my what the purpose of the planet shader is for? Is it like parallax?
well, yes, and no
it's for all of the rendering of the planet's surface when you're close to it
like, it does literally everything
not very helpful 😆
it basically renders the planet, without it, the planet cannot be rendered properly
so its pretty essential
I’m trying to set up kerbin in unity so it’s exactly like how it is in the game I’m hoping that when I change the properties of the shader you will be able to see them real time in the editor would this work?
Nope :/
We dont have the shaders code for that
any chance someone could quickly run over how to change the shader properties for a CB and then mod it into the game?
you can easily change values at runtime with Reflektor or Unity Explorer
if you want to write some more complex code for it, then it's better to make a full mod project with https://github.com/SpaceWarpDev/SpaceWarp.Template
I would add that we are talking about more than one hundred parameters so even fiddling with them would hardly help you
I mean, it’s necessary, but the hard part is making sense of them
?
Uhhh
I never actually tested at 10x
Hey, I was looking at getting back into this, and it seems this is the current place where research on planet creation is happening. What developments have been made in the time I was gone? I see the PQS shader has been completely rewritten since I last played, and it can't be read by AssetStudio anymore, does anyone have information on it?
The newer versions of Unity don't work with the outdated original AssetStudio, but you can grab this fork: https://github.com/aelurum/AssetStudio
Other than that, I don't think anyone here got much further than you originally did, we all got stuck on the local space shader
We did try to ask the devs for help but so far we didn't get any info, which makes sense considering they'll probably be rewriting a lot of this stuff
Any idea which file that shader is in?
I can check
I just load the full game folder in AS
ah actually sorry, seems like even the fork doesn't read shader files, in that case, you can use https://github.com/AssetRipper/AssetRipper
and the file should be sharedshaders_assets_all.bundle
I just finished reading this whole thread from top to bottom.
Legendary work @frigid current et all 😄 Thanks for blazing the trail.
Scaled space shader was pretty straightforward.
Localspace shader I can't even see where it exactly gets mesh data from.
In RenderDoc it looks like it gets empty verts in the vert shader and I'm guessing it looks up the actual data in the compute buffer or something.
thats a lot of reading.
Near the ground on kerbin, CelestialBody_Local runs 4 times in the local cam
- First with water color integrated. I suspect this is for when too far away to render the ocean mesh
- Again without the water color. This clobbers the previous draw. I suspect this is when rendering the ocean surface so that the area underneath looks like sand instead of more water.
- Three more times, once for each planet decal.
It does some more work in the scaled space camera, one step looks like it generates some decal mask on an R8.
not sure if you've seen this talk yet, but it's relatively informative: https://www.youtube.com/watch?v=kvytgzvqlgQ
Join us for a guided panel discussion with developers from Intercept Games, who will talk through the process and challenges of creating fully spherical planets in Kerbal Space Program 2. Artists and engineers describe the steps that went into recreating a fan-favorite celestial body from the mesh up using the Unity game engine with new tools, n...
Oh, I thought I saw that but I guess I remembered an older one.
there's also one for KSP1 from like 2013
@sweet terrace Might be worth posting your findings here
If not anything else, it's gonna be interesting to read through
I'm working on Planety again, and will post there.
