All Projects → supermedium → Aframe Environment Component

supermedium / Aframe Environment Component

Licence: mit
🌄 Infinite background environments for A-Frame in a line of HTML.

Programming Languages

javascript
184084 projects - #8 most used programming language
procedural
45 projects

Projects that are alternatives of or similar to Aframe Environment Component

Uieffect
UIEffect is an effect component for uGUI element in Unity. Let's decorate your UI with effects!
Stars: ✭ 3,449 (+1049.67%)
Mutual labels:  component
React Modern Library Boilerplate
Boilerplate for publishing modern React modules with Rollup
Stars: ✭ 285 (-5%)
Mutual labels:  component
React Tabulator
React Tabulator is based on tabulator - a JS table library with many advanced features.
Stars: ✭ 295 (-1.67%)
Mutual labels:  component
React Native Image View
Modal component to view images with zoom
Stars: ✭ 273 (-9%)
Mutual labels:  component
Vue Datepicker Local
A Beautiful Datepicker Component For Vue2
Stars: ✭ 282 (-6%)
Mutual labels:  component
Vc Popup
一个行为标准的vue popup组件集
Stars: ✭ 289 (-3.67%)
Mutual labels:  component
React Click Outside
Higher Order Component that provides click outside functionality
Stars: ✭ 266 (-11.33%)
Mutual labels:  component
Lock
Creates and manages locks, a mechanism to provide exclusive access to a shared resource.
Stars: ✭ 299 (-0.33%)
Mutual labels:  component
Vuewordcloud
Generates a cloud out of the words.
Stars: ✭ 284 (-5.33%)
Mutual labels:  component
Croppr.js
A vanilla JavaScript image cropper that's lightweight, awesome, and has absolutely zero dependencies.
Stars: ✭ 294 (-2%)
Mutual labels:  component
Rome
📆 Customizable date (and time) picker. Opt-in UI, no jQuery!
Stars: ✭ 2,901 (+867%)
Mutual labels:  component
Mpvue Weui
基于 mpvue 的 weui 框架
Stars: ✭ 279 (-7%)
Mutual labels:  component
Dotenv
Symfony Dotenv parses .env files to make environment variables stored in them accessible via getenv(), $_ENV, or $_SERVER.
Stars: ✭ 3,268 (+989.33%)
Mutual labels:  component
Paper Switch
🎚 RAMPaperSwitch is a Swift material design UI module which paints over the parent view when the switch is turned on. iOS library by @Ramotion
Stars: ✭ 2,902 (+867.33%)
Mutual labels:  component
Paper Onboarding
PaperOnboarding is a material design UI slider. Swift UI library by @Ramotion
Stars: ✭ 3,147 (+949%)
Mutual labels:  component
Vue Ydui
A mobile components Library with Vue2.js. 一只基于Vue2.x的移动端组件库。
Stars: ✭ 2,798 (+832.67%)
Mutual labels:  component
Mint Ui
Mobile UI elements for Vue.js
Stars: ✭ 16,471 (+5390.33%)
Mutual labels:  component
Incubator Wikift
enterprise level wikift is open source wiki system.
Stars: ✭ 300 (+0%)
Mutual labels:  component
Arkit
ARKit Base Project. Place virtual objects based on WWDC example project
Stars: ✭ 297 (-1%)
Mutual labels:  scene
Fmxcomponents
Firemonkey Opensource Components
Stars: ✭ 288 (-4%)
Mutual labels:  component

aframe-environment-component

A simple way of setting up a whole basic environment for your A-Frame VR scene.

gif

Make sure you are using A-Frame 0.6.0 or later. Then just include aframe-environment-component.js in your HTML:

  <script src="https://unpkg.com/[email protected]/dist/aframe-environment-component.min.js"></script>

and add the environment component to an entity:

  <a-entity environment></a-entity>

That's it! :)

Presets

The previous code will setup a default scene, but you have a bunch of already predefined presets to choose from, using the preset parameter, like this:

  <a-entity environment="preset: <name of the preset>"></a-entity>

You can view and try all the presets in the aframe-environment-component Test Page. The current list of presets are listed in the next section.

Parameters

Apart from using a preset, you can tweak the environment with many parameters, like this:

  <a-entity environment="lightPosition: 1 5 -2; groundColor: #445"></a-entity>

You can also select a preset but change some of its parameters:

  <a-entity environment="preset: forest; groundColor: #445; grid: cross"></a-entity>

This is the list of the available parameters.

Parameter Default Description
active true Show/hides the component. Use this instead of using the visible attribute
preset 'default' Valid values: none, default, contact, egypt, checkerboard, forest, goaland, yavapai, goldmine, threetowers, poison, arches, tron, japan, dream, volcano, starry, osiris
seed 1 Seed for randomization. If you don't like the layout of the elements, try another value for the seed.
skyType 'atmosphere' Valid values: color, gradient, atmosphere
skyColor When skyType is color or gradient, it sets the main sky color
horizonColor When skyType is gradient, it sets the color of the sky near the horizon
lighting 'distant' Valid values: none, distant, point. A hemisphere light and a key light (directional or point) are added to the scene automatically when using the component. Use none if you don't want this automatic lighting set being added. The color and intensity are estimated automatically.
shadow false Shadows on/off. Sky light casts shadows on the ground of all those objects with shadow component applied
shadowSize 10 Shadows size
lightPosition 0 1 -0.2 Position of the main light. If skyType is atmospheric, only the orientation matters (is a directional light) and it can turn the scene into night when lowered towards the horizon.
fog 0 Amount of fog (0 = none, 1 = full fog). The color is estimated automatically.
flatShading false Whether to show everything smoothed (false) or polygonal (true).
playArea 1 Radius of the area in the center reserved for the player and the gameplay. The ground is flat in there and no objects are placed inside.
ground 'hills' Valid values: none, flat, hills, canyon, spikes, noise. Orography style.
groundYScale 3 Maximum height (in meters) of ground's features (hills, mountains, peaks..)
groundTexture 'none' Valid values: none, checkerboard, squares, walkernoise
groundColor '#553e35' Main color of the ground
groundColor2 '#694439' Secondary color of the ground. Used for textures, ignored if groundTexture is none
dressing 'none' Valid values: none, cubes, pyramids, cylinders, towers, mushrooms, trees, apparatus, torii. Dressing is the term we use here for the set of additional objects that are put on the ground for decoration.
dressingAmount 10 Number of objects used for dressing
dressingColor '#795449'  Base color of dressing objects
dressingScale 5 Height (in meters) of dressing objects
dressingVariance '1 1 1' Maximum x,y,z meters to randomize the size and rotation of each dressing object. Use 0 0 0 for no variation in size nor rotation
dressingUniformScale true If false, a different value is used for each coordinate x, y, z in the random variance of size.
grid 'none' Valid values: none, 1x1, 2x2, crosses, dots, xlines, ylines. 1x1 and 2x2 are rectangular grids of 1 and 2 meters side, respectively.
gridColor '#ccc' Color of the grid.

The best way to work with them is to press ctrl-alt-i to open the inspector, search for 'environment' in the filter box and select it, and tweak the parameters while checking the changes in realtime. When you are happy, you can use the Copy attributes button or even better, copy the attributes logged in the browser's dev tools console.

Performance

The main idea of this component is to have a complete and visually interesting environment by just including one .js file, with no extra includes or requests. This requires to store all the assets inside the js or (in most of cases) to procedurally generate them. Despite of the computing time and increased file size, both options are normally faster than requesting and waiting for additional textures or model files.

Apart from the parameter dressingAmount, there is not much difference among different values in parameters in terms of performance. Just keep dressingAmount value under watch and lower it if the performance is not optimal.

Help and contact

PRs are appreciated, issues are welcomed. For any question, ping @feiss at aframevr in Slack or Discord.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].