Code Monkey home page Code Monkey logo

vr-art-gallery's Introduction

VR Art Gallery (WebXR)

View artworks like the Mona Lisa, The Sistine Chapel, Starry Night as they appear in real life.

Rendered to scale with realistic texture. Ultra HD (10K+). As a virtual reality website!

demo.mp4

Visit https://art.cosm.run from your VR headset's browser.

Click the "Enter VR" button. Note that loading may take awhile and be choppy because of the massive files. High-speed internet required.

Controls:

  • Left joystick: Move painting up / down / left / right.

  • Right joystick OR tap right index finger with thumb: Switch to next or previous painting.

  • Right trigger OR tap left index finger with thumb: Bring painting closer or further away.


How it works

  1. This app/website is built using WebXR and Three.JS.

  2. High-resolution public domain artwork was scraped from Wikimedia and similar websites.

  3. This artwork was then sliced up into smaller chunks, and processed to show depth and lighting effects, by generating normal & displacement maps.

the pipeline of artwork from ingestion to generation of normal maps and depth maps, to an output VR ready image, shown for Starry Night by Van Gogh

  1. For some classic paintings, I couldn't find high-resolution scans. For these, I used ESRGAN which increases the resolution of images via a generative adversarial network.

comparing the best online image of Cupid and Psyche by Bougeareau vs. after processing with ESRGAN which increases its resolution 3x


To run your own instance

npm install
npm run dev

This will start a server on your local network you can see at https://localhost. You'll see a security warning that appears for using a self-signed certificate, this is safe to bypass.

You will then need to visit your local IP address on your VR headset's browser to use the app (likely something like: https://192.168.1.123).

⚠️ Note: If running locally, you will have only a limited set of artwork available. You need to manually generate assets for custom art, as the files are too large to be included in this repo. See next section.

Loading custom artwork

To load in your own artwork, you will need to pre-process it before it can be used in the app.

Install dependencies: deno, python3, pip install -r requirement.txt, npm install, and (if using Google Arts & Culture) dezoomify-rs

Once installed, find a painting on Wikipedia, WikiArt, or Google Arts & Culture and copy its URL.

Then run:

./scripts/art.sh <valid-url> <unique-hyphenated-name-for-art>

For example:

./scripts/art.sh https://commons.wikimedia.org/wiki/File:Monet_-_Impression,_Sunrise.jpg monet-impression

You can also pass in a local file path to a JPEG or PNG image instead of a URL.

This will automatically generate slices, normal maps, and displacement maps for your art.

You may need to manually adjust some of the values (like the physical dimensions) it writes to public/art/index.json. More about this in scripts/

Force refresh the page (Cmd+Shift+R) to see your artwork loaded in!


TODO

  • Improve performance loading images
  • Use WebXR layers for higher resolution
  • Add augmented reality support
  • Way to browse artwork
  • Automate more of image processing, super-resolution

🖼️ + 🥽

vr-art-gallery's People

Contributors

mattvr avatar

Stargazers

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

Watchers

 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.