envlight


Nameenvlight JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/ashawkey/envlight
Summaryenvironment lighting toolkit
upload_time2024-01-19 02:11:53
maintainer
docs_urlNone
authorkiui
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Envlight

A toolkit to load `*.hdr` environment light map and sample lighting under the split-sum approximation.

This is basically a wrapped version of [`light.py` from nvdiffrec](https://github.com/NVlabs/nvdiffrec/blob/main/render/light.py).

### Install

Assume `torch` and [`nvdiffrast`](https://nvlabs.github.io/nvdiffrast/#linux) already installed.

```bash
pip install envlight

# from github
pip install git+https://github.com/ashawkey/envlight

# or locally
git clone https://github.com/ashawkey/envlight
cd envlight
pip install .
```

### Usage

```python
import envlight

normal # [..., 3], assume normalized, in [-1, 1]
reflective # [..., 3], assume normalized, in [-1, 1]
roughness # [..., 1], in [0, 1]

light = envlight.EnvLight('assets/aerodynamics_workshop_2k.hdr', device='cuda')

diffuse = light(normal) # [..., 3]
specular = light(reflective, roughness) # [..., 3]

# to load another hdr file
light.load('assets/mud_road_puresky_1k.hdr')
light.build_mips()
```

An example renderer:
```bash
# requries extra dependencies: pip install trimesh dearpygui
python renderer.py
```

https://github.com/ashawkey/envlight/assets/25863658/505d57e6-6e8a-4492-ae02-586e28e038ad


### Acknowledgement
* Credits to Nvidia's [nvdiffrec](https://github.com/NVlabs/nvdiffrec).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ashawkey/envlight",
    "name": "envlight",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "kiui",
    "author_email": "ashawkey1999@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/02/45/303d98dd22be8d8eea202898d3172287d9d26d7d80079ddb638ad23e84ad/envlight-0.1.0.tar.gz",
    "platform": null,
    "description": "# Envlight\n\nA toolkit to load `*.hdr` environment light map and sample lighting under the split-sum approximation.\n\nThis is basically a wrapped version of [`light.py` from nvdiffrec](https://github.com/NVlabs/nvdiffrec/blob/main/render/light.py).\n\n### Install\n\nAssume `torch` and [`nvdiffrast`](https://nvlabs.github.io/nvdiffrast/#linux) already installed.\n\n```bash\npip install envlight\n\n# from github\npip install git+https://github.com/ashawkey/envlight\n\n# or locally\ngit clone https://github.com/ashawkey/envlight\ncd envlight\npip install .\n```\n\n### Usage\n\n```python\nimport envlight\n\nnormal # [..., 3], assume normalized, in [-1, 1]\nreflective # [..., 3], assume normalized, in [-1, 1]\nroughness # [..., 1], in [0, 1]\n\nlight = envlight.EnvLight('assets/aerodynamics_workshop_2k.hdr', device='cuda')\n\ndiffuse = light(normal) # [..., 3]\nspecular = light(reflective, roughness) # [..., 3]\n\n# to load another hdr file\nlight.load('assets/mud_road_puresky_1k.hdr')\nlight.build_mips()\n```\n\nAn example renderer:\n```bash\n# requries extra dependencies: pip install trimesh dearpygui\npython renderer.py\n```\n\nhttps://github.com/ashawkey/envlight/assets/25863658/505d57e6-6e8a-4492-ae02-586e28e038ad\n\n\n### Acknowledgement\n* Credits to Nvidia's [nvdiffrec](https://github.com/NVlabs/nvdiffrec).\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "environment lighting toolkit",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/ashawkey/envlight"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73406450954238a1a767ea10b9ad4af55de98d66e413769321c7370543dccbec",
                "md5": "cf4f61e735682a476af347c5b397d602",
                "sha256": "62673c540cf599d3215e6ac8c641e73c71122ff255e776e6a25620735d2352e3"
            },
            "downloads": -1,
            "filename": "envlight-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf4f61e735682a476af347c5b397d602",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 40357,
            "upload_time": "2024-01-19T02:11:51",
            "upload_time_iso_8601": "2024-01-19T02:11:51.512634Z",
            "url": "https://files.pythonhosted.org/packages/73/40/6450954238a1a767ea10b9ad4af55de98d66e413769321c7370543dccbec/envlight-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0245303d98dd22be8d8eea202898d3172287d9d26d7d80079ddb638ad23e84ad",
                "md5": "c9fd54e39273cc1ec30e5d64e7a6fb68",
                "sha256": "e1581c719f04d9643aba639783536a5523a435de8b57215f693c17647358a304"
            },
            "downloads": -1,
            "filename": "envlight-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c9fd54e39273cc1ec30e5d64e7a6fb68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 30047,
            "upload_time": "2024-01-19T02:11:53",
            "upload_time_iso_8601": "2024-01-19T02:11:53.152506Z",
            "url": "https://files.pythonhosted.org/packages/02/45/303d98dd22be8d8eea202898d3172287d9d26d7d80079ddb638ad23e84ad/envlight-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-19 02:11:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ashawkey",
    "github_project": "envlight",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "envlight"
}
        
Elapsed time: 2.03844s