#Shoemaker (Planet Modding)

1 messages · Page 2 of 1

frigid current
#

Decals smooth the land around them, as can be seen with the island runway in my 2.5x kerbolar system

fossil jetty
#

huh that's interesting

#

why is the KSC a discoverable and the island runway isn't

frigid current
#

Decals and discoverables arent one and the same

#

Decals can be used for discoverables but dont have to

fossil jetty
#

yeah I understand there's no connection between them

frigid current
#

You can put a discoverable at any point ... if you know how to convert lat/long/radius to x/y/z

fossil jetty
#

I was just curious why the island runway isn't one

frigid current
#

I have no clue

#

I feel it should be as well

analog moss
#

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.

fossil jetty
#

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?

analog moss
#

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

fossil jetty
#

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

analog moss
#

its used there on the ksc menu

frigid current
#

Decals deform the surrounding terrain

analog moss
#

PQSSurfaceObject just deletes it it seems.

#

uses a pqs sphere to delete

#

sounds very inefficient

frigid current
#

I don't think the KSC deletes any terrain

#

if it did I wouldn't have the issues with the mountains on the runway

analog moss
#

oh wait im looking at the LOD code

#

just noticed something that might help with the collider issues RenderPlanetCollidersEnabled - graphics setting

frigid current
#

I have zero clue how to texture a planets surface atm

#

This looks promising

#

Part of the array

#

Hold these
0

#

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?

warm panther
#

What's happening?

frigid current
#

I need to understand the shader™️

#

And ive barely ever touched shader programming

ocean mountain
#

im not a shader programmer but i make blender shaders so i can try to help understand them

frigid current
#

If only I could decompile the shader

fossil jetty
#

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

frigid current
#

Unity version is too new

fossil jetty
#

asset ripper with decompile does nothing

#

it just returns the parameters

frigid current
#

Could attempt again ... ig

#

But ive tried like 4 times

#

Using tbe latest prerelease of asset ripper

fossil jetty
#

yeah I don't think it will vary based on the phase of the Moon, sadly

analog moss
fossil jetty
#

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

analog moss
#

would be nice if ckan had a better ui, that way people would stop using badly made mod managers like toucan.

fossil jetty
#

I don't know if I've ever seen anyone actually use it

analog moss
#

people have been using it.

#

it has no dependency management....

analog moss
lavish pike
#

Maybe try the assets from an earlier version before the unity upgrade?

frigid current
#

But we know that they have been doing stuff with the assets

#

I mean the shaders

#

Im pretty sure

fossil jetty
#

and we were trying basically since 0.1.0 to decompile shaders, with no luck

#

not these specific ones, but we did try

frigid current
#

Yeah exporting shaders breaks when set to decompile

frigid current
fossil jetty
frigid current
#

Yeah
I'll be honest, without investing a lot of effort, there is no way to decompile these shaders

fossil jetty
#

but, the mentioned fork just says it's been merged into the main repo

frigid current
#

If we could disassemble it into DX assembly, compile that into bytecode, maybe we could use this

warm panther
#

4 years ago

#

mh

frigid current
#

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

warm panther
#

how do they map, RGBA, XYZW..

frigid current
#

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

warm panther
#

mh yes I'll not bet on it

#

have you found any hint in the code?

frigid current
#

Not really

warm panther
#

Could be related to Vegetation, like in SampleRgbaChannelExcludeMaskJob.Execute?

frigid current
#

Dont think so

frigid current
#

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

warm panther
frigid current
#

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

warm panther
#

This is a big issue

#

if they switch to CBT

frigid current
#

Yeahh

fossil jetty
#

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/

frigid current
#

Alright going to gab unique colors

#

That was decidedly not helpful

warm panther
#

What happened when you zeroed all of them?

frigid current
#

Nothing

warm panther
#

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

frigid current
#

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

warm panther
#

would you mind sharing where you found them?

frigid current
#

Just look at the shaders in the dev branch of KSP2UT

#

there are dummy shaders for both local and scaled space of planets

warm panther
#

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

frigid current
#

The heights arent the issue here

#

I can get heightmaps to work just fine

warm panther
#

Ahhhn, ok

frigid current
#

What I dont understand is the ground texturing

frigid current
#

Yes, the local shader

warm panther
#

just a couple of parameters

frigid current
#

Only a few

twin anvil
#

@frigid current Have you taken a look at how Planety did it? I'm pretty sure the textures worked

fossil jetty
#

Did they? I kinda thought that was the one thing that wasn't working

twin anvil
#

I thought it was atmo that wasn't?

fossil jetty
#

Seems to me like it's the same issue Cheese is having, with the local space shader

frigid current
#

The exact same issue

#

And ive exhausted my list of possibilities for figuring it out

twin anvil
#

I guess you guys already tried begging the devs for help?

fossil jetty
#

yep...

frigid current
#

I wouldn't say begging, but yes

twin anvil
#

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

frigid current
#

What the 700 or so odd parameters to the CelestialBody/Local shader do

#

Okay not 700

#

Closer to somewhere between 100 and 200 iirc

twin anvil
#

I'm guessing you already tried just going and tweaking them and seeing what changes?

frigid current
#

So its a problem of just sheer amount of information

frigid current
#

I also dont know the invariants of the system as they relate to eachother

twin anvil
#

Is all your progress on the github rn?

frigid current
#

I can put my progress on github qhen I get home

twin anvil
#

alr

frigid current
#

Im currently getting ready to bowl

#

I bowl with a group of like 11 others

#

Well family friends

twin anvil
#

Sounds nice

twin anvil
#

@frigid current Any idea which file the shader in question is located? I can try decompiling it, but I need to find it

fossil jetty
#

fyi Cheese was able to decompile it using RenderDoc

#

but I'm pretty sure that's done at runtime

#

nothing else worked

twin anvil
#

Like decompile decompile, or just disassemble?

fossil jetty
#

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

twin anvil
#

Tried this?

#

I assume the result will be a bit like C decompilation though

#

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

fossil jetty
#

this is the result of the first one

#

now lemme try the second one

frigid current
#

Got these same errors when using a similar tool in renderdoc

fossil jetty
#

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.

twin anvil
#

@fossil jetty Did you try changing the file extension?

fossil jetty
#

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

twin anvil
#

You sure it verifies by the magic number?

#

Because it's pretty common in windows programs to do it by extension IIRC

fossil jetty
twin anvil
#

ah

#

bruh flashbang

fossil jetty
#

I can't deal with dark mode, it makes everything hard to read for me

twin anvil
#

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?

frigid current
#

I can but it barely gives me any info

#

At least none that i understand

#

I even examined the stock biome map

twin anvil
frigid current
#

It tells me what the parameters are it just doesnt help me

#

There is just too much

twin anvil
#

I think the approach is just a lot of examining

frigid current
#

Im not even sure if its worth it to put that much time into examining something that will change

twin anvil
#

Do we know how soon?

fossil jetty
#

I would assume this year, but no clue when specifically

frigid current
#

^

twin anvil
#

I mean, you tried the Earth from scratch, right?

#

Maybe modifying Kerbin would be the way to go?

frigid current
#

Maybe?
Its still a lot of effort

twin anvil
#

When roughly will you be able to upload the stuff to github? I'll take a look and see what I can do

frigid current
#

Somewhere between 1 and 4 hours

#

We do 3 hours of bowling and then go somewhere else sometimes

warm panther
#

Are the shaders parameters baked in or are they computed at runtime, atleast partially?

twin anvil
#

Wdym?

#

The parameters are compiled in, the inputs to the parameters are put there at runtime

fossil jetty
#

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

twin anvil
#

I think it's the prefab, no?

frigid current
#

Kerbin_pqs

#

Vall_pqs

#

Eve_pqs

#

Laythe_pqs

#

Those all have references to the material

#

Its called the local space material

frigid current
#

Shit i forgot to push it to github

#

I shall do that first thing tomorrow

twin anvil
#

@frigid current poke

frigid current
#

Just got outta bed, gonna eat breakfast then push it

twin anvil
#

alr

frigid current
#

@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

twin anvil
#

alr

frigid current
twin anvil
#

Btw, who was the one who managed to create a modding environment on Linux?

fossil jetty
#

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

twin anvil
#

ThunderKit is fine, it works on Mac as well

#

Needs some tweaking, but it works

fossil jetty
#

so it should also work when building locally on Linux

#

you might just need PowerShell and Mono installed for some stuff

twin anvil
#

Scratch my message from 14:42, thunderkit doesn't wanna import

#

On the Native unity version anyways

#

And on Wine Unity hub is borked

twin anvil
#

Also I'm getting a fuckton of errors from KSP2 Unity tools

frigid current
#

Show

fossil jetty
twin anvil
#

I did to that

#

Stuff like this

fossil jetty
#

well

#

it's saying it can't update the imported game DLL

#

so something went wrong with the import

twin anvil
#

Now it magically* seems to work
*I checked auto reference on the game DLL

fossil jetty
#

Unity in Wine sounds like a pain in the ass lol

twin anvil
#

It's not in wine now

#

I managed to make it work on Native

fossil jetty
#

oh, interesting

#

what was the issue?

twin anvil
#

I needed to rebuild the TK settings

#

@frigid current How did you open the Kerbin/Jool/etc PQS?

fossil jetty
#

probably in ThunderKit's addressables browser

twin anvil
#

Collections: list is empty

frigid current
#

Ahhhh, yeah that issue

#

That's why I have an empty project with just thunderkit

twin anvil
twin anvil
#

@frigid current What was the thing that wasn't working? Local space?

fossil jetty
#

yes

twin anvil
#

CelestialBodyAssetLoader seems to be responsible for loading that - did you look into that script?

frigid current
#

It's specifically biome texturing with the local space shader

#

I have no idea how that works

twin anvil
#

Biome texturing, okay

twin anvil
frigid current
#

How indexes for the texture array for ground textures are computed

twin anvil
#

@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)

frigid current
#

When I'm not busy, sure

twin anvil
#

Or @fossil jetty if you're available and not going to sleep right now

fossil jetty
#

sure thing

twin anvil
#

@frigid current Do you do some special ritual to get Earth to show up?

finite fable
#

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

frigid current
#

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

fossil jetty
#

I didn't look into it too much though

oak tapir
#

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?

fossil jetty
#

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

oak tapir
#

hmmm

#

ok

#

thank you

fossil jetty
#

not very helpful 😆

ocean mountain
#

so its pretty essential

oak tapir
#

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?

frigid current
#

We dont have the shaders code for that

oak tapir
#

any chance someone could quickly run over how to change the shader properties for a CB and then mod it into the game?

fossil jetty
#

you can easily change values at runtime with Reflektor or Unity Explorer

warm panther
#

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

fossil jetty
#

?

twin anvil
#

@frigid current Is this known?

#

(10x rescale)

frigid current
#

Uhhh
I never actually tested at 10x

twin anvil
#

Understandable

#

I just want to be able to balance the Moon or bust suite

sweet terrace
#

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?

fossil jetty
#

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

sweet terrace
#

Any idea which file that shader is in?

fossil jetty
#

I can check

#

I just load the full game folder in AS

fossil jetty
#

and the file should be sharedshaders_assets_all.bundle

tranquil flume
#

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.

analog moss
#

thats a lot of reading.

tranquil flume
#

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.
fossil jetty
#

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...

▶ Play video
tranquil flume
#

Oh, I thought I saw that but I guess I remembered an older one.

fossil jetty
#

there's also one for KSP1 from like 2013

twin anvil
#

@sweet terrace Might be worth posting your findings here

#

If not anything else, it's gonna be interesting to read through

sweet terrace
#

I'm working on Planety again, and will post there.