瀏覽代碼

tweaked renderer params to enable AO by default

Alexander Rose 4 年之前
父節點
當前提交
afd18cabd4
共有 4 個文件被更改,包括 10 次插入10 次删除
  1. 2 2
      src/mol-canvas3d/camera.ts
  2. 1 1
      src/mol-canvas3d/canvas3d.ts
  3. 2 2
      src/mol-canvas3d/passes/postprocessing.ts
  4. 5 5
      src/mol-gl/renderer.ts

+ 2 - 2
src/mol-canvas3d/camera.ts

@@ -319,8 +319,8 @@ function updateClip(camera: Camera) {
     let far = cameraDistance + normalizedFar;
     let far = cameraDistance + normalizedFar;
 
 
     const fogNearFactor = -(50 - fog) / 50;
     const fogNearFactor = -(50 - fog) / 50;
-    let fogNear = cameraDistance - (normalizedFar * fogNearFactor);
-    let fogFar = far;
+    const fogNear = cameraDistance - (normalizedFar * fogNearFactor);
+    const fogFar = far;
 
 
     if (mode === 'perspective') {
     if (mode === 'perspective') {
         // set at least to 5 to avoid slow sphere impostor rendering
         // set at least to 5 to avoid slow sphere impostor rendering

+ 1 - 1
src/mol-canvas3d/canvas3d.ts

@@ -51,7 +51,7 @@ export const Canvas3DParams = {
     }, { pivot: 'mode' }),
     }, { pivot: 'mode' }),
     cameraFog: PD.MappedStatic('on', {
     cameraFog: PD.MappedStatic('on', {
         on: PD.Group({
         on: PD.Group({
-            intensity: PD.Numeric(50, { min: 1, max: 100, step: 1 }),
+            intensity: PD.Numeric(15, { min: 1, max: 100, step: 1 }),
         }),
         }),
         off: PD.Group({})
         off: PD.Group({})
     }, { cycle: true, description: 'Show fog in the distance' }),
     }, { cycle: true, description: 'Show fog in the distance' }),

+ 2 - 2
src/mol-canvas3d/passes/postprocessing.ts

@@ -235,11 +235,11 @@ function getPostprocessingRenderable(ctx: WebGLContext, colorTexture: Texture, d
 }
 }
 
 
 export const PostprocessingParams = {
 export const PostprocessingParams = {
-    occlusion: PD.MappedStatic('off', {
+    occlusion: PD.MappedStatic('on', {
         on: PD.Group({
         on: PD.Group({
             samples: PD.Numeric(64, {min: 1, max: 256, step: 1}),
             samples: PD.Numeric(64, {min: 1, max: 256, step: 1}),
             radius: PD.Numeric(5, { min: 0, max: 10, step: 0.1 }, { description: 'Final radius is 2^x.' }),
             radius: PD.Numeric(5, { min: 0, max: 10, step: 0.1 }, { description: 'Final radius is 2^x.' }),
-            bias: PD.Numeric(1.2, { min: 0, max: 5, step: 0.1 }),
+            bias: PD.Numeric(0.8, { min: 0, max: 3, step: 0.1 }),
             blurKernelSize: PD.Numeric(20, { min: 1, max: 25, step: 2 }),
             blurKernelSize: PD.Numeric(20, { min: 1, max: 25, step: 2 }),
         }),
         }),
         off: PD.Group({})
         off: PD.Group({})

+ 5 - 5
src/mol-gl/renderer.ts

@@ -119,22 +119,22 @@ function getStyle(props: RendererProps['style']) {
             };
             };
         case 'matte':
         case 'matte':
             return {
             return {
-                lightIntensity: 0.6, ambientIntensity: 0.4,
+                lightIntensity: 0.7, ambientIntensity: 0.3,
                 metalness: 0, roughness: 1, reflectivity: 0.5
                 metalness: 0, roughness: 1, reflectivity: 0.5
             };
             };
         case 'glossy':
         case 'glossy':
             return {
             return {
-                lightIntensity: 0.6, ambientIntensity: 0.4,
+                lightIntensity: 0.7, ambientIntensity: 0.3,
                 metalness: 0, roughness: 0.4, reflectivity: 0.5
                 metalness: 0, roughness: 0.4, reflectivity: 0.5
             };
             };
         case 'metallic':
         case 'metallic':
             return {
             return {
-                lightIntensity: 0.6, ambientIntensity: 0.4,
-                metalness: 0.4, roughness: 0.6, reflectivity: 0.5
+                lightIntensity: 0.7, ambientIntensity: 0.7,
+                metalness: 0.6, roughness: 0.6, reflectivity: 0.5
             };
             };
         case 'plastic':
         case 'plastic':
             return {
             return {
-                lightIntensity: 0.6, ambientIntensity: 0.4,
+                lightIntensity: 0.7, ambientIntensity: 0.3,
                 metalness: 0, roughness: 0.2, reflectivity: 0.5
                 metalness: 0, roughness: 0.2, reflectivity: 0.5
             };
             };
     }
     }