SevenSky - physically based sky rendering library

Hello everyone,

Here I am presenting you a with a library for sky rendering, which includes rendering of skies, clouds, rainbows, stars, etc.

I had planned to release this like two months ago, yet there were slight things which could have been improved with respect to the integration with jme.

Well, for starters, here is a link to the git page, with the project. To use it download the project, and add it as a reference, along with the assets.

17 Likes

Awesome

@The_Leo thanks so much for your contribution.
Going to take a look at it soon, I will use this cool sky library in my game instead of an static skybox .

Again thanks so much for sharing it. :slightly_smiling_face:

3 Likes

Im excited to give this a try :smiley: Thanks for the contribution.

2 Likes

Thank you very much looks pretty coold !

But one point:
please add the lib which makes the shader compatible to glsl >= 1.3, → gl_FragColor is a reservered word.

To see what i mean, change renderer to opengl version >= 3.0

1 Like

thank you, everyone!

@boon yes, the shaders could use some cleanup… (although it is running for me fine even with opengl 3.0+, do you get an error? )when I was developing the library I used deffered and openGL 3.0+, now in this library, I think openGL 2.0 requirement is enough. So I might change that as well. (On second though, I’m using texelFetch somewhere)
PS: I’ve added the use of Compat.glsl

Obligatory screenshots or maybe spoil us with a video? A picture speaks a thousand words and all that story :slight_smile:

And thanks for sharing, btw.

1 Like

There are pictures if you click through but I was going to ask the same thing.

…cause some videos would be pretty sweet.

2 Likes

Here’s one short clip: :slight_smile:

However, the video got a bit darker when uploaded on yt.

9 Likes

Wow, nice work! Thanks for sharing :slight_smile:

1 Like

In TestSky example, how should I enable moving clouds? like in the video.

PS: A few suggestions

  • Add gradle build tools support
  • Publish project jars to bintray or maven repository

Regards

2 Likes

Cool don’t forget to add the tags for better discoverability

2 Likes

Do you have a source for what you based your clouds on? Like a paper on the algorithm or something. It looks similar to one I read but I can’t remember the reference anymore.

1 Like

@Ali_RS I’ve updated the TestSky, to include moving clouds with keys (1,2), moving day/sun (3,4).
I think its too early to put it on maven, since atm there’s so many changes that can happen.

@Pesegato Thanks, I’ve added the tags.

@pspeed Yes, in fact this work was part of my dissertation, I’ve added it to docs section, it has also a literature review section which you can check. (SevenSky/docs at master · TehLeo/SevenSky · GitHub)

5 Likes

when i started using this now, i had problem with filters causing no light, trying a lot things, debug comparing test class from library and my code.

i were not looking why this happen in library, but i needed to:

    getViewPort().removeProcessor(filterManager.fpp);
    filterManager.fpp.addFilter(new SevenSky.LightFilter(vars));
    getViewPort().addProcessor(filterManager.fpp);

first time i add sky "after initializing all filters, so maybe i just dont know about something.

Anyway using just

    filterManager.fpp.addFilter(new SevenSky.LightFilter(vars));

didnt work for me and cause black “bottom part” of view.(like no light)

can i know why i need to remove processor first?

here are screenshots:

You mean the black part below the horizon?

Well thats where the Earth/ground is supposed to be, theres no light since it hits the Earth. The shader renders just the sky not the Earth.

Hi @The_Leo

Some part of sky is being rendered black for me.

btw, can you please share the code for the test you showed in video.

@Ali_RS does running test.theleo.sevensky.TestSky result in the same black pixels? If not could you provide a minimal test case of the issue?
It looks like an issue with the clouds.

Regarding the code for the video, as I was creating the system I’ve used deffered rendering, then I restructured the code for the library for jME, so it’s not really helpful to share. If you haven’t run TestSky.java try that, otherwise feel free to ask.

Yes, it does.

Oops! I just realised the black pixels goes away the moment I modify sun direction using Key 3/4 for the first time. So not a big problem.

Actually it’s about moving clouds. I know in test sky you added key 1/2 which only offset the clouds, but in the video you posted the clouds are changing their shapes while being moved.
How can I reach the same result ?

@Ali_RS I’m glad the black pixels go away, thou its still an issue. Unfortunately, I do not have the issue on my laptop. Thank’s for the hint thou, that it has to do something with the sun position.

Regarding animating clouds: The clouds are based on weather map. This can be either a 2D top down texture painted by an artist, or automatically generated (default). Animation is obtained by modifying the weather map in any way you like.

The automatically generated weather map supports some simple modification, eg rotate, or move along a vector field (2D image). Hold key 5 to rotate the clouds. Also you can create your own weather map, check out the Clouds.createTestWeatherMap function. For more info about how the weather map looks/how vector field looks check the Clouds section of the dissertation.

1 Like