Skip to content

[VR-Based] Non-photorealistic rendering gallery, also support multi-user experience

Notifications You must be signed in to change notification settings

kingdomax/npr-gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPR Gallery

0  vr-museum-1 0  vr-museum-2 0  vr-museum-3

  • Require only Unity 2021.3.2f1
  • Please treat main branch as a stable version!!
    Having said that, create a separate branch to develop your feature, then make a pull request to merge your code to the main one.

Development guide

  • Create a new branch from main. git checkout -b <branch_name>
  • Contribute your features to your new branch.
  • While you are developing, don't forget to sync your code with the main branch. git pull origin main
  • When you finish, create pull request against the main branch, and fill in the pull request's description of what changed you have done. (PR example)
  • If the code conflicts with the main branch, please resolve it correctly.
  • Make sure there is no broken code or errors before attempting to merge.
  • Get at least one reviewer approval by our teammate or @kingdomax, then it's now possible to merge your branch to the main one. (you can also notify @kingdomax in the discord channel)

Run & Build

  • In general, you can just press the play button in Unity editor, and then the application will run via Oculus Link (make sure you already connected your Quest device with your laptop before doing so)
  • If you want to test the networking scenario manually, you can build this application as a standalone executable file. On the top menu bar: File > Build Setting... > Build > Select your built folder (normally it's called 'Build' in the project directory > After the build has done, run NPR Gallery.exe file. Then you can join the previous instance as 2nd player by pressing the play button from Unity editor

Controller

  • First, you need to change your name that will display on top of your avatar in this distributed VR app.
    Go to object hierarchy > look for __NETWORK__/Network Setup > In NetworkSetup component, change username field to yours and change selected device type to HMD. You can also change the device type to desktop, but it only supports navigation.
  • After your avatar enters the scene, you can navigate using your left controller.
    • Joystick on the left controller allow you to rotate your avatar.
    • Trigger button on the left controller allow you to walk forward, and the direction will respect where you point your left controller.
  • Right controller give you full functionality on painting / brushing interactions.
    • Press A button to switch between painting equipment and bare hand.
    • Press B button to switch the rendering technique.
    • Aim your ray toward test objects(only the paintable ones), and press your index finger to paint the selected rendering technique to the geometry.

Networking Stuff

I hope. What I have tried to set up here should not make you change any code regarding the networking stuff. But basically, I used Vrsys package as a base multiplayer framework in this project. Under the hood, Vrsys package uses Photon's PUN as a core networking engine which you can find helpful links below.

[HOW TO] add your shading

I wrote some explanation in this pull request.
Most of the time, you need to make the change in the following files:

  • Assets/Scripts/Models/Enum.cs
  • Assets/Scripts/Models/RenderingConfig.cs
  • Assets/Scripts/RenderingProvider.cs
  • Assets/Scripts/PaintInteraction.cs
  • Assets/Scripts/PaintHandler.cs

[HOW TO] add paintable objects

For dummy objects, we would like them to be paintable:

  1. Add 'TestObject' tags to the object.
  2. Add a collider component to the object, letting the avatar's ray interactable.
  3. Add PhotonView script component to the object; this will make an object updatable via the network. Please change ViewID parameter to XXX; the first digit is your group number, and the last digit is your object order in the group.
  4. Add PaintHandler script component to the object; this script is where your rendering implementation goes.
  5. Add ManipulationHandler script component to the object; this script let user manipulate the object.
  6. You can also take a look at an example at __TEST OBJECTS__/Group1/WaterPump
  7. Subdivide the Prefab by the Duotone algorithm. Add a fbx Prefab of the subdivided Object to "Ressources/DuotonePrefabs/" and Name is simlar to the object.

APK file

You can find latest release build and standalone apk file here

About

[VR-Based] Non-photorealistic rendering gallery, also support multi-user experience

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published