Skip to content

Instantly share code, notes, and snippets.

@UXVirtual
Last active November 15, 2017 02:13
Show Gist options
  • Save UXVirtual/ac5aee4ce2fbb7f1135a62cc2a2838f7 to your computer and use it in GitHub Desktop.
Save UXVirtual/ac5aee4ce2fbb7f1135a62cc2a2838f7 to your computer and use it in GitHub Desktop.
Babylon.js PBR Demo
var CreatePBRGlossyScene = function (engine) {
var scene = new BABYLON.Scene(engine);
scene.clearColor = new BABYLON.Color4(0.02, 0.02, 0.02, 1.0);
scene.imageProcessingConfiguration.contrast = 1.6;
scene.imageProcessingConfiguration.exposure = 0.6;
scene.imageProcessingConfiguration.toneMappingEnabled = true;
engine.setHardwareScalingLevel(0.5);
var hdrTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("/Assets/environment.dds", scene);
hdrTexture.gammaSpace = false;
BABYLON.SceneLoader.Append("/Assets/DamagedHelmet/glTF/", "DamagedHelmet.gltf", scene, function () {
scene.createDefaultCameraOrLight(true, true, true);
scene.createDefaultSkybox(hdrTexture, true, 100, 0.3);
scene.activeCamera.lowerRadiusLimit = 2;
scene.activeCamera.upperRadiusLimit = 20;
});
return scene;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment