Jump to content

[WIP][1.9.x-1.12.x] Scatterer-atmospheric scattering (0.0838 - 14/08/2022) Scattering improvements, in-game atmo generation and multi-sun support


blackrack

Recommended Posts

4 minutes ago, blackrack said:

 

The way I understand it, they do 1 vertex per pixel to maximize the detail onscreen because they displace them later on.

I see, but then we'd also need to have it work for aerial views, so one flat qud won't do. What do we do then?

Hmmm... that actually makes sense... it's quite brilliant actually. You could place them at whatever depth you need them to be at this way. You still get geometry then. I understand why upside-down views wouldn't work though. I think a quick-fix may be to invert the camera matrix and pixel mesh, in certain cases.

Why would it not work for arial views? I'm thinking about a quad that is between 500m-1km wide/tall. 

 

Link to comment
Share on other sites

3 minutes ago, rbray89 said:

Hmmm... that actually makes sense... it's quite brilliant actually. You could place them at whatever depth you need them to be at this way. You still get geometry then. I understand why upside-down views wouldn't work though. I think a quick-fix may be to invert the camera matrix and pixel mesh, in certain cases.

Why would it not work for arial views? I'm thinking about a quad that is between 500m-1km wide/tall. 

 

I was thinking, that well, it needs to be round like the planet.

Link to comment
Share on other sites

33 minutes ago, blackrack said:

It should work but don't quote me on this.

Haha I quoted you ;) ... I'm not asking for official support as I understand we've moved on to KSP 1.0.5 now, but would you kindly offer an opinion for a guy still enjoying his heavily modded 1.0.4 install? I promise you I've been up and down the thread especially 10 pages back from here but didn't see any pictures of similar issues or read anything that sounded like this. Are there any fixes for issues like this? BTW this is in 1.0.4 and aside from these glitches I can confirm the game plays fine and up close the water shaders are flippin' amazing, amazing work!! :D Peace x

 

Link to comment
Share on other sites

How to disable the ocean:

 

public class OceanDisable : PQSMod
    {

        public void Apply(CelestialBody cb)
        {

            PQS pqs = null;
            if (cb != null && cb.pqsController != null)
            {
                pqs = cb.pqsController;
                PQSMaterial = pqs.surfaceMaterial;
            }
            else
            {
                KSPLog.print("No PQS!");
            }
            if (pqs != null)
            {
                this.sphere = pqs;
                this.transform.parent = pqs.transform;
                this.requirements = PQS.ModiferRequirements.Default;
                this.modEnabled = true;
                this.order += 10;

                this.transform.localPosition = Vector3.zero;
                this.transform.localRotation = Quaternion.identity;
                this.transform.localScale = Vector3.one;
            }
        }

        public override void OnSphereActive()
        {
			//This is the ocean
			if(sphere.ChildSpheres != null && sphere.ChildSpheres.Length > 0)
			{
            	sphere.ChildSpheres[0].isFakeBuild = true;
			}
        }

        public void Remove()
        {
            this.sphere = null;
            this.enabled = false;
            this.transform.parent = null;
        }
}

 

Link to comment
Share on other sites

26 minutes ago, Eskandare said:

WOW! Simply beautiful! I have yet to test this out...  ok downloading...

Question... How is Eve's water?

I gave it a very quick config but I tried it to make it look weird and unnatural, like some kind of petroleum jelly, this is more or less how I imagine the "explodium oceans" to be. I made a few webms to show you but the compression codec ruined them so i decided not to upload them. Just go there and take a look

 

13 minutes ago, Space Cowbuoy said:

Haha I quoted you ;) ... I'm not asking for official support as I understand we've moved on to KSP 1.0.5 now, but would you kindly offer an opinion for a guy still enjoying his heavily modded 1.0.4 install? I promise you I've been up and down the thread especially 10 pages back from here but didn't see any pictures of similar issues or read anything that sounded like this. Are there any fixes for issues like this? BTW this is in 1.0.4 and aside from these glitches I can confirm the game plays fine and up close the water shaders are flippin' amazing, amazing work!! :D Peace x

 

I believe this is a simple draw order issue, I will upload a modified dll that allows to change the ocean draw order, play with it and report back.

 

6 minutes ago, rbray89 said:

How to disable the ocean:

 


public class OceanDisable : PQSMod
    {

        public void Apply(CelestialBody cb)
        {

            PQS pqs = null;
            if (cb != null && cb.pqsController != null)
            {
                pqs = cb.pqsController;
                PQSMaterial = pqs.surfaceMaterial;
            }
            else
            {
                KSPLog.print("No PQS!");
            }
            if (pqs != null)
            {
                this.sphere = pqs;
                this.transform.parent = pqs.transform;
                this.requirements = PQS.ModiferRequirements.Default;
                this.modEnabled = true;
                this.order += 10;

                this.transform.localPosition = Vector3.zero;
                this.transform.localRotation = Quaternion.identity;
                this.transform.localScale = Vector3.one;
            }
        }

        public override void OnSphereActive()
        {
			//This is the ocean
			if(sphere.ChildSpheres != null && sphere.ChildSpheres.Length > 0)
			{
            	sphere.ChildSpheres[0].isFakeBuild = true;
			}
        }

        public void Remove()
        {
            this.sphere = null;
            this.enabled = false;
            this.transform.parent = null;
        }
}

 

I will give this a try, if it works well we all get performance improvements.

Do I just create an instance of this and use Apply(CelestialBody) or do I need to add it as a component?

Link to comment
Share on other sites

7 minutes ago, blackrack said:

I will give this a try, if it works well we all get performance improvements.

Do I just create an instance of this and use Apply(CelestialBody) or do I need to add it as a component?

You'll need to create it as a component:
 

GameObject go = new GameObject();
materialPQS = go.AddComponent<OceanDisable>();
materialPQS.Apply(celestialBody);

You won't have to remove the material either now.

Link to comment
Share on other sites

15 minutes ago, rbray89 said:

You'll need to create it as a component:
 


GameObject go = new GameObject();
materialPQS = go.AddComponent<OceanDisable>();
materialPQS.Apply(celestialBody);

You won't have to remove the material either now.

Great, will test it in a bit.

 

16 minutes ago, Red Iron Crown said:

IS THIS EVEN KSP!?

 

Awesome, awesome work on this. I can never go back.

Good, btw if you need to lower the foam strength, it's possible to set negative values.

Also, looking at f-14 makes me think of trying adding ambient occlusion to KSP, though it may be a bad idea.

Edited by blackrack
Link to comment
Share on other sites

32 minutes ago, blackrack said:

Great, will test it in a bit.

 

Good, btw if you need to lower the foam strength, it's possible to set negative values.

Also, looking at f-14 makes me think of trying adding ambient occlusion to KSP, though it may be a bad idea.

I just had a great thought as well, you could halve the vertex/pixel count on the ocean plane and get a small performance boost that way.

Link to comment
Share on other sites

would you like a submarine? i have the pompeii class that has 12 0.625 missiles that would look nice coming out of the water and 4 more 1.25 cruise missiles on the underside(also capable of launching from underwater.) for the 0.625 Timaeus missiles is would recommend launching from 25-50 meters below water for maximal dramatic effect with their launch assist system

DOWNLOAD

Pics:

Link to comment
Share on other sites

Here is my first, specially to congrate you for your awesome work!

and just an idea (from a no skill programming guy):

having the spash effect when riding in the water by using the reentry effect but tuned to do this?

Link to comment
Share on other sites

14 minutes ago, Speadge said:

why is noone making a vid? :(

Because good videos take time. a screenshot takes 2 seconds. Videos will come.

 

Awesome work Blackrack! Why don't I ever see this stuff when I am actually at home. Now I have to wait all day before I can see it for myself :( 

Link to comment
Share on other sites

42 minutes ago, rbray89 said:

I just had a great thought as well, you could halve the vertex/pixel count on the ocean plane and get a small performance boost that way.

If you mean the plane that is created for the new ocean shaders, there's already a setting that does this, is this what you meant?

 

46 minutes ago, Red Iron Crown said:

I'm gushing about this over here, it's simply amazing.

 

Sorry to spam up the thread with pics.

Don't worry, keep going. Also, I'm still waiting on my carriers.

 

1 hour ago, Space Cowbuoy said:
2 hours ago, blackrack said:

Very sorry to double post but after quoting you I couldn't paragraph down or type anything!! Where can I get the new .dll from Github? Many thanks blackrack, you're the king baby, the king! x

I haven't made it yet. Will get to it in a bit.

 

Edited:

 

11 minutes ago, rbray89 said:

Oh, and to fix the Shadows issue with terrain, just put the render queue higher. I'd put it on Transparent or transparent offset.

"Queue" = "Transparent-20"

I think I tried this earlier and ir made it render over the projector, though I may have done something different. Will try it again.

 

15 minutes ago, Skalou said:

and just an idea (from a no skill programming guy):

having the spash effect when riding in the water by using the reentry effect but tuned to do this?

I don't see this looking any good honestly but thanks for the suggestion (and the craft album).

 

31 minutes ago, Speadge said:

why is noone making a vid? :(

Well, I did this earlier, sort of: http://webm.host/bf95b/vid.webm

Edited by blackrack
Link to comment
Share on other sites

6 minutes ago, blackrack said:

If you mean the plane that is created for the new ocean shaders, there's already a setting that does this, is this what you meant?

I think I tried this earlier and ir made it render over the projector, though I may have done something different. Will try it again.

Exactly. Ah, makes sense. Figured I'd check in-case.

Yeah, that is what you want to make sure that the terrain doesn't "bleed-through" the ocean when cloud coverage is present. It won't let cloud shadows show on the ocean, but it will stop some of the glitches.

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