Last active
November 15, 2017 02:13
-
-
Save UXVirtual/ac5aee4ce2fbb7f1135a62cc2a2838f7 to your computer and use it in GitHub Desktop.
Babylon.js PBR Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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