{"_id":"5b8469e2146f290003ee2548","category":{"_id":"5b8469e2146f290003ee2500","version":"5b8469e2146f290003ee2585","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-01T23:04:12.838Z","from_sync":false,"order":8,"slug":"api-reference","title":"API Reference"},"project":"578c4badbd223d2000cc1441","user":"579a69d53de0a217007eda56","parentDoc":null,"version":{"_id":"5b8469e2146f290003ee2585","project":"578c4badbd223d2000cc1441","__v":0,"forked_from":"5b74987b8326970003cfc12d","createdAt":"2018-04-23T20:03:35.726Z","releaseDate":"2018-04-23T20:03:35.726Z","categories":["5b8469e2146f290003ee24fb","5b8469e2146f290003ee24fc","5b8469e2146f290003ee24fd","5b8469e2146f290003ee24fe","5b8469e2146f290003ee24ff","5b8469e2146f290003ee2500","5b8469e2146f290003ee2501","5b8469e2146f290003ee2502","5b8469e2146f290003ee2503"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.10.0","version":"2.10.0"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-02-26T23:58:37.141Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":20,"body":"Component that represents the lighting environment to use for its parent ```ViroScene``` or ```ViroPortalScene```. The lighting environment is a texture that acts as a global light source, illuminating surfaces with diffuse and specular ambient light. Each pixel in the lighting environment is treated as a light emitter, thereby capturing the environment's global lighting and general feel. This gives objects a sense of belonging to their environment. For this reason it is common to use the scene's background texture (set through [Viro360Image](doc:viro360image)) as the lighting environment, but this is not necessary.\n\nLighting environment expects an equirectangular texture. Radiance HDR textures (*.hdr) work best.\n[block:api-header]\n{\n  \"title\": \"Props\"\n}\n[/block]\n## Required Props\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**source**\",\n    \"0-1\": \"**PropTypes.oneOfType( [PropTypes.shape( {uri:  PropTypes.string} ), PropTypes.number] )**\\n\\nThe image source, a remote URL or a local file resource. Radiance HDR images (.hdr) are accepted.\\n\\nTo invoke with remote url: \\n```\\n{uri:\\\"http://example.org/myimage.hdr\\\"}\\n```\\nTo invoke with local source:\\n```\\nrequire('./image.hdr');\\n```\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n## Optional Props\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**onLoadStart**\",\n    \"1-0\": \"**onLoadEnd**\",\n    \"2-0\": \"**onError**\",\n    \"0-1\": \"**PropTypes.func**\\n\\nCallback triggered when we start processing  the image to be used in computing this lighting environment (either downloading / reading from file).\",\n    \"1-1\": \"**PropTypes.func**\\n\\nCallback triggered when we have finished processing assets to be used in computing this lighting environment. Whether or not assets were processed successfully will be indicated by the parameter \\\"success\\\".\\n     \\nFor example:\\n```  \\n _onLoadEnd(event:Event){\\n     // Indication of asset loading success\\n     event.nativeEvent.success\\n }\\n```\",\n    \"2-1\": \"**PropTypes.func**\\n\\nCallback triggered when the hdr image fails to load. Invoked with {nativeEvent: {error}}.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","excerpt":"","slug":"virolightingenvironment","type":"basic","title":"ViroLightingEnvironment"}

ViroLightingEnvironment


Component that represents the lighting environment to use for its parent ```ViroScene``` or ```ViroPortalScene```. The lighting environment is a texture that acts as a global light source, illuminating surfaces with diffuse and specular ambient light. Each pixel in the lighting environment is treated as a light emitter, thereby capturing the environment's global lighting and general feel. This gives objects a sense of belonging to their environment. For this reason it is common to use the scene's background texture (set through [Viro360Image](doc:viro360image)) as the lighting environment, but this is not necessary. Lighting environment expects an equirectangular texture. Radiance HDR textures (*.hdr) work best. [block:api-header] { "title": "Props" } [/block] ## Required Props [block:parameters] { "data": { "0-0": "**source**", "0-1": "**PropTypes.oneOfType( [PropTypes.shape( {uri: PropTypes.string} ), PropTypes.number] )**\n\nThe image source, a remote URL or a local file resource. Radiance HDR images (.hdr) are accepted.\n\nTo invoke with remote url: \n```\n{uri:\"http://example.org/myimage.hdr\"}\n```\nTo invoke with local source:\n```\nrequire('./image.hdr');\n```" }, "cols": 2, "rows": 1 } [/block] ## Optional Props [block:parameters] { "data": { "0-0": "**onLoadStart**", "1-0": "**onLoadEnd**", "2-0": "**onError**", "0-1": "**PropTypes.func**\n\nCallback triggered when we start processing the image to be used in computing this lighting environment (either downloading / reading from file).", "1-1": "**PropTypes.func**\n\nCallback triggered when we have finished processing assets to be used in computing this lighting environment. Whether or not assets were processed successfully will be indicated by the parameter \"success\".\n \nFor example:\n``` \n _onLoadEnd(event:Event){\n // Indication of asset loading success\n event.nativeEvent.success\n }\n```", "2-1": "**PropTypes.func**\n\nCallback triggered when the hdr image fails to load. Invoked with {nativeEvent: {error}}." }, "cols": 2, "rows": 3 } [/block]