Jump to content

[1.12.x] Parallax - PBR Terrain and Surface Objects [2.0.8]


Gameslinx

Recommended Posts

On 6/8/2024 at 7:19 PM, Fizz said:

In case it matters, my system is running Linux Mint 21.  So it'll be using OpenGL, not DirectX.

I know that an earlier version of Parallax 2 did run on my system several months ago (i was definitely surrounded by bubbles on Eve, lol),  but i removed it since i was experiencing some other quirks. 

Those are apparently fixed in the newest version, so a week ago i though i'd give it another go.  But i can't get any actual gameplay going, even though no errors are indicated and i can load to the space center. 

-Fizz

Does anyone have any new thoughts on my particular issue?  Fundamentally, Parallax 2 seems to be installed and loads properly, but it always crashes after i the space center, after loading my game.

Also, with Parallax 1, it seems like something has cleared out my debris.  I had plans for my debris but it seems gone now.  Can i get it back?

-Fizz

Link to comment
Share on other sites

Hello, despite installing parallax seemingly correctly, as shown in the video, when i launch a flight there is no tree nor grass. When pressing ctrl + P i get a popup saying "body kerbin is not parallax configured". What should i do ?

Link to comment
Share on other sites

Parallax 2.0.7

MYXMLE4.png

This is a small update for Parallax which adds compatibility with the Deferred mod by @blackrack
Changelog

Support is fairly loose, with much better support for deferred rendering in the Parallax rewrite that I'm still working on. I'll have more updates on that soon. For now, go and enjoy KSP with deferred rendering :D 

Link to comment
Share on other sites

Nice one Linx!

Honestly, you got this out quick, just downloaded it. Should be cool to see this working with Blackrack's deferred rendering!
Looking forward to your progress on your rewrite, will have to sub on Patreon soon! :)

Edited by JTheDoc
Link to comment
Share on other sites

10 minutes ago, JTheDoc said:

Nice one Linx!

Honestly, you got this out quick, just downloaded it. Should be cool to see this working with Blackrack's deferred rendering!
Looking forward to your progress on your rewrite, will have to sub on Patreon soon! :)

Cheers! It would have been out sooner but I had to switch projects and let's just say this one is a bit of a mess! :P

Fingers crossed everything works well. I checked out each of the planets to make sure they all looked good. If there is anything that looks out of place let me know. If it's anything major, it won't be fixed until the rewrite now

Link to comment
Share on other sites

@Gameslinx The new GitHub release for the fixed CKAN issue seems to be bugged. I was able to download Parallax-2.0.7.zip and Parallax_StockTextures-2.0.7.zip but Parallax_ScatterTextures-2.0.7.zip shows me the following error message:
 

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<Error>
<Code>BlobNotFound</Code>
<Message>
The specified blob does not exist. RequestId:174d5803-901e-005a-42e4-ca87b2000000 Time:2024-06-30T11:55:06.9697521Z
</Message>
</Error>

 

Link to comment
Share on other sites

14 minutes ago, feral_fenrir said:

@Gameslinx The new GitHub release for the fixed CKAN issue seems to be bugged. I was able to download Parallax-2.0.7.zip and Parallax_StockTextures-2.0.7.zip but Parallax_ScatterTextures-2.0.7.zip shows me the following error message:
 

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<Error>
<Code>BlobNotFound</Code>
<Message>
The specified blob does not exist. RequestId:174d5803-901e-005a-42e4-ca87b2000000 Time:2024-06-30T11:55:06.9697521Z
</Message>
</Error>

 

About 33 minutes ago I updated the release to replace the .zip files with files that CKAN is compatible with (CKAN does not support Deflate64). Did this error appear after that?

Link to comment
Share on other sites

2 minutes ago, Gameslinx said:

About 33 minutes ago I updated the release to replace the .zip files with files that CKAN is compatible with (CKAN does not support Deflate64). Did this error appear after that?

The current file posted on the github for "Parallax_ScatterTextures-2.0.7.zip" is giving that error instead of downloading the file

Link to comment
Share on other sites

7 minutes ago, feral_fenrir said:

Yeah, this is after the new release for the CKAN issue.

I tried different browsers/incognito to see if it was some weird GitHub session/cache issue but I get the same "BlobNotFound" error for just the Scatter Textures zip file.

Edit: http://status.ksp-ckan.space/ is also showing an error as of 15 mins ago.

Miserable.

Cheers, I'm going to upload the fixed zips as a new release instead. CKAN probably did not pick up that the old one changed

13 minutes ago, feral_fenrir said:

Yeah, this is after the new release for the CKAN issue.

I tried different browsers/incognito to see if it was some weird GitHub session/cache issue but I get the same "BlobNotFound" error for just the Scatter Textures zip file.

Edit: http://status.ksp-ckan.space/ is also showing an error as of 15 mins ago.

Release is up now

Link to comment
Share on other sites

Posted (edited)

Hi, I've been having an issue where I'll be in mid-flight over some body (kerbin or kopernicus planet) and the game suddenly freezes up on me and drops to 1 fps with no warning. It happens only when parallax is installed and regardless of my config settings, I even tried turning tessellation off to no avail. Edit: I should mention it normally runs smoothly and the mod works fine until this occurs. 

KSP.log

Edited by Rulingmoss55
I felt the added context was needed
Link to comment
Share on other sites

Hi, I've been using Parallax for a while and have noticed a - somewhat annoying - quirk with the lights on my setup (Ryzen 7 3700X / RTX3070 Ti / 48GB of RAM).
Here are the tests I did:
- Random test bench made from reactors and lights (with emission enabled as I use them as spotlights / navigation lights usually),
- Pixel Light Count at 64,
- Tests on Stock, Stock & Parallax, Stock & Parallax & Deferred instances.
In Stock I'm running at 38 FPS (perfectly fine), in Stock + Parallax I drop to 18 as soon as the lights are on and in Stock + Parallax + Deferred I drop to 21 with lights then 18 with lights and engines (Whiplash / Panther on AB).

Playing with the Pixel Light Count improves performance (at 0 I'm at 38 FPS) but also makes the lights disappear, which I don't want.
Obviously, getting rid of Parallax solves all the issues - and I can run at 38 on a fully graphics modded instance - but it would be a shame to go without such a mod.


I've tried playing with the Parallax settings but I don't want to mess it up. If anyone has any advice, I'd love to hear it.

Link to comment
Share on other sites

7 hours ago, Rulingmoss55 said:

Hi, I've been having an issue where I'll be in mid-flight over some body (kerbin or kopernicus planet) and the game suddenly freezes up on me and drops to 1 fps with no warning. It happens only when parallax is installed and regardless of my config settings, I even tried turning tessellation off to no avail. Edit: I should mention it normally runs smoothly and the mod works fine until this occurs. 

KSP.log

Thanks for the report. Your FPS drop is caused by parallax seemingly spectacularly breaking for reasons I'm unsure. The last lines of the log before the errors is "Active Vessel is about to crash. Cannot save". The vessel didn't crash because the log doesn't contain anything about parts being destroyed, so I'm assuming this is just caused by pressing F5 below 500m above the terrain and isn't related to the error.

This should be fixed in the rewrite I'm working on which majorly simplifies the process that's failing here. I noticed you're using the lifeless Eve patch and some textures couldn't be found according to your log. The best thing I can recommend is reinstalling Parallax and foregoing the lifeless eve patch and seeing if that stops the issue.

29 minutes ago, Nyxilo said:

Playing with the Pixel Light Count improves performance (at 0 I'm at 38 FPS) but also makes the lights disappear, which I don't want.
Obviously, getting rid of Parallax solves all the issues - and I can run at 38 on a fully graphics modded instance - but it would be a shame to go without such a mod.


I've tried playing with the Parallax settings but I don't want to mess it up. If anyone has any advice, I'd love to hear it.

Thanks for the info. Blackrack mentioned that the KSP reflection probe (a fancy camera that renders a spherical view, roughly positioned on the craft) still renders in Forward even when using Deferred. Without Parallax this still happens but is less noticeable, but with parallax it can impact performance quite harshly because the reflection probe camera causes the terrain to render multiple times for each light which includes performing the tessellation again.

He mentioned a potential solution for the reflection probe with a custom implementation that will render using deferred, so this problem might go away in the future. But for now, it's probably because of the reflections. I'm not sure if Deferred forces reflections on (i would expect it to, considering it contributes significantly to the lighting of the scene), but try disabling them just in case or at least turning the refresh mode and resolution down. Let me know if that helps

Link to comment
Share on other sites

38 minutes ago, Gameslinx said:

He mentioned a potential solution for the reflection probe with a custom implementation that will render using deferred, so this problem might go away in the future. But for now, it's probably because of the reflections. I'm not sure if Deferred forces reflections on (i would expect it to, considering it contributes significantly to the lighting of the scene), but try disabling them just in case or at least turning the refresh mode and resolution down. Let me know if that helps

Thank you! I've set the Reflection Refresh Mode to Low (everything looks horrible if disabled) with all the other settings cranked all the way up, and it works perfectly.  And, apart from the huge performance impact between "Low" and "Every Frame" mode, I don't really see any difference. I'll stick with it until the problem is - perhaps - solved.

Link to comment
Share on other sites

14 minutes ago, Nyxilo said:

Thank you! I've set the Reflection Refresh Mode to Low (everything looks horrible if disabled) with all the other settings cranked all the way up, and it works perfectly.  And, apart from the huge performance impact between "Low" and "Every Frame" mode, I don't really see any difference. I'll stick with it until the problem is - perhaps - solved.

Awesome. It's reassuring to know that the reflection probe is the reason. I will pass this info on

Link to comment
Share on other sites

On 5/5/2024 at 10:14 PM, Gameslinx said:

Parallax Development Update

It's been a while since I've posted progress on my projects, so this is quite a meaty one!

What am I working on?

Over the last few months, I've been rewriting the entire mod from scratch including the shaders and architecture with the goal of massively improving performance, memory usage and eliminating annoying bugs. I've been successful so far with all of these to the point where I feel like I can share my progress. I can't provide any detailed analysis just yet as the mod is still evolving, but here are some of the key changes that are coming.

Performance - Terrain Shader

Performance is key with Parallax. Its original goal was to provide a terrain shader that was more flexible than and outperformed the stock shader. On some systems this is true, but we can do better than that! With the upcoming rewrite, both tessellation performance and texture performance are hugely improved. Not only does the current public version of Parallax use too much GPU bandwidth (something the KSP 2 terrain shader is notoriously terrible for), but it also does far too much in the wrong shader stages which worsens performance, more so on systems running OpenGL because of its awful vertex performance. Expect some major improvements to the terrain shader which will free up performance for things that matter more!

Not only that, but the CPU usage for functions that support the terrain shader have already been massively optimized. Because KSP is so dated, its terrain is not detailed enough to support tessellation at a high enough density that looks good. I've written two mesh subdivision methods over the years to try and counter this, but they have been limited. None of the previous methods have satisfied all of these requirements:

  1. Gapless mesh (no T junctions)
  2. Fast / efficient
  3. High mesh detail
  4. Multithreaded

But now after a month of two of experimenting, I've written a multithreaded subdivision scheme using the Unity Jobs system which achieves all four of these requirements. It's also entirely asynchronous which means aside from rendering the mesh at higher detail, there's zero performance loss from the subdivision itself! And it runs in realtime. Here's a gif:

aPmIqzg.gif

Note that the framerate of this video is low because it's a gif. Here's the link to a video that shows this more smoothly: https://i.imgur.com/96HPeBE.mp4

Performance - Scatter System

The scatter system is where most of my time is being spent right now, and there are already a number of optimizations and improvements on the way!

Firstly, instead of doing everything in 'world space' coordinates (which is bad, really bad), the scatter data generation is now entirely in mesh-space. This means that the days of the scatters becoming disconnected from the ground are gone! I've also managed to significantly reduce the VRAM usage of the scatter system by changing how the scatters are applied, which now only apply to visible quads. With the previous implementation this wasn't possible and you were actually generating and storing scatter information for quads that weren't even visible, but thanks to Harmony and some guidance from @Gotmachine this isn't the case anymore.

The scatter shaders themselves have also been rewritten from the ground up. These include a much more streamlined process without the baggage that the previous shaders had - and there was quite a bit, especially since a lot of calculations were done to get around working in world space coordinates all the time. There are further improvements to VRAM usage here by reducing the memory required for each individual scatter object by around 88%. Before, an object's position, rotation and scale were stored as a 4x4 matrix using 64 bytes. This is absolutely unacceptable but sadly a byproduct of using the wrong coordinate system - this has now been reduced to just 8 bytes to store a float3 position, a float rotation and an unsigned integer index (for some internal processing needed elsewhere for aligning objects with the terrain). Combined with the VRAM usage I mentioned earlier, this will be a major part in improving performance and supporting lower tier hardware!

Quality Improvements

With the changes coming to the terrain mesh subdivision, the quality of the terrain tessellation is much better. The current public Parallax version also has a mistake in the biplanar texturing coordinates used for sampling mipmaps which results in slightly blurrier textures. This has been fixed, so expect a noticeable quality bump in the textures themselves. I've also added (cheap) reflection support to the shader which will massively improve the colouration of the terrain on atmospheric bodies which will be more noticeable when Scatterer is not installed.

On the scatter system side of things I've rewritten the procedural noise system and moved it from relying on the terrain system to generating it on the GPU. Not only is this much faster, but the improved implementation allows for much finer detail that isn't tied to the number of vertices in the terrain. This is big news for RSS players but applies to stock scales too. Check out the detail we can get now!

KWNuNve.png

Ignore the cubes - as you can see, things are still very WIP. You can see here there is this weird pixelation of the procedural noise - this is a result of precision errors given the scales we are working at but there is a very nifty workaround for this too. On the technical side, I pass the 'direction to the planet center' to the GPU and it generates the noise from these spherical directions. Since these can be stored CPU-side as doubles, we can define a minimum procedural noise 'frequency' (which is really how large or small the noise appears) and multiply it before the lossy conversion to floats on the GPU. This means we'll have a minimum frequency which we can most likely safely set to 100 (larger for larger planets) which will make these precision errors much, much less prevalent. So, long story short - the pixelation can be largely ignored here. Again, WIP!

However this improvement to how the noise is generated (and the types of noise available) is huge for modders who right now are very limited in how scatter placement and dynamics can vary.

There are 5 noise types that will be available on release and I'm considering adding more if they're required:

S0phzHC.png

There are most likely things that I've forgotten here, since there are seriously a whole bunch of improvements on the way! I'm looking forward to being able to share more in the future and excited to release it when it's ready.

As for when it releases, I'm aiming for within a few months at most if all goes well - but there's a lot going on in my life at the moment, so I can't promise anything!

o7 

This is Fricking impressive bro, i am so excited to see this come out

Link to comment
Share on other sites

Posted (edited)

This update single-handedly brought me back to the game... I the performance improvement for me is like 30%-50% and I'm finally able to get close to real-time physics on my relatively ancient system while running way too many mods (OPM + Other Worlds and at least 200 other mods...). Good work!

PS: What mods, if any, did you use in that Duna base in the trailer? Looks mostly stock, but with some non-stock modules that look interesting...

EDIT: Wait, is 2.0.7 not the re-write with the improved performance? I wonder if I've just gotten that much mileage out of Deferred and things will just get better when the new Parallax drops...

Edited by SpacedInvader
Link to comment
Share on other sites

On 6/29/2024 at 10:30 PM, Gameslinx said:

Cheers! It would have been out sooner but I had to switch projects and let's just say this one is a bit of a mess! :P

Fingers crossed everything works well. I checked out each of the planets to make sure they all looked good. If there is anything that looks out of place let me know. If it's anything major, it won't be fixed until the rewrite now

Isn't 2.0.7 is a rewrite? because you said that rewrite will contain deferred support, and we got it so what next?

Link to comment
Share on other sites

3 minutes ago, Wilhelm von Hermann said:

Isn't 2.0.7 is a rewrite? because you said that rewrite will contain deferred support, and we got it so what next?

Nope, 2.0.7 is a maintenance update which builds directly on 2.0.6, but updates the shaders to support Deferred. The shaders themselves are the same as in the previous versions but contain an extra pass for deferred rendering.

The rewrite is still a WIP and is going to release under a new name, most likely "Parallax Continued", and this version will stay on 2.0.7. I hope that clears up any confusion

Link to comment
Share on other sites

1 minute ago, Gameslinx said:

Nope, 2.0.7 is a maintenance update which builds directly on 2.0.6, but updates the shaders to support Deferred. The shaders themselves are the same as in the previous versions but contain an extra pass for deferred rendering.

The rewrite is still a WIP and is going to release under a new name, most likely "Parallax Continued", and this version will stay on 2.0.7. I hope that clears up any confusion

okay thanks, should we expect perf boost in 3.0? and is there any news about rewrite?

Link to comment
Share on other sites

Posted (edited)
2 minutes ago, Wilhelm von Hermann said:

okay thanks, should we expect perf boost in 3.0? and is there any news about rewrite?

Yes, the performance boost will be major. So far what I've mentioned about the rewrite is in this post: https://forum.kerbalspaceprogram.com/?app=core&module=system&controller=content&do=find&content_class=forums_Topic&content_id=209714&content_commentid=4386744

There's been a ton of progress since then. I'm on to config editing now. Most of the code is in place (except for colliders)

20 minutes ago, SpacedInvader said:

What mods, if any, did you use in that Duna base in the trailer? Looks mostly stock, but with some non-stock modules that look interesting...

It's this (not mine): https://steamcommunity.com/sharedfiles/filedetails/?id=2525535532

Edited by Gameslinx
Link to comment
Share on other sites

42 minutes ago, Gameslinx said:

Yes, the performance boost will be major. So far what I've mentioned about the rewrite is in this post: https://forum.kerbalspaceprogram.com/?app=core&module=system&controller=content&do=find&content_class=forums_Topic&content_id=209714&content_commentid=4386744

There's been a ton of progress since then. I'm on to config editing now. Most of the code is in place (except for colliders)

It's this (not mine): https://steamcommunity.com/sharedfiles/filedetails/?id=2525535532

so that means after configuring 3.0 will be ready for release? will 3.0 be backwards compatible (because i want to save my configs for 2.0, and not updating them, the codind is just not very good for me)?  and by paid phase you mean like blackracks "True Volumetric Clouds" on patreon? i highly appreciate your mods, they very good, but the idea of paid mods not sounds very good for me, i may just at start try mod "for free" and if i like it i may donate 5 bucks for you (like i did for blackrack) 

P.S. if it not already backwards compatible, try make it in patreon release 2 or something like that :)

Link to comment
Share on other sites

5 minutes ago, Wilhelm von Hermann said:

so that means after configuring 3.0 will be ready for release? will 3.0 be backwards compatible (because i want to save my configs for 2.0, and not updating them, the codind is just not very good for me)?  and by paid phase you mean like blackracks "True Volumetric Clouds" on patreon? i highly appreciate your mods, they very good, but the idea of paid mods not sounds very good for me, i may just at start try mod "for free" and if i like it i may donate 5 bucks for you (like i did for blackrack) 

P.S. if it not already backwards compatible, try make it in patreon release 2 or something like that :)

The rewrite won't be backwards compatible - that is the main reason why I'm releasing it separately. Too much of the underlying architecture has changed to support backwards compatibility without another copy of the code (essentially, the old mod). For mod authors I have included tools that will convert the old configs to almost usable new configs, but they will need to add a few extra things to them that I can't predict in the config upgrader. For authors, documentation will be available on my github.

Yes the release will follow a similar structure to blackrack's volumetric clouds, but certainly for a much shorter period of time. I do it because the quality of bug reports sent in is significantly better than opening the floodgates immediately, with the added bonus of being able to put some funds towards any assets or software I might need to buy (trees, textures, etc) for the mod as they are extortionately priced these days. As soon as testing concludes and I'm confident the mod is both feature-complete and reliable, it will release publicly and fully. There is no harm in waiting until that process is complete - it just helps me get that final bit of polish to the project

12 minutes ago, Wilhelm von Hermann said:

so that means after configuring 3.0 will be ready for release?

Here's what I have left to do:

  1. Collider system
  2. Adding deferred support to the rewritten shaders
  3. Finish updating the planet configs (terrain, scatters)
  4. Refresh some assets on Kerbin and potentially Laythe
  5. Closed testing

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...