Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCleaned up VR implementation #76
Conversation
478dbbe
to
b57a7dd
|
Looks good, just needs a few stylistic changes. Thanks for working on this! |
| @@ -146,7 +146,9 @@ export abstract class Renderer { | |||
| this.clearDestFramebuffer(); | |||
|
|
|||
| // Start timing rendering. | |||
| if (this.timerQueryPollInterval == null) { | |||
| if (this.timerQueryPollInterval == null && | |||
This comment has been minimized.
This comment has been minimized.
pcwalton
Mar 25, 2018
Collaborator
The entire commit that makes timer queries optional shouldn't be necessary now since I made this change right before showing my slides at the Rust meetup.
| class="btn btn-outline-secondary pf-toolbar-button" | ||
| aria-expanded="false" aria-controls="#pf-vr" | ||
| style="display: none"> | ||
| <span>VR</span> |
This comment has been minimized.
This comment has been minimized.
pcwalton
Mar 25, 2018
Collaborator
Note to self: we use Material Design Icons here and there is a VR icon, so let's use that.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| @@ -174,6 +175,10 @@ export abstract class DemoView extends PathfinderView implements RenderContext { | |||
| protected colorBufferHalfFloatExt: any; | |||
|
|
|||
| private wantsScreenshot: boolean; | |||
| private vrDisplay: VRDisplay | null; | |||
This comment has been minimized.
This comment has been minimized.
pcwalton
Mar 25, 2018
Collaborator
nit: can you put a newline above this? Let's keep all the VR-specific stuff together.
| if ("VRFrameData" in window) { | ||
| this.vrFrameData = new VRFrameData; | ||
| } else { | ||
| this.vrFrameData = null; |
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| vrSetup(): void { | ||
| if (navigator.getVRDisplays) { |
This comment has been minimized.
This comment has been minimized.
pcwalton
Mar 25, 2018
Collaborator
nit: Let's use if ('getVRDisplays' in navigator) { ... } for consistency with the above.
| @@ -25,22 +25,28 @@ uniform float uShininess; | |||
| /// The normal of these vertices. | |||
| uniform vec3 uNormal; | |||
|
|
|||
| uniform bool uLightThings; | |||
This comment has been minimized.
This comment has been minimized.
pcwalton
Mar 25, 2018
Collaborator
Cute name, but I think that uEnableLighting might be more obvious :)
| if ("VRFrameData" in window) { | ||
| this.vrFrameData = new VRFrameData; | ||
| } else { | ||
| this.vrFrameData = null; |
This comment has been minimized.
This comment has been minimized.
| }); | ||
| } else { | ||
| // no vr support | ||
| } |
This comment has been minimized.
This comment has been minimized.
pcwalton
Mar 25, 2018
Collaborator
Stylistic comments left on the earlier version of this function apply here too.
| @@ -149,6 +149,9 @@ export abstract class Renderer { | |||
| gl.viewport(0, 0, this.destAllocatedSize[0], this.destAllocatedSize[1]); | |||
| } | |||
|
|
|||
| setClipPlanes(display: VRDisplay) { | |||
This comment has been minimized.
This comment has been minimized.
| this.inVRRAF = true; | ||
| this.redraw(); | ||
| this.inVRRAF = false; | ||
| }; |
This comment has been minimized.
This comment has been minimized.
pcwalton
Mar 25, 2018
Collaborator
Ah, I see you made the arrow function change. Disregard the previous comments then :)
|
addressed |
|
@Manishearth I found a community icon here: https://materialdesignicons.com/icon/virtual-reality |
|
(Note that this still has merge conflicts just as a reminder) |
|
pushed. I'll fix the icon later, seems to be trickier since it's not in the font and I'll have to size it myself (and it's late) |
|
Okay -- so I looked into it; that icon is only in the fonts provided on https://materialdesignicons.com/getting-started , however these work a completely different way; they don't work by ligaturifying the right text. Instead, they use a bunch of CSS with ::before attributes being used with Private Use codepoints. I'm not sure if we should switch to that model, seems tricky to style. |
|
We could always just embed the SVG.
…On Thu, Mar 29, 2018 at 5:15 AM, Manish Goregaokar ***@***.*** > wrote:
Okay -- so I looked into it; that icon is only in the fonts provided on
https://materialdesignicons.com/getting-started , however these work a
completely different way; they don't work by ligaturifying the right text.
Instead, they use a bunch of CSS with ::before attributes being used with
Private Use codepoints.
I'm not sure if we should switch to that model, seems tricky to style.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/pcwalton/pathfinder/pull/76#issuecomment-377216561>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJoyeIS5mOAdXGIxnne-wvn2laqp-mMks5tjNB5gaJpZM4SlEsA>
.
|
|
Pushed. It's hard to get it at the same size, but it's close enough. |
|
Looks good, squash into a few commits and let's get it merged :) |
|
Squashed the fixups, kept the main commits so that it's easy to read. |
|
Merged! |
Manishearth commentedMar 10, 2018
•
edited
Fixed up https://github.com/pcwalton/pathfinder/pull/75
Actually mergeable.
I still want to improve the camera code. It currently just overwrites the rotation matrix, but we can do better.
Ideally the code gets refactored into having two view transforms.
r? @pcwalton