Jump to content

[1.12.x] Parallax, A PBR Terrain Shader [1.3.0]


Gameslinx
 Share

Recommended Posts

 

68747470733a2f2f692e696d6775722e636f6d2f

Parallax

Parallax is a custom terrain shader for Kerbal Space Program that combines tessellation and displacement mapping to create realistic planetary surfaces.

Watch the trailer here:

 

Features Overview

Parallax completely replaces the terrain shader used in the normal game in favour of more and better features, including:

  • Tessellation
  • Self-shadowing
  • Accurate lighting
  • Accurate normal mapping
  • Support for multiple lights
  • Reflections
  • Specular highlights
  • Metallic materials
  • Influence mapping

Improvements

unknown.png

 

The shader that Squad uses for Kerbal Space Program is extremely limited. You can only assign 2 textures that work unless you opt to use an extremely complicated 'Atlas' shader that was introduced in 1.9. We will pretend that the Atlas shader doesn't exist because it's only used on Kerbin and it is extremely unoptimized.

Parallax improves upon the stock shader in a number of ways, for example:

  • Normal mapped lighting is accurate and faces the right way on a surface at any angle
  • Tessellation allows surfaces to have much more complexity, allowing for the creation of lifelike planet surfaces
  • Texture blending is a much smoother transition and varies based on the distance from the camera
  • You can have a much greater amount of control over the planet - You have a low, mid, high and steep texture to use
  • Complete control over how much colour of a texture to apply to the surface VS how much colour of the surface to retain (using an influence map). This prevents your grass from changing colour on brown terrain, but lets you change the sand colour as it varies with the planet's surface colour.
  • Reflections are more accurate
  • No lines between texture levels, unlike the Stock shader

Availabity

8uXLzfR.jpg

System Requirements:

Minimum:

  • CPU: Parallax does not have much of a CPU impact, you'll be fine
  • GPU: NVIDIA GT 960M (or AMD equivalent)
  • RAM: 4GB
  • Shader model 3.0

Recommended:

  • CPU: Parallax does not have much of a CPU impact, you'll be fine
  • GPU: NVIDIA GT 970M (or AMD equivalent)
  • RAM: 6GB
  • Shader model 5.0

You can follow Parallax's development here: https://github.com/Gameslinx/Tessellation/

FAQ

xhPoNeE.jpg

Right now, there are a few frequently asked questions. I hope I can answer some of them here:

  1. What is the performance impact?
    • You can expect to run Parallax fairly well on a GT 960M or better.
  2. Is this for stock?
    • Yes! This also works on planet mods that support it.
  3. Why are lots of lights laggy?
    • For some reason, KSP uses Unity's "Forward Rendering" path instead of the "Deferred Rendering" path. This means that for every pixel light in the scene, the tessellation is re-calculated. With lots of lights, this can add up very quickly. Until KSP moves to the Deferred rendering path, there is nothing I can do about this.
  4. Do I need a NASA Supercomputer?
    • No
  5. Does this work with EVE and Scatterer?
    • Yes. Parallax was developed alongside Scatterer, so I recommend for the best results you use them both together.
  6. Can I change the settings?
    • There is a config within the Parallax folder. This controls the quality and amount of tessellation. You can turn it off, too.
  7. Will you release documentation for modders?
    • Yes, documentation is in the works and will be updated frequently on the github wiki.
  8. Does this work with Rescale / Sigma Dimensions?
    • Low scale values are mostly safe, but as you increase the size of the planet you will notice the tessellation quality start to degrade
  9. Can I use textures from Parallax_StockTextures in my own configs?
    • While the license does allow you to use them, I would much prefer if you don't. The stock textures are to improve the stock game. I don't want to see loads of config packs using those textures because it takes away the uniqueness of the ones I created for the stock planets. Please - Don't be lazy, make your own.

Optimization - On Demand

Parallax uses a form of Load-On-Demand to massively reduce the amount of memory the mod uses at once. Here are some of the key features:

  • Textures are only loaded for the planet you are currently in the SOI of
  • Textures are unloaded when you leave that planet's SOI
  • Texture loading takes mere milliseconds (You can find this information in the log)
  • Supports DDS loading - DXT1, DXT5 and DXT5_NM
  • RAM usage reduced from ~8GB to ~3.5GB on the stock config

Optimization - Adaptive Parallax

unknown.png

Texture sampling in a shader is expensive. When the mod was initially released, there were 61 texture samples every pixel, every frame. This used a lot of GPU power and it was inefficient. Included in update 1.1.0 is my method of massively reducing this amount of samples. There is no need sampling textures that won't be seen in that region on the planet.

Luckily, KSP splits the terrain into quads, and each of these can be assigned its own material. By splitting up the shader into 5 separate shaders, the mod can use simplified versions where necessary. On flat land, only 25 texture samples are needed. On average, the performance has doubled since 1.0!

Download

VhZGXQO.png

You can download Parallax for KSP 1.12.x here:

You will not get help if you do not upload your KSP.log in your error reports

Donations

6V6Oxpo.png

Parallax took me months to develop. Not only that, but I had to learn an entirely new programming language (Unity CG) and familiarize myself with Unity - neither of which are simple! It's been an incredibly fun (and sometimes frustrating!) journey developing this mod, so I would like to thank those of you who have been supporting the mod since its beginning and those of you who choose to support me going forward. Should you donate, you will be helping me through my university studies!

Donations are by no means asked for, but are greatly appreciated. Thank you for downloading the mod or if you're a long time supporter, thank you for sticking with it throughout its development :)

Paypal Patreon Logo by laprasking on DeviantArt

Licensing

7MSzR9y.png

Parallax is licensed under Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).

This means that you are free to share, copy and redistribute the material in any medium or format under the following conditions:

  1. Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  2. NonCommercial — You may not use the material for commercial purposes.
  3. NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

From: https://creativecommons.org/licenses/by-nc-nd/4.0

Edited by Gameslinx
1.3.0
Link to comment
Share on other sites

3 hours ago, Gameslinx said:
  • Intel i9 9900k, 5.0Ghz
  • RTX 2080 Super
  • 32GB DDR4

Hey lookie we have nearly identical systems.

Anyhow, I am a huge fan of this.  So much so the Kopernicus option to disable Ultra shaders basically only exists because I wanted this to work.

I'd subscribe/Donate, but that mobo/GPU replacement left me pretty broke for the month.  I fully endorse this though and would love to see it more widely used.

Edited by R-T-B
Link to comment
Share on other sites

you did such a great job @Gameslinx

I can see what I can do about donations

On 9/20/2020 at 11:22 AM, Gameslinx said:

snip

I'm confuse does this mean that we won't be able to use it in our KSP videos or is it we aren't allowed to allow downloads anywhere else.

Edited by Guest
calmed down tone
Link to comment
Share on other sites

1 hour ago, Gameslinx said:

Parallax is licensed under All Rights Reserved.

This means:

  • You cannot redistribute my work
  • You cannot use my work in another project
  • You cannot create derivatives of my work
  • I reserve all the rights to my work
15 minutes ago, The Doodling Astronaut said:

I'm confuse does this mean that we won't be able to use it in our KSP videos or is it we aren't allowed to allow downloads anywhere else.

It means you're not allowed to put this up for downloading elsewhere (if you're gonna share it, only link to where Linx put it), not allowed to make another mod out of it, make it a feature or dependency of another mod (this may count as derivatives), or release any edits you make to its files. Once it is released with Beyond Home, you'll get to use it in cinematics. Simply using Parallax and playing the game is okay. That's the typical situation with ARR licensed mods.

Edited by JadeOfMaar
Link to comment
Share on other sites

14 minutes ago, The Doodling Astronaut said:

I'm confuse does this mean that we won't be able to use it in our KSP videos or is it we aren't allowed to allow downloads anywhere else.

Feel free to use it in videos!

What the license means is you can't share something (like a file) from inside the mod elsewhere.

It only really concerns other modders - You can't modify it and release it somewhere else. It's basically "this is mine". Videos, screenshots, and whatever else is perfectly fine!

Link to comment
Share on other sites

Looks absolutely fantastic, @Gameslinx!  I very much look forward to melting my computer when this releases.  (7700K @ 4.8ghz, 64GB RAM, 1070Ti, but I only play at 1080).

I've moved this to Add-on development for now.  Ping me or report/post in the "move my thread...thread" when it officially releases!

Link to comment
Share on other sites

I'm not sure how I feel about this having an ARR license. It makes sense in the case of Beyond Home, but for an API/framework mod like this that's just code without any assets, it seems excessive and will only cause problems. And if @Gameslinx vanishes without a trace like so many mod authors often do and the links die, then the planet packs that use it will be in a terrible situation.

Edited by coyotesfrontier
Link to comment
Share on other sites

4 minutes ago, coyotesfrontier said:

I'm not sure how I feel about this having an ARR license. It makes sense in the case of Beyond Home, but for an API/framework mod like this that's just code without any assets, it seems excessive and will only cause problems. And if @Gameslinx vanishes without a trace like so many mod authors often do and the links die, then the planet packs that use it will be in a terrible situation.

For now, the license will remain ARR, but when I separate the assets into the Beyond Home github it may change - it will be revised on release.

The ARR license is mainly for people outside of the KSP community who take a liking to the shader because the shader works for any unity game and I don't want people taking it for themselves.

Edited by Gameslinx
Link to comment
Share on other sites

I refuse to believe that is KSP.    Gorgeous.

5 minutes ago, coyotesfrontier said:

I'm not sure how I feel about this having an ARR license. It makes sense in the case of Beyond Home, but for an API/framework mod like this that's just code without any assets, it seems excessive and will only cause problems. And if @Gameslinx vanishes without a trace like so many mod authors often do and the links die, then the planet packs that use it will be in a terrible situation.

Them's the breaks.   It's up to the mod author's discretion how they want to license their work. 

Link to comment
Share on other sites

6 minutes ago, Gargamel said:

I refuse to believe that is KSP.    Gorgeous.

Them's the breaks.   It's up to the mod author's discretion how they want to license their work. 

It is indeed hard to comprehend we are talking about the same game here. Apperently there was a lot of hidden potential after the KSP 1.8 release that wasn't fully used by Squad for what ever reason. Good to see someone with talent saw an opportunity to explore how far he could push it.

I have one question, will ksp kerbals actualy be able to walk it or will it just be eye candy illusion which disapears the moment you try to travel it?

Edited by FreeThinker
Link to comment
Share on other sites

2 minutes ago, FreeThinker said:

It is indeed hard to comprehend we are talking the same game here. Apperently there was a lot of hidden potential after the KSP 1.8 release that wasn't fully used by Squad for what ever reason. Good to see someone with talent saw an opportunity to explore how far he could push it.

I had to hook into the existing terrain system and subdivide the nearby terrain tiles (quads) to get more vertices to play with because tessellation is limited to a factor of 64 and it still wasn't enough!

That took a very long time to do because I wasn't able to contact Mu who wrote it, so I had to figure a lot of that out for myself! 

I had to work around a lot of limitations in the game I didn't even knew existed! I never knew I'd even get it working!

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.

 Share

×
×
  • Create New...