Zylann / godot_atmosphere_shader

Planet atmosphere shader for Godot Engine
Other
90 stars 7 forks source link

is there any way to avoid the cut off when we zoom close the the atmosphere? #4

Closed RichardEllicott closed 8 months ago

RichardEllicott commented 9 months ago

sorry to bother you as maybe it's not a bug, it might just be my ignorance of how the shader works... but i'm just wondering is it possible to have it not cut out when i zoom so as to some way achieve a flying into the atmosphere illusion?

i should mention i have very small planets so far, all with just a radius as 1... maybe that is worth mentioning, but i notice the default height is not far off (double)... thanks

Zylann commented 9 months ago

Did you get that in game? It should be seamless in game, there is no cutoff AFAIK.

In the editor there is something, see the readme:

The effect will stop rendering when getting close to the planet in the editor. This is because the script can't access the camera of the main 3D viewport. It should work fine in game. To workaround this, enable force_fullscreen, and turn it back off once you're done tweaking.

If you do get an issue in game, please provide a minimal test project that shows your issue.

RichardEllicott commented 8 months ago

thanks very much zylann i just checked, i was only testing graphics, and no 👍 ... good news also for my shaders thanks

RichardEllicott commented 8 months ago

just a quick question if it's okay... i have a volumetric nebula effect i'm learning to code, i got an example, you can see the link if you like here (https://godotshaders.com/shader/volumetric-nebulae-clouds/)

anyway i fly into this it seems to cut off at a certain point.... i'm just curious i have to code something right or it's probabally how he coded this raymarching that it must go from. I am gonna take it apart ... i'm just curious if you had to do something special to allow the camera to get inside the "box" or whatever it is

maybe it's just i lack understanding that is fair enough to, it's cheeky to ask here i'll try and query the guy who wrote the shader... just a longshot question incase there was something obvious i was doing wrong... i started this stuff today

Zylann commented 8 months ago

I explain it in the readme too. I have a script that modifies the geometry used to draw the atmosphere depending on the distance from it. When far enough, I use a cube. When close enough, I switch to a full-screen quad that's near the camera. The point is just to keep polygons drawn around the area where the effect must render. It doesnt even matter that much what those polygons look like, they just need to cover the area and be in front of anything inside it. In theory you could always use a full-screen quad. But in my case I wanted multiple atmospheres and keep performance good from afar, so I used cubes.

RichardEllicott commented 8 months ago

i can now see this is why your shader has this script!... maybe i will be able to use a full screen quad for my problem.... thanks again closing issue