Jump to content

[1.2] PlanetShine - v0.2.5.2 stable - v0.5 experimental [4 October 2016]


Valerian

Recommended Posts

Downloading now. I've been wanting this as a stock feature since I started playing. But I'm happy to get it as a mod too!

Thanks for making this.

BTW, are you going to use AVC (Add-on Version Checker)? I like how it makes it super-easy to see which mods have updated versions.

Thank you.

Yes I had already planned to use it, too many things to do >_<

- - - Updated - - -

So this effectively replaces AmbientLightShifter (not the one from Blizzy)?

Downloading now all the same, I lurve me some darkness in space.

Yes it does replace it.

Link to comment
Share on other sites

That is perfect, sir, have some rep :)

Is the new name of your mod in any case related to a cult album from Solar Fields ?

Thank you!

No at all, it's related to the real word definition of "planetshine".

(I'm now listening to it, "Earthshine" by Solar Fields, thank you for the discovery! :D)

Edited by Valerian
Link to comment
Share on other sites

I want you to know, I love you.

I'm not sure I've ever really loved anyone appropriately. Just the way they made me feel, you know? Never a kind of true, selfless devotion to the total wellbeing of another person love. But you, I want you to have everything in life you want and always be happy.

I love you.

(downloading now)

Link to comment
Share on other sites

I want you to know, I love you.

I'm not sure I've ever really loved anyone appropriately. Just the way they made me feel, you know? Never a kind of true, selfless devotion to the total wellbeing of another person love. But you, I want you to have everything in life you want and always be happy.

I love you.

(downloading now)

Thank you lol, I love you too!

Link to comment
Share on other sites

Version 0.1.4 released with "KSP Add-on Version Checker" included: you won't need to manually check for updates anymore!

I plan to update it almost everyday for at least a week probably.

Could someone help me by explaining how I could implement a diffuse wrap shader for simulating an area light? I want to avoid using 3 lights for that.

Link to comment
Share on other sites


Changelog:
V0.1.4 - 2014-10-15
- Added support for Add-on Version Checker and included "MiniAVC"
- Added minimal debug menu to toggle the effects (requires Toolbar)
- Performance improvement: forced vertex lights

Love these changes, both the MiniAVC, and the toggle thing, so i can check whats going on :cool:

Link to comment
Share on other sites

Could someone help me by explaining how I could implement a diffuse wrap shader for simulating an area light? I want to avoid using 3 lights for that.

I hadn't looked into it at all yet but this was actually something I was going to try soon. My theory was use this trick and some code from the Reflective Surfaces mod to replace the base KSP shaders with versions that include an extra texture lookup for shine contribution.

I was going to use a 2D LUT with one axis as altitude and the other as (surfacenormal dot localgravityup) for the light contribution. That would let me spread it around the model proportional to how large the apparent angular size of the planet was, and how much atmosphere, if any, was around the ship. (since a dot product gives you a result from -1 to 1 if both vectors are normalized, you have information on light angle all the way around the model. shaders almost always throw away anything less than 0 because that's assumed to be in shadow, but we can exploit it for a cheap directional-area light effect.)

I knocked up a rough example for Kerbin:

c32wdeS.jpg

Vertical axis is altitude, not to scale. The white tick at the midpoint represents 69km, the point at which ambient light would start to come from both below and above. Bottom of the image would be sea level, and the top of the image would be some arbitrary altitude (you use 4x planet radius which seems good).

Horizontal axis is just the contour of the model. Above the atmosphere, light only comes from below (left side of image), but the closer you get to sea level/the ground, the blue light would begin to come from above (farther to the right of center) and the light from below would become more earthy. I picked brown, but for most of Kerbin I guess it would either be green or dark ocean blue.

Edited by Lunaran
typed some more
Link to comment
Share on other sites

The 2d look-up texture certainly should work.

You could probably get away with just having one texture for all planets that describes in RGB the amount of light from the ground, the atmosphere and heavenly objects. You could then use that to modulate either a fixed planet/atmosphere colour or per-planet ground colour texture.

EDIT: Though the different atmosphere densities may give a bit of a wonky result.

Link to comment
Share on other sites

How would you handle ambient sunrise/sunset lighting on or near the surface?

I'm not sure, because I just realized that "vacuumAmbientColor" didn't work on the surface of planets with atmosphere, I will need to work a bit on it.

When I get it to work I will add sunrise and sunset ambient lights for sure, on the ground as well as in space.

Link to comment
Share on other sites

Ok, this mod might get bigger than what I planned, it might completely handle all ambient lights, whatever the altitude, orbit or landed, and for the different times like sunrise and sunset. A full moon will illuminate the night, and no moon will mean pitch black.

Link to comment
Share on other sites

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