Giter Site home page Giter Site logo

webfx's Introduction

WebFX - online TressFX model viewer (Demo - Chrome recommended, see FAQ below)

This is a web viewer for .tfx AMD TressFX hair/fur file format. It also features a lot of modern rendering effects, so be sure to check out the code!

webfx-github-showcase

What is this?

A few months ago I've ported AMD's TressFX hair rendering/simulation library to OpenGL. Turns out that WebGL 2.0 offers enough capabilities to display .tfx file in the browser. This, combined with some modern rendering techniques like SSSSS, PBR, HDR makes for quite interesting demo project.

Use the [W, S, A, D] keys to move and [Z, SPACEBAR] to fly up or down. Click and drag to rotate the camera (be careful around the UI). All materials, effects and rendering techniques are configurable using the UI on the right side of the screen.

Usage

  1. yarn install
  2. yarn start <- dev server
  3. go to localhost:9000

Alternatively, yarn build for production build, outputs will be in dist folder.

FAQ

Q: Which effects are implemented?

Q: What to do if it does not work?

This demo uses a lot of different rendering techniques and sometimes WebGL does not keep up. If the scene renders incorrectly (e.g. no hair on firefox) there is nothing I can do. Baseline is support for WebGL 2.0, which has 55% adoption rate. All we really need are features like:

  • texture sampling in vertex shader,
  • multiple render targets (it was possible in WebGl 1.0, but I'd rather have full support),
  • texelFetch,
  • more flexible texture formats,
  • non power of 2 textures,
  • better depth textures,
  • for-loops in shaders,
  • build-in gl_VertexID and gl_InstanceID.

See also last question about my hardware config.

Q: Shadow controls stopped working?

This sometimes happens, but I don't think it's related to my code. For some reason, shadow depth map is rendered incorrectly/does not update. Checking 'Show dbg' in 'Shadow' section on UI fixes the problem (even though all it does is renders debug view on top of final image). BTW. debug depth map on the right is for SSSSS.

Q: How can I improve performance?

Uncheck Use MSAA. You can also play with SSAO settings, but the gains are limited. I did not focus much on performance, works 60fps for me (unless super close-up).

Q: That's a lot of code

Most of the code comes from other project I'm working on. Interesting snippets:

Q: Why Sintel?

If You know me, You probably know why I like Sintel so much.

Q: Your PC?

GTX 1050 Ti, Driver 398.36, Windows 10, Chrome 74.0.3729.13

Honorable mentions and other 3rd party stuff

webfx's People

Contributors

scthe avatar

Stargazers

Nikita Zhenev avatar  avatar Damaru avatar

Watchers

James Cloos avatar  avatar  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.