-
-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch #1: VRKit, ModuleManager, PostProcessor #252
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no unit test?
modules/whs-vrkit/package.json
Outdated
"name": "whs-vrkit", | ||
"main": "build/VRKit.js", | ||
"scripts": { | ||
"build": "webpack", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't work unless webpack is installed globally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's how we do it
modules/whs-vrkit/README.md
Outdated
const app = new WHS.App([ | ||
new WHS.ElementModule(), // This module is required | ||
// other modules | ||
new StatsModule(StatsModule.codes.fps) // or just "0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? is that not VRKit?
modules/whs-vrkit/README.md
Outdated
|
||
## Usage | ||
|
||
```javascript | ||
const app = new WHS.App([ | ||
new WHS.ElementModule(), // This module is required | ||
// other modules | ||
new StatsModule(StatsModule.codes.fps) // or just "0" | ||
new VRKit.VRModule() // enables VR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK ignore my other comment.
new WHS.ResizeModule(), | ||
new StatsModule(), | ||
new VRKit.VRModule(), | ||
// postprocessor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove commented out code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirako2000 It will be used when we'll make post-processing work with VREffect
.
// // .name('MyShader') | ||
// .renderToScreen(); | ||
|
||
const sphere = new WHS.Sphere({ // Create sphere comonent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo, and no need for a comment imo
@@ -0,0 +1,149 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this lib is on npm. maybe use it as a dep instead?
https://github.com/halvves/three-vrcontrols-module
src/modules/app/RenderingModule.js
Outdated
} | ||
|
||
play() { | ||
this.renderLoop.start(); | ||
// this.renderLoop.start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented out code.
src/modules/app/index.js
Outdated
@@ -3,7 +3,7 @@ export * from './CameraModule'; | |||
export * from './RenderingModule'; | |||
export * from './SceneModule'; | |||
export * from './ResizeModule'; | |||
export * from './PostProcessorModule'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would break the API
@@ -0,0 +1,186 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should publish code like this if not already on npm yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirako2000 No need. @mrdoob says VR API in Three.js will be changed soon. No more even VREffect
& VRControls
); | ||
|
||
export default { | ||
devtool: isProduction ? '#hidden-source-map' : '#source-map', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I saw it somewhere:)
.define()
,.use()
postprocessing
npm module.shader()
,.pass()
API changes
manager.define("name")
. Adds module to modules list with this name. Is optional for modules without much API.manager.get('renderer', true)
->manager.use('rendering')
postprocessor.shader(material)
- MakesShaderPass
from material automatically and uses it.postprocessor.pass(pass)
- Adds a pass.postprocessor.renderToScreen()
- Make this pass be rendered to screen.postprocessor.name(name)
- Name current pass.postprocessor.to(name)
- Change current pass.Examples added
VRKit/basic
VRKit/controls
VRKit/postprocessing
(work in progress)