Comments (6)
It should be easy, given that the scattering is just a post-processing effect. Does it not work with Unity's Skybox system?
from gpu-planetary-rendering.
Ah it seems the skybox is rendered after lighting. So for skybox support to be added, the atmospheric scattering needs to be turned into an effect for the post-processing stack.
from gpu-planetary-rendering.
I was literally just about to post that haha. I wouldn't know how to go about doing that since I am not at all a shader expert. Another issue seems to be the effect glitching at long distances, not sure if this is a floating point issue that could be solved with a floating origin method but I thought i'd let you know anyways. Great stuff!
from gpu-planetary-rendering.
@louisGreenland The floating point issues are caused by these lines in AtmosphericScatter.shader:
float3 attenuation;
float irradianceFactor = 0;
float3 inscat = GetInscatteredLight(wpos,viewDir,attenuation,irradianceFactor);
float3 reflected = GetReflectedLight(wpos, depth,attenuation,irradianceFactor, normal,surfaceColor);
where attenuation is used without proper initialization.
This can of course be easily fixed by changing the first line to
float3 attenuation = float3(0., 0., 0.);
thus removing the visual artifacts
from gpu-planetary-rendering.
Ah it seems the skybox is rendered after lighting. So for skybox support to be added, the atmospheric scattering needs to be turned into an effect for the post-processing stack.
Alternatively, using a custom skybox shader with blending mode
Blend One One
works like a charm since the image effect's blending in AtmosphericScattering.shader is
OneMinusSrcAlpha
from gpu-planetary-rendering.
@adellari can you please expand how to fix this?
I am not expert in shaders, but I am trying to have the sun properly rendered in the sky.
Any chance you can provide an example of custom skybox which would work?
from gpu-planetary-rendering.
Related Issues (10)
- What is the suggested way for editing inscatter, irradiance, and transmittance textures? HOT 2
- Horizon Boundary Artifact HOT 2
- VR Support HOT 9
- Physics not working in Unity 2021? HOT 4
- How to define the sea level? HOT 9
- Elevation based mesh colors HOT 2
- How to create continent? HOT 7
- Creating an earth sized planet HOT 3
- Is it possible to get this to work in unity urp? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpu-planetary-rendering.