Giter VIP home page Giter VIP logo

pbr.one's Introduction

PBR.ONE

PBR.ONE is a set of HTML pages that can be embedded into any website to quickly and easily create interactive previews of PBR materials and HDRI environment maps right in the browser. Resources can be loaded by simply adding URLs into the hashstring of the page and the page dynamically adjusts as the string changes to allow for interactive switching of environments or PBR maps.

Here is what a link to one of these views might look like:

/hdri-panorama.html#environment_url=./media/env-sunny.exr,environment_exposure=-2

Installation

On your own website via local hosting

You can embed PBR.ONE on your site like this:

  1. Clone this Repo or download it from Github.com
  2. Upload the contents of the /src folder to your web server, for example into /previews or any other subdirectory.
  3. Upload the HDRI environment or PBR maps that you want to show off to your server as well, for example into /assets.
  4. Embed one of the pages using an iframe, as shown below. You can read the section "Crafting the Hashstring" to figure out the correct parameters.
<!-- Example 1, showing custom PBR maps -->

<iframe src="https://example.com/previews/hdri-panorama.html#color_url=/assets/color.jpg,normal_url=/assets/normal.jpg">

<!-- Example 2, opening the HDRI viewer with one of the included panoramas -->

<iframe src= "https://example.com/previews/hdri-panorama.html#environment_url=./media/env-sunny.exr,environment_exposure=-2">

Without your own website or via CDN

(Coming soon).

Crafting the Hashstring

The hashstring defines the parameters for the material preview. Parameters follow the pattern:

#<key>=<value>,<key>=<value>, ...

You don't need to set all parameters by hand, only those that you care about. The rest will be populated with default values.

The parameters for hdri-panorama are:

Key Description Possible Values
spheres_enable Show the light probe spheres in the center of the frame. 0=off, 1=on
environment_tonemapping Tonemapping style to use. linear (recommended for an analytical look) or filmic (for a "prettier" look with tonemapping.)
environment_exposure Exposure offset in EVs. Any integer or floating point number. Negative numbers lead to a darker image, positive numbers lead to a brighter image.
environment_url Link to an equirectangular HDR panorama in hdr or exr file format. URL ending in .hdr or .exr.

The parameters for pbr-material are:

Key Description Possible Values
color_url URL to the color map. URL to the image file for the color map.
color_encoding Encoding to use for the color map. sRGB or linear
normal_url URL to the normal map. URL to the image file for the normal map.
normal_encoding Encoding to use for the normal map. sRGB or linear
normal_scale Scale/strength of the normal map. Any integer or floating point number.
normal_type Type of normal map. opengl or directx
displacement_url URL to the displacment map. URL to the image file for the displacment map.
displacement_encoding Encoding to use for the displacement map. sRGB or linear
roughness_url URL to the roughness map. URL to the image file for the roughness map.
roughness_encoding Encoding to use for the roughness map. sRGB or linear
metalness_url URL to the metalness map. URL to the image file for the metalness map.
metalness_encoding Encoding to use for the metalness map. sRGB or linear
ambientocclusion_url URL to the ambient occlusion map. URL to the image file for the ambient occlusion map.
ambientocclusion_encoding Encoding to use for the ambient occlusion map. sRGB or linear
opacity_url URL to the opacity map. URL to the image file for the opacity map.
opacity_encoding Encoding to use for the opacity map. sRGB or linear
environment_url Link to an equirectangular HDR panorama in hdr or exr file format. URL ending in .hdr or .exr.
geometry_type Defines the preview object. cube cylinder sphere plane
geometry_subdivisions Number of subdivisions. Integer number
tiling_scale Texture scaling. Integer or floating point number.

pbr.one's People

Contributors

struffel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.