Jump to content

Use unity impostors for environment props


Recommended Posts

While playing KSP2 I noticed more than once the prop loading that really takes the immersion out of it. Often while landing on a planet I see a circular area of props with quite clear boundaries expanding below me in real time. And after landing, you can see this picture

Spoiler

900KerbalSpaceProgram20.png

Because of the far distance to the horizon, the beauty of the scenery is compromised, because the prop generation area is smaller than this distance. Ideally, the player expects to see rocks to the horizon. But this is not physically feasible due to performance limitations. That's why the Unity impostors comes to the rescue

https://assetstore.unity.com/packages/tools/utilities/impostors-runtime-optimization-188562

In simple words instead of generating 3d meshes, the impostor system generates a 2d sprite of your object, which requires less resources. The sprite of the object is practically indistinguishable from itself at a far distance. So you can increase the drawing distance and the number of objects on the scene with minimal impact on performance. Stones on the scene do not have exotic complex geometry and their sprites can be generated without problems and be indistinguishable even at some smaller drawing distance than now
Now during landing props will be rendered earlier and smoothly increase in detail as they approach the surface so that the moment of abrupt transition of the prop to the drawing radius will not be noticeable. Landscapes on planets will become more picturesque, because with greater rendering range will increase the number of small details in the picture and increase realism of scene

Link to comment
Share on other sites

This would make sense. Many old school flight and driving sims used this style of props for scenery that you didn't need to directly interact with. As time and tech progressed, this use of scenery props changed from almost all props to the props where it didn't matter if it was 3d or not. 

Link to comment
Share on other sites

1 hour ago, shdwlrd said:

Many old school flight and driving sims used this style of props for scenery that you didn't need to directly interact with

It is good that you said about driving and flight sims. In impostors' description in the link was said, that this system doesn't work well as expected with these types of game because of fast-paced camera movement. System will regenerate impostors for new angle of view  every time it changes significantly. But I believe that for KSP2 is nuance. I suggest to generate impostors for far distant props. You need to drive over planet surface of a significant distance to change angle of view to regenerate impostors,  with flight above surface impostors' regeneration will happen more but not significantly. The same can be said for an overhead view of the scenery, such as landing.  So I think that it isn't big problem if you use impostor for distant objects

Link to comment
Share on other sites

1 hour ago, Vortygont said:

It is good that you said about driving and flight sims. In impostors' description in the link was said, that this system doesn't work well as expected with these types of game because of fast-paced camera movement. System will regenerate impostors for new angle of view  every time it changes significantly

It was the only real method of doing 3d games at the time. (Think the original Doom or Micropose Flight sim era of 3d games.) Some of those old tricks could still work for KSP.  The planets are hand created and decorated. It wouldn't be difficult to but some rough sprites in at certain areas and altitudes for terrain features and scatter.

It's the LOD transitions that will make or break the effect though. If not set right, you will see the sprites move, disappear, or 3d objects growing out if the sprites. The sprites will have to stay long enough for the 3d models load, but disappear when you would expect to see the 3d transition. 

Example would be flying around Kerbin. You don't really need to see really detailed sprites on something 50km away. Just that something is there. You really should start making out the details at around 3-5km away. You would expect to start seeing 3d details at around 1km getting sharper as you get closer.

Link to comment
Share on other sites

I imagine you'd get "good enough" results for far render distance with one billboard constrained to yawwing and one overhead static render?

another problem to consider is that of shadows though especially at sunrise/sunset.

those might be difficult to get looking right.

Link to comment
Share on other sites

On 10/5/2023 at 2:07 PM, Vortygont said:

In simple words instead of generating 3d meshes, the impostor system generates a 2d sprite of your object, which requires less resources.

I'm not sure this is true in this case. Sure raw 2D sprite require less than raw 3D mesh, but that isn't what we have. The terrain system in KSP isn't raw 3D mesh, it is the PQS system. I don't know the internal workings of that system so I would hesitate to say a 2D sprite system would necessarily entail fewer resources/performance after accounting for the calculations required to swap them in/out and adjust for things mentioned above like shadows, consistent placement, or other things required to make it look okay.

Instead of implementing a new 2D system, why not tweak the view distance level of detail to obfuscate the load distance? Perhaps split assets into different distance load groups so some of them load at different distances so there is no sharp boundary.

Link to comment
Share on other sites

14 hours ago, Barrackar said:

I'm not sure this is true in this case. Sure raw 2D sprite require less than raw 3D mesh, but that isn't what we have. The terrain system in KSP isn't raw 3D mesh, it is the PQS system. I don't know the internal workings of that system so I would hesitate to say a 2D sprite system would necessarily entail fewer resources/performance after accounting for the calculations required to swap them in/out and adjust for things mentioned above like shadows, consistent placement, or other things required to make it look okay.

Instead of implementing a new 2D system, why not tweak the view distance level of detail to obfuscate the load distance? Perhaps split assets into different distance load groups so some of them load at different distances so there is no sharp boundary.

To clarify, the suggestion is not to render distant terrain itself (pqs) as a 2d sprite, but rather the objects (rocks, trees, grasses etc) scattered procedurally on top of it, to break the "circle of terrain scatter" effect that is currently very clear to see when flying close to the ground or driving.

Link to comment
Share on other sites

Yes and this issue has been annoying me visually both in KSP2 and in Parallax since it basically uses a similar enviromental scattering system. They could, perhaps, make the render distance adjustable so that people with more beefy machines can enjoy better scenes on the surface and people playing on weaker ones can turn it down a bit so they can have better performance.

One thing I would like to mention here, however, is that Parallax bundles multiple rocks into one object so the prop scattering system treats them as one single object, making performance better without downgrading the visual effects too much. I hope the same gets added to the base game of KSP2, too. As mentioned before, it would be better if it gets toggleable!

(The first suggestion also applies to Parallax.)

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

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