Installing the Razer Core on Ubuntu 16.04

Step 0: Install Ubuntu

First, follow my previous tutorial to install Ubuntu on the Razer Blade Stealth. I’m using a fresh Ubuntu 16.04.3 64bit install on a Razer Balde Stealth (late 2016).

Step 1: Update the Intel drivers

Start by updating your Intel drivers:

Step 2: Set the kernel options

I had to fiddle a lot to make things work. One of the major problems I got is that the machine wouldn’t properly suspend/shutdown/reboot/logout when I was using the integrated GPU witht the NVIDIA drivers installed.

At some point, I found this seamingly related issue on Bumblebee’s GitHub so I started playing with the kernel ACPI options. And I did not reproduce my issue with the following modifications… so maybe this step is useful, maybe it’s not.

Anyway, edit the value of  GRUB_CMDLINE_LINUX_DEFAULT  in  /etc/default/grub :

Update grub by calling update-grub  then reboot.

Step 3: Install the NVIDIA drivers

Then follow this tutorial to install the NVIDIA’s proprietary drivers version 384.59 and reboot.

Voilà! You should be able to use the descrete GPU and it should be listed in the NVIDIA X Server Settings (GTX 1080) in my case:

Step 4: Disable suspend when plugged in

For your information, I compiled a little recap of the last 3 versions available:

As you can see, things are getting better and version 384.59 appears to be the most functionnal so far.

But we’re not there yet: suspend “works” but it won’t resume properly. But the good thing with the Razer Core is that it provides both the discrete GPU and power. So using the NVIDIA driver implies the machine is plugged in. A simple solution is then to simply change the power options to never suspend when the machine is plugged in.

XPS 13 “Developer Edition” Microphone Fix

It seems the microphone doesn’t work out of the box on the XPS 13 “Developer Edition”. Worse, you’ll actually need to re-compile your kernel to make it work… at least the patches are easy to find thanks to Dell’s “Project Sputnik” leader Barton George:

I used those on the Linux 4.0.2 (stable) kernel, recompiled, installed… and voilà! The microphone works!

Hopefully those fixes will soon be in the kernel main line…

XPS13 “Developer Edition”: Updating the graphics driver

Update: I previously indicated to use the “xorg-edgers” PPA. But it’s far too brutal since it will update a lot of other things (such as the X server) and it might just break. I now recommend using the Oibaf PPA to update only the drivers.

Following my article about a few “out of the box” fixes for the XPS 13 “Developer Edition”, I wanted to upgrade the Intel graphics driver and Mesa. Indeed, I noticed some issues with 3D apps:

  • most games were incredibly slow, or at least a lot slower than what ohter got with the same hardware on Windows (and OpenGL performance are supposed to be on-par or close – if not better – on Linux now);
  • WebGL was not available neither on Chromium nor Firefox, even through their latest stable version.

The pre-installed version of Mesa (10.1.3) is pretty old (May 2014). You can upgrade it to the latest version along with the latest Intel drivers using the “xorg-edgers” PPA the Oibaf “Updated and Optimized Open Graphics Drivers” PPA.

Updating the i915 drivers and Mesa should give you a very important performance boost on 3D apps. I noticed “Counter Strike: Global Offensive” went from barely playable to completely smooth. I also noticed WebGL is now properly available on both Firefox and Chrome.

XPS13 Developer Edition Fixes

I recently bought a brand new XPS 13 “Developer Edition” that I want to use as my main machine for development. I’m very happy to see Dell building machines fit for Linux. The Dell XPS 13 has many very very good reviews. And it’s even better when it comes with Ubuntu pre-installed with all the good drivers (or close…).

dell xps13

It’s too soon to draw any conclusions yet: I’ve been using the computer for only 1 day. Still, I must say it works overall very good and I’m satisfied so far (except for the one or two quirks listed below). Especially by the gorgeous incredible “infinity display”, which packs a 3200×1800 touchscreen in a 13′” screen that fits in 11″ case. The XPS 13 “Developer Edition” comes with Ubuntu pre-installed, and it also comes with a “factory reset” feature you come to expect from a brand such as Dell. So if you brick your Ubuntu install, you can easily reset it without much hassle.

The only problem I encountered is some trackpad freezes that happen to be very annoying. It gives you the feeling the rig is not responsive when it’s actually pretty fast. To fix this, I applied this kernel patch:

You can safely apply this patch to the 3.13 Linux kernel that comes with the XPS 13/Ubuntu 14.04 mint install. But as I had to re-compile the kernel, I wanted to try the recently released stable Linux 4.0.2 kernel.

If you do so, you’ll also need to patch the Broadcom drivers. And because they’re not compatible with Linux 4.0 kernels, you’ll have to apply a little patch: bcmwl driver fixed for Linux 4.0 kernel.

After upgrading to Linux 4.0, I noticed the overall computer feels a lot faster and responsive. I don’t know why but it just does. It might be related to the fact the old 3.13 kernel was not using the new Intel P-state CPU governor.

Last, I also encountered kernel panic issues at three occasions:

  1. When changing access-points or simply disconnecting the Wi-Fi. This fix seams to do the trick: fix for the bcmwl kernel panic/crash.
  2. When suspending, but I guess it’s related to the Wi-Fi issue.
  3. When running a VirtualBox VM. I had to use VirtualBox 5.0 beta and patch Vagrant to support it.

Update: You can get more out of the XPS13 battery using the following script:

New Documentation for Collada

Minko’s Collada plugin makes it possible to easily import Collada (*.dae) files using the assets loading API. Working with the API is quite simple and there already is a detailed tutorial about that. But the Collada format has its flaws and it is sometimes very complicated to get your exported files to work properly.

That’s why I’ve compiled a new documentation article that explains how to properly export Collada files from 3D Studio Max:

Export Collada files from 3D Studio Max on Aerys Hub

The article details the export procedure itself but also provides guidelines to make sure the exported file will display properly with Minko. It also give details about the supported features, including material, material properties and how the engine will use them. Similar articles will be released for different editors and formats according to the community’s needs.

Of course, as soon as the Minko editor and the MK format will be available we will strongly discourage the use of Collada files in production for many reasons (mainly performances). But you will still need to import those Collada files into the editor first… So here is a little video to show how simple importing assets is with the editor:

Yes: it’s as simple as a drag’n’drop! You will also notice that the textures load automatically and that the editor will let you play the animations and make sure everything works out of the box. The editor will be available in open beta in March…

Minko Weekly Roundup #4

Features

  • The JointsDebugController makes it possible to display the joints and bones of a skinned mesh in order to check if everything works as expected.
  • The VertexPositionDebugController will display the position of each vertex of a mesh.
  • The VertexNormalDebugController will display the normal of each vertex. You can use it with the VertexNormalShader to display and debug the normals of a mesh.

Examples

Answers

Tutorials

Fixes

  • minko-collada will now load the vertex RGBA data when it’s available
  • min/max computation is always possible upon creation of a VertexStream regardless of its StreamUsage
  • frustum culling will now also test the center of the bounding box and not only the 8 corners

Tutorial: Add pixel-perfect 3D mouse interactivity

In this tutorial we’re going to see how you can add pixel-perfect 3D mouse interactivity. I’ve already introduced a technique called “ray casting” in another article. But it works only with very basic static shapes. And sometimes, testing very complex shapes can be very painful performance wise. It’s even more expensive when you want it to be very precise.

In this article, we will see a technique called “pixel picking”. This technique uses hardware acceleration to provide pixel perfect mouse interactivity. It works very well for both static and animated models. The concept is very simple: we render the scene with one color per mesh. Then, we just have to get the pixel under the mouse cursor to know what mesh is “interactive”. Of course, things are much more complicated in the real life: this kind of stunts are pretty hard to push properly in a general purpose rendering pipeline.

But Minko provides everything required out of the box! Even better, the minko-picking extension features a simple controller – the PickingController – that provides all the mouse signals we might need! This tutorial will explain how to setup the PickingController and listen for the mouse signals.


Pixel picking test application (sources)

Create and setup the PickingController

The first step is to instanciate a new PickingController:

The constructor takes only one argument: the “picking rate” of the controller. This value will determine how many times per second the controller will try to execute the picking pass and the relevant mouse signals. The lower the picking rate, the better the performances. A picking rate of 30 should be more than enough for 99% of the applications. You can also set that value at any time using the PickingController.pickingRate property:

Setting the picking rate to the half of the frame rate will work just fine for most applications and should be completely painless performance wise. By default, the picking rate is fixed to 15.

Set the mouse events source

The job of the PickingController is to listen for the mouse events on one (or more) specific dispatcher(s) and re-dispatch them as mouse signals. The difference between the original events and the signals executed by the PickingController is that the signals are aware of the 3D scene. To setup the dispatcher to listen, you just have to call the PickingController.bindDefaultInputs() and provide the IDispatcher object to listen:

Setup the PickingController on the 3D scene

In most cases, you don’t want the whole 3D scene to be mouse interactive. Sometimes it’s just a Mesh or a Group. The PickingController can be added to any Mesh/Group so it’s easy to target precisely what is interactive and what is not. The basic use case is to add mouse interactivity on a single Mesh:

BUt you also might want to listen for the mouse signals trigerred by a whole sub-scene instead of a single mesh. For example, some skinned 3D assets have multiple meshes animated by a single skeleton. To do this, we can add the PickingController on Group:

In the code snippet above, the PickingController will execute mouse signals for all the Mesh descendants of the target group. You don’t have to worry about the descendants of the groups targeted by a PickingController: it will listen for the Group.descendantsAdded and Group.descendantsRemoved to start/stop tracking any descendant Mesh added to this part of the scene.

Thus, if your whole 3D scene is interactive, you can add the PickingController directly on the Scene node:

Listen for the mouse signals

To catch 3D mouse events, you just have to add callback(s) to any of the PickingController.mouse* signals. The available signals are:

  • mouseClick, mouseDown, mouseUp: executed when the left button is clicked, down or up
  • mouseRightClick, mouseRightDown, mouseRightUp: executed when the right button is clicked, down or up
  • mouseMiddleClick, mouseMiddleDown, mouseMiddleUp: executed when the right button is clicked, down or up
  • mouseDoubleClick: executed when the user makes a double click
  • mouseMove: executed when the mouse moves
  • mouseWheel: executed when the mouse wheel turns
  • mouseRollOver, mouseRollOut: executed when the mouse roll over/out a mesh

The following code sample will catch the left and the right click signals:

It would be too difficult to use the PickingController if the mouse signals where triggered only when an actual 3D object is under the cursor. For example, it would be pretty hard to select/unselect objects without listening to some actual 2D mouse events. The code would then quickly become very complicated to mix both 2D mouse events and 3D mouse signals.

Therefore, the mouse signals are triggered whenever the corresponding mouse event is dispatched (and when the picking rate allows it of course). As a direct consequence, the mesh : Mesh argument is null when there is no actual interactive 3D object under the mouse cursor.

Conclusion

You can find the complete source code of the picking example demo in the minko-examples repository on github. If you have questions/suggestions regarding this comment, you can ask them in the comments or on Aerys Answers, the official support forum for Minko.