Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dougreeder/aframe-simple-sun-sky

An A-Frame WebVR sky primitive using a simple (and fast) gradient away from the sun
https://github.com/dougreeder/aframe-simple-sun-sky

a-frame vr webvr

Last synced: about 2 months ago
JSON representation

An A-Frame WebVR sky primitive using a simple (and fast) gradient away from the sun

Awesome Lists containing this project

README

        

aframe-simple-sun-sky
===

An [A-Frame](https://aframe.io) [WebXR](https://www.webxr.community/) sky primitive using a simple (and fast) gradient away from the sun.
Saves your GPU power for the terrain!
Does *not* include any directional lighting. You may need to set sun-position on other elements to match.

![sample screenshot](sample.png)

[live example scene](https://dougreeder.github.io/aframe-simple-sun-sky/example.html)

When the sun goes below the horizon, you might want to switch to a different sky.

Include using
```html

```

Basic use:
```html

```

The sky fades to fog-color near the horizon.
If you use fog in your scene, set fog-color the same or very similar to your fog.
If you don't use fog, set fog-color to a grayish variant of your sky colors.
The special value 'none' will disable the horizon effect, for those rare worlds that are all sky and no land.
```html

```

Setting the colors of the sky:
```html

```

Adding lights so shadows work correctly:
```html

```

Increasing radius (default 5000) of sky sphere (increase the `far` parameter of the camera, too):
```html

```

You can change any of the colors on the fly, except changing fog to or from 'none'.