Git Product home page Git Product logo

bsdf-visualizer's Introduction

BSDF-Visualizer

Screenshot

System Requirements

  • WebGL 2 required.
  • Windows / Mac: Chrome recommended.
  • Linux: Firefox is recommended (see below).
  • For Firefox: about:config > set dom.moduleScripts.enabled to true

Demo

Hacking

See our documentation wiki.

Using Glslify with shaders

Glslify is quite handy and I am currently using it for our heatmap. Our glslify-enabled shaders are in Shaders/glslify_raw. In order to work with these shaders:

  1. Make sure glslify is set up correctly
  2. npm install -g glslify to install the CLI command.
  3. npm install to install local glslify dependencies
  4. Edit the shader in Shaders/glslify_raw.
  5. Run preprocess_glslify_shaders.py. This will generate (inlined) shaders and place them under Shaders/glslify_processed. โš ๏ธ Do not edit the shaders under glslify_processed. They will get overwritten by preprocess_glslify_shaders.py

bsdf-visualizer's People

Contributors

dqlin avatar n8xm avatar natevm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bsdf-visualizer's Issues

Make checkboxes look better

Right now the checkboxes for analytical BRDF parameters look out of place. They are especially small in Chrome. They should look better and perhaps be bigger / easier to hit on mobile.

Implement MVVM-like paradigm

The GUI should not need to be aware of the Model. Furthermore, Viewports should not need to be aware of the GUI. In other words, there should be a "one-way" data flow from GUI to Model to Viewports. @n8vm tells me that this is sort of like the "MVVM" paradigm.
frontend_only

Calling gl.bindBuffer in the wrong place for two different LobeRenderer objects for some reason causes breakage

On the lobeRdr_bug branch, see commit e5387a4015391cef7ba02d61294923684b95a16b.

If we click and drag across the teapot, lobe glitches out. However, if
we uncomment line 988 of ModelViewport.js, then it works.

More specifically, calling gl.bindBuffer on line 253 of LobeRenderer.js causes the breakage.

I'm not sure why this is happening because both lobes are in completely
separate OpenGL contexts and therefore one does not write to the data or
state of the other.

Sliders "shake" when printed values change in width

Right now when our slider values transition between single-digit and double-digit values, there is no formatted print so it changes the location of the next slider, which causes jittering. We should be able to fix it using string formatting, or by putting sliders in separate rows.

Render BRDF on in Point Light View.

We will need to turn PointlightViewer's fragment shader into a template, and then call the inlining code to substitute the analytical BRDF into it. (We are already doing the same thing in BRDFViewer's vertex shader.)

Radiance map does not draw on Android

For some reason, with IBL, the radiance map does not appear on Android (it just draw black).

TODO: Figure out how to get debug messages out of Chrome on Android.

Add more BRDFs

It would be nice if we had some more BRDFs to play with. It should be easy to add more BRDFs in Disney's format - they just have to be modified slightly to conform to OpenGL ES rather than desktop OpenGL. The easiest way to start is to load a Disney .brdf file, see what breaks, then change it.

Disney's files are here: https://github.com/wdas/brdf/tree/master/src/brdfs .

Perhaps this task could be automated with a script? I believe that in the general case, converting desktop OpenGL to OpenGL ES is nontrivial. Also, the total number of files that Disney has is small, so it may be faster to just do it by hand than it is to write a foolproof script.

Support GLTF

Load the model from a GLTF file, and also load PBR properties (if any) and visualize the BRDF.

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.